[
  {
    "path": ".github/FUNDING.yml",
    "content": "github: [oblador]\n"
  },
  {
    "path": ".github/workflows/tests.yml",
    "content": "name: Tests\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n\njobs:\n  unit-tests:\n    name: Unit tests\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js\n        uses: actions/setup-node@v2\n        with:\n          node-version-file: '.node-version'\n      - name: Install dependencies\n        run: yarn --frozen-lockfile --non-interactive --silent --ignore-scripts\n      - name: Run tests\n        run: yarn test\n\n  integration-tests:\n    name: Integration tests\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js\n        uses: actions/setup-node@v2\n        with:\n          node-version-file: '.node-version'\n      - name: Install dependencies\n        run: yarn --frozen-lockfile --non-interactive --silent\n      - name: Run tests\n        run: yarn workspace web-example run test\n\n  types:\n    name: Type checks\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js\n        uses: actions/setup-node@v2\n        with:\n          node-version-file: '.node-version'\n      - name: Install dependencies\n        run: yarn --frozen-lockfile --non-interactive --silent\n      - name: Check package types\n        run: yarn types\n      - name: Check web example types\n        run: yarn workspace web-example run tsc\n      - name: Check vanilla example types\n        run: yarn workspace vanilla-example run tsc\n\n  format:\n    name: Code formatting\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js\n        uses: actions/setup-node@v2\n        with:\n          node-version-file: '.node-version'\n      - name: Install dependencies\n        run: yarn --frozen-lockfile --non-interactive --silent --ignore-scripts\n      - name: Check formatting\n        run: yarn check-format\n\n  build:\n    name: Package builds\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions/checkout@v2\n      - name: Use Node.js\n        uses: actions/setup-node@v2\n        with:\n          node-version-file: '.node-version'\n      - name: Install dependencies\n        run: yarn --frozen-lockfile --non-interactive --silent --ignore-scripts\n      - name: Build packages\n        env:\n          PACKAGES: react-native-performance\n        run: for p in $PACKAGES; do pushd packages/$p && npm pack --dry-run && popd; done\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git\nnode_modules\n\n# Transpilation / bundling output\ndist\n\n# OSX\n.DS_Store\n\n# Xcode\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# generated by bob\npackages/*/lib/\n"
  },
  {
    "path": ".node-version",
    "content": "22.12.0\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"printWidth\": 80,\n  \"singleQuote\": true,\n  \"trailingComma\": \"es5\"\n}\n"
  },
  {
    "path": ".tool-versions",
    "content": "ruby 3.2.1\nbundler 2.6.0\n"
  },
  {
    "path": ".watchmanconfig",
    "content": "{\n  \"ignore_dirs\": [\n    \"examples/vanilla/ios\",\n    \"examples/vanilla/android\",\n    \"examples/react-native-navigation/ios\",\n    \"examples/react-native-navigation/android\"\n  ]\n}\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2019 - present Joel Arvidsson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "# React Native Performance tooling\n\nToolchain to measure and monitor the performance of your React Native app in development, pipeline and in production.\n\n## Packages\n\n### [`react-native-performance`](https://github.com/oblador/react-native-performance/blob/master/packages/react-native-performance/README.md)\n\nAn implementation of the [`Performance` API](https://developer.mozilla.org/en-US/docs/Web/API/Performance) for React Native.\n\n- Integrates well with `React.Profiler` API\n- Trace arbitrary events in your app such as component render time\n- Capture network traffic\n- Collect native traces such as script execution and time to interactive of root view\n- Collect native metrics in development such as JS bundle size\n\n### [`isomorphic-performance`](https://github.com/oblador/react-native-performance/blob/master/packages/isomorphic-performance/README.md)\n\nIsomorphic Performance API for Node, Browser & React Native. Useful if your app targets both web and native.\n\n## Demo\n\nSee the projects in the [`examples`](https://github.com/oblador/react-native-performance/tree/master/examples) folder.\n\n## Devtools integration\n\nWith Flipper deprecated, the best replacement is currently [Rozenite](https://www.rozenite.dev) that supports `react-native-performance` out of the box with an [official plugin](https://www.rozenite.dev/docs/official-plugins/performance-monitor).\n\n## Development\n\nMake sure to have [`yarn`](https://classic.yarnpkg.com/lang/en/) v1 installed and run `yarn` in the root folder to install dependencies for all packages.\n\nRun the example app with:\n\n```bash\ncd examples/vanilla\nyarn start # important to run this before the next step!\nyarn ios # or yarn android\n```\n\nRun the unit tests with:\n\n```bash\nyarn test\n```\n\n## License\n\nMIT © Joel Arvidsson 2019 – present\n"
  },
  {
    "path": "examples/vanilla/.bundle/config",
    "content": "BUNDLE_PATH: \"vendor/bundle\"\nBUNDLE_FORCE_RUBY_PLATFORM: 1\n"
  },
  {
    "path": "examples/vanilla/.eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  extends: '@react-native',\n};\n"
  },
  {
    "path": "examples/vanilla/.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\n**/.xcode.env.local\n\n# Android/IntelliJ\n#\nbuild/\n.idea\n.gradle\nlocal.properties\n*.iml\n*.hprof\n.cxx/\n*.keystore\n!debug.keystore\n.kotlin/\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\nyarn-error.log\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**/fastlane/test_output\n\n# Bundle artifact\n*.jsbundle\n\n# Ruby / CocoaPods\n**/Pods/\n/vendor/bundle/\n\n# Temporary files created by Metro to check the health of the file watcher\n.metro-health-check*\n\n# testing\n/coverage\n\n# Yarn\n.yarn/*\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/sdks\n!.yarn/versions\n"
  },
  {
    "path": "examples/vanilla/.watchmanconfig",
    "content": "{}\n"
  },
  {
    "path": "examples/vanilla/App.tsx",
    "content": "/**\n * Sample React Native App\n * https://github.com/facebook/react-native\n *\n * @format\n * @flow strict-local\n */\n\nimport React, { Profiler, ProfilerOnRenderCallback } from 'react';\nimport { StyleSheet, ScrollView, View, Text } from 'react-native';\n\nimport { Header, Colors } from 'react-native/Libraries/NewAppScreen';\n\nimport performance, {\n  setResourceLoggingEnabled,\n  PerformanceObserver,\n} from 'react-native-performance';\nimport type {\n  PerformanceMetric,\n  PerformanceResourceTiming,\n  PerformanceReactNativeMark,\n} from 'react-native-performance';\n\nsetResourceLoggingEnabled(true);\n\nconst traceRender: ProfilerOnRenderCallback = (\n  id, // the \"id\" prop of the Profiler tree that has just committed\n  phase, // either \"mount\" (if the tree just mounted) or \"update\" (if it re-rendered)\n  actualDuration, // time spent rendering the committed update\n  baseDuration, // estimated time to render the entire subtree without memoization\n  startTime, // when React began rendering this update\n  _commitTime, // when React committed this update\n  _interactions // the Set of interactions belonging to this update\n) =>\n  performance.measure(id, {\n    start: startTime,\n    duration: actualDuration,\n  });\n\nconst formatValue = (value: number, unit?: string) => {\n  switch (unit) {\n    case 'ms':\n      return `${value.toFixed(1)}ms`;\n    case 'byte':\n      return `${(value / 1024 / 1024).toFixed(1)}MB`;\n    case '$DOGE':\n      return `${value} doge coins`;\n    default:\n      return value.toFixed(1);\n  }\n};\n\nconst Entry = ({\n  name,\n  value,\n  unit = 'ms',\n}: {\n  name: string;\n  value: number;\n  unit?: string;\n}) => (\n  <Text style={styles.entry}>\n    {name}: {formatValue(value, unit)}\n  </Text>\n);\n\nconst App = () => {\n  const [metrics, setMetrics] = React.useState<PerformanceMetric[]>([]);\n  const [nativeMarks, setNativeMarks] = React.useState<\n    PerformanceReactNativeMark[]\n  >([]);\n  const [resources, setResources] = React.useState<PerformanceResourceTiming[]>(\n    []\n  );\n  React.useEffect(() => {\n    new PerformanceObserver(() => {\n      setNativeMarks(\n        performance\n          .getEntriesByType('react-native-mark')\n          .sort(\n            (a: PerformanceReactNativeMark, b: PerformanceReactNativeMark) =>\n              a.startTime - b.startTime\n          )\n      );\n    }).observe({ type: 'react-native-mark', buffered: true });\n\n    new PerformanceObserver(() => {\n      setMetrics(performance.getEntriesByType('metric'));\n    }).observe({ type: 'metric', buffered: true });\n    new PerformanceObserver(() => {\n      setResources(performance.getEntriesByType('resource'));\n    }).observe({ type: 'resource', buffered: true });\n  }, []);\n\n  React.useEffect(() => {\n    // @ts-ignore\n    fetch('https://xkcd.com/info.0.json', { cache: 'no-cache' });\n  }, []);\n\n  return (\n    <Profiler id=\"App.render()\" onRender={traceRender}>\n      <ScrollView\n        contentInsetAdjustmentBehavior=\"automatic\"\n        style={styles.scrollView}\n      >\n        <Header />\n        <View style={styles.body}>\n          <View style={styles.sectionContainer}>\n            <Text style={styles.sectionTitle}>\n              performance.getEntriesByType('metric')\n            </Text>\n            {metrics.map(({ name, startTime, value, detail }) => (\n              <Entry\n                key={startTime}\n                name={name}\n                value={value as number}\n                unit={detail?.unit}\n              />\n            ))}\n          </View>\n          <View style={styles.sectionContainer}>\n            <Text style={styles.sectionTitle}>\n              performance.getEntriesByType('resource')\n            </Text>\n            {resources.map(({ name, duration, startTime }) => (\n              <Entry key={startTime} name={name} value={duration} />\n            ))}\n          </View>\n          <View style={styles.sectionContainer}>\n            <Text style={styles.sectionTitle}>\n              performance.getEntriesByType('react-native-mark')\n            </Text>\n            {nativeMarks.map(({ name, startTime }) => (\n              <Entry\n                key={`${name}:${startTime}`}\n                name={name}\n                value={startTime - performance.timeOrigin}\n              />\n            ))}\n          </View>\n        </View>\n      </ScrollView>\n    </Profiler>\n  );\n};\n\nconst styles = StyleSheet.create({\n  scrollView: {\n    backgroundColor: Colors.lighter,\n  },\n  engine: {\n    position: 'absolute',\n    right: 0,\n  },\n  body: {\n    backgroundColor: Colors.white,\n  },\n  sectionContainer: {\n    marginBottom: 20,\n    paddingHorizontal: 24,\n  },\n  sectionTitle: {\n    fontSize: 20,\n    fontWeight: '600',\n    color: Colors.black,\n    fontFamily: 'Courier',\n    marginTop: 20,\n    marginBottom: 10,\n  },\n  entry: {\n    marginBottom: 8,\n    fontSize: 14,\n    fontWeight: '400',\n    color: Colors.dark,\n    fontFamily: 'Courier',\n  },\n  footer: {\n    color: Colors.dark,\n    fontSize: 12,\n    fontWeight: '600',\n    padding: 4,\n    paddingRight: 12,\n    textAlign: 'right',\n  },\n});\n\nexport default App;\n"
  },
  {
    "path": "examples/vanilla/Gemfile",
    "content": "source 'https://rubygems.org'\n\n# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version\nruby \">= 2.6.10\"\n\n# Exclude problematic versions of cocoapods and activesupport that causes build failures.\ngem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'\ngem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'\ngem 'xcodeproj', '< 1.26.0'\ngem 'concurrent-ruby', '< 1.3.4'\n"
  },
  {
    "path": "examples/vanilla/README.md",
    "content": "This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).\n\n# Getting Started\n\n> **Note**: Make sure you have completed the [Set Up Your Environment](https://reactnative.dev/docs/set-up-your-environment) guide before proceeding.\n\n## Step 1: Start Metro\n\nFirst, you will need to run **Metro**, the JavaScript build tool for React Native.\n\nTo start the Metro dev server, run the following command from the root of your React Native project:\n\n```sh\n# Using npm\nnpm start\n\n# OR using Yarn\nyarn start\n```\n\n## Step 2: Build and run your app\n\nWith Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:\n\n### Android\n\n```sh\n# Using npm\nnpm run android\n\n# OR using Yarn\nyarn android\n```\n\n### iOS\n\nFor iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).\n\nThe first time you create a new project, run the Ruby bundler to install CocoaPods itself:\n\n```sh\nbundle install\n```\n\nThen, and every time you update your native dependencies, run:\n\n```sh\nbundle exec pod install\n```\n\nFor more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).\n\n```sh\n# Using npm\nnpm run ios\n\n# OR using Yarn\nyarn ios\n```\n\nIf everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.\n\nThis is one way to run your app — you can also build it directly from Android Studio or Xcode.\n\n## Step 3: Modify your app\n\nNow that you have successfully run the app, let's make changes!\n\nOpen `App.tsx` in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by [Fast Refresh](https://reactnative.dev/docs/fast-refresh).\n\nWhen you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:\n\n- **Android**: Press the <kbd>R</kbd> key twice or select **\"Reload\"** from the **Dev Menu**, accessed via <kbd>Ctrl</kbd> + <kbd>M</kbd> (Windows/Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (macOS).\n- **iOS**: Press <kbd>R</kbd> in iOS Simulator.\n\n## Congratulations! :tada:\n\nYou've successfully run and modified your React Native App. :partying_face:\n\n### Now what?\n\n- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).\n- If you're curious to learn more about React Native, check out the [docs](https://reactnative.dev/docs/getting-started).\n\n# Troubleshooting\n\nIf you're having issues getting the above steps to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.\n\n# Learn More\n\nTo learn more about React Native, take a look at the following resources:\n\n- [React Native Website](https://reactnative.dev) - learn more about React Native.\n- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.\n- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.\n- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.\n- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.\n"
  },
  {
    "path": "examples/vanilla/__tests__/App.test.tsx",
    "content": "/**\n * @format\n */\n\nimport React from 'react';\nimport ReactTestRenderer from 'react-test-renderer';\nimport App from '../App';\n\ntest('renders correctly', async () => {\n  await ReactTestRenderer.act(() => {\n    ReactTestRenderer.create(<App />);\n  });\n});\n"
  },
  {
    "path": "examples/vanilla/android/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\napply plugin: \"org.jetbrains.kotlin.android\"\napply plugin: \"com.facebook.react\"\n\n/**\n * This is the configuration block to customize your React Native Android app.\n * By default you don't need to apply any configuration, just uncomment the lines you need.\n */\nreact {\n    /* Folders */\n    //   The root of your project, i.e. where \"package.json\" lives. Default is '../..'\n    // root = file(\"../../\")\n    //   The folder where the react-native NPM package is. Default is ../../node_modules/react-native\n    reactNativeDir = file(\"../../../../node_modules/react-native\")\n    //   The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen\n    codegenDir = file(\"../../../../node_modules/@react-native/codegen\")\n    //   The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js\n    cliFile = file(\"../../../../node_modules/react-native/cli.js\")\n\n    /* Variants */\n    //   The list of variants to that are debuggable. For those we're going to\n    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.\n    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.\n    // debuggableVariants = [\"liteDebug\", \"prodDebug\"]\n\n    /* Bundling */\n    //   A list containing the node command and its flags. Default is just 'node'.\n    // nodeExecutableAndArgs = [\"node\"]\n    //\n    //   The command to run when bundling. By default is 'bundle'\n    // bundleCommand = \"ram-bundle\"\n    //\n    //   The path to the CLI configuration file. Default is empty.\n    // bundleConfig = file(../rn-cli.config.js)\n    //\n    //   The name of the generated asset file containing your JS bundle\n    // bundleAssetName = \"MyApplication.android.bundle\"\n    //\n    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'\n    // entryFile = file(\"../js/MyApplication.android.js\")\n    //\n    //   A list of extra flags to pass to the 'bundle' commands.\n    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle\n    // extraPackagerArgs = []\n\n    /* Hermes Commands */\n    //   The hermes compiler command to run. By default it is 'hermesc'\n    // hermesCommand = \"$rootDir/my-custom-hermesc/bin/hermesc\"\n    //\n    //   The list of flags to pass to the Hermes compiler. By default is \"-O\", \"-output-source-map\"\n    // hermesFlags = [\"-O\", \"-output-source-map\"]\n\n    /* Autolinking */\n    autolinkLibrariesWithApp()\n}\n\n/**\n * Set this to true to Run Proguard on Release builds to minify the Java bytecode.\n */\ndef enableProguardInReleaseBuilds = false\n\n/**\n * The preferred build flavor of JavaScriptCore (JSC)\n *\n * For example, to use the international variant, you can use:\n * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`\n *\n * The international variant includes ICU i18n library and necessary data\n * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that\n * give correct results when using with locales other than en-US. Note that\n * this variant is about 6MiB larger per architecture than default.\n */\ndef jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'\n\nandroid {\n    ndkVersion rootProject.ext.ndkVersion\n    buildToolsVersion rootProject.ext.buildToolsVersion\n    compileSdk rootProject.ext.compileSdkVersion\n\n    namespace \"com.example\"\n    defaultConfig {\n        applicationId \"com.example\"\n        minSdkVersion rootProject.ext.minSdkVersion\n        targetSdkVersion rootProject.ext.targetSdkVersion\n        versionCode 1\n        versionName \"1.0\"\n    }\n    signingConfigs {\n        debug {\n            storeFile file('debug.keystore')\n            storePassword 'android'\n            keyAlias 'androiddebugkey'\n            keyPassword 'android'\n        }\n    }\n    buildTypes {\n        debug {\n            signingConfig signingConfigs.debug\n        }\n        release {\n            // Caution! In production, you need to generate your own keystore file.\n            // see https://reactnative.dev/docs/signed-apk-android.\n            signingConfig signingConfigs.debug\n            minifyEnabled enableProguardInReleaseBuilds\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n}\n\ndependencies {\n    // The version of react-native is set by the React Native Gradle Plugin\n    implementation(\"com.facebook.react:react-android\")\n\n    if (hermesEnabled.toBoolean()) {\n        implementation(\"com.facebook.react:hermes-android\")\n    } else {\n        implementation jscFlavor\n    }\n}\n"
  },
  {
    "path": "examples/vanilla/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"
  },
  {
    "path": "examples/vanilla/android/app/src/debug/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <application\n        android:usesCleartextTraffic=\"true\"\n        tools:targetApi=\"28\"\n        tools:ignore=\"GoogleAppIndexingWarning\"/>\n</manifest>\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n\n    <application\n      android:name=\".MainApplication\"\n      android:label=\"@string/app_name\"\n      android:icon=\"@mipmap/ic_launcher\"\n      android:roundIcon=\"@mipmap/ic_launcher_round\"\n      android:allowBackup=\"false\"\n      android:theme=\"@style/AppTheme\"\n      android:supportsRtl=\"true\">\n      <activity\n        android:name=\".MainActivity\"\n        android:label=\"@string/app_name\"\n        android:configChanges=\"keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode\"\n        android:launchMode=\"singleTask\"\n        android:windowSoftInputMode=\"adjustResize\"\n        android:exported=\"true\">\n        <intent-filter>\n            <action android:name=\"android.intent.action.MAIN\" />\n            <category android:name=\"android.intent.category.LAUNCHER\" />\n        </intent-filter>\n      </activity>\n    </application>\n</manifest>\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/java/com/example/MainActivity.kt",
    "content": "package com.example\n\nimport com.facebook.react.ReactActivity\nimport com.facebook.react.ReactActivityDelegate\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled\nimport com.facebook.react.defaults.DefaultReactActivityDelegate\n\nclass MainActivity : ReactActivity() {\n\n  /**\n   * Returns the name of the main component registered from JavaScript. This is used to schedule\n   * rendering of the component.\n   */\n  override fun getMainComponentName(): String = \"Example\"\n\n  /**\n   * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]\n   * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]\n   */\n  override fun createReactActivityDelegate(): ReactActivityDelegate =\n      DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)\n}\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/java/com/example/MainApplication.kt",
    "content": "package com.example\n\nimport android.app.Application\nimport android.os.Bundle;\nimport android.os.Handler;\nimport android.os.Looper;\nimport com.facebook.react.PackageList\nimport com.facebook.react.ReactApplication\nimport com.facebook.react.ReactHost\nimport com.facebook.react.ReactNativeHost\nimport com.facebook.react.ReactPackage\nimport com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load\nimport com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost\nimport com.facebook.react.defaults.DefaultReactNativeHost\nimport com.facebook.react.soloader.OpenSourceMergedSoMapping\nimport com.facebook.soloader.SoLoader\nimport com.oblador.performance.RNPerformance;\n\nclass MainApplication : Application(), ReactApplication {\n\n  override val reactNativeHost: ReactNativeHost =\n      object : DefaultReactNativeHost(this) {\n        override fun getPackages(): List<ReactPackage> =\n            PackageList(this).packages.apply {\n              // Packages that cannot be autolinked yet can be added manually here, for example:\n              // add(MyReactNativePackage())\n            }\n\n        override fun getJSMainModuleName(): String = \"index\"\n\n        override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG\n\n        override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED\n        override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED\n      }\n\n  override val reactHost: ReactHost\n    get() = getDefaultReactHost(applicationContext, reactNativeHost)\n\n  override fun onCreate() {\n    RNPerformance.getInstance().mark(\"onCreateStart\")\n    super.onCreate()\n    SoLoader.init(this, OpenSourceMergedSoMapping)\n    if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {\n      // If you opted-in for the New Architecture, we load the native entry point for this app.\n      load()\n    }\n    RNPerformance.getInstance().mark(\"onCreateEnd\")\n    var detail = Bundle()\n    detail.putString(\"unit\", \"byte\")\n    RNPerformance.getInstance().metric(\"bundleSize\", 1337.0, detail)\n    Handler(Looper.getMainLooper()).postDelayed({ RNPerformance.getInstance().mark(\"Delayed Mark\") }, 3000L)\n  }\n}\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/res/drawable/rn_edit_text_material.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Copyright (C) 2014 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<inset xmlns:android=\"http://schemas.android.com/apk/res/android\"\n       android:insetLeft=\"@dimen/abc_edit_text_inset_horizontal_material\"\n       android:insetRight=\"@dimen/abc_edit_text_inset_horizontal_material\"\n       android:insetTop=\"@dimen/abc_edit_text_inset_top_material\"\n       android:insetBottom=\"@dimen/abc_edit_text_inset_bottom_material\"\n       >\n\n    <selector>\n        <!--\n          This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).\n          The item below with state_pressed=\"false\" and state_focused=\"false\" causes a NullPointerException.\n          NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'\n\n          <item android:state_pressed=\"false\" android:state_focused=\"false\" android:drawable=\"@drawable/abc_textfield_default_mtrl_alpha\"/>\n\n          For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.\n        -->\n        <item android:state_enabled=\"false\" android:drawable=\"@drawable/abc_textfield_default_mtrl_alpha\"/>\n        <item android:drawable=\"@drawable/abc_textfield_activated_mtrl_alpha\"/>\n    </selector>\n\n</inset>\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Example</string>\n</resources>\n"
  },
  {
    "path": "examples/vanilla/android/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"android:editTextBackground\">@drawable/rn_edit_text_material</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "examples/vanilla/android/build.gradle",
    "content": "buildscript {\n    ext {\n        buildToolsVersion = \"35.0.0\"\n        minSdkVersion = 24\n        compileSdkVersion = 35\n        targetSdkVersion = 35\n        ndkVersion = \"27.1.12297006\"\n        kotlinVersion = \"2.0.21\"\n    }\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath(\"com.android.tools.build:gradle\")\n        classpath(\"com.facebook.react:react-native-gradle-plugin\")\n        classpath(\"org.jetbrains.kotlin:kotlin-gradle-plugin\")\n    }\n}\n\napply plugin: \"com.facebook.react.rootproject\"\n"
  },
  {
    "path": "examples/vanilla/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.12-all.zip\nnetworkTimeout=10000\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "examples/vanilla/android/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m\norg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n\n# Use this property to specify which architecture you want to build.\n# You can also override it from the CLI using\n# ./gradlew <task> -PreactNativeArchitectures=x86_64\nreactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64\n\n# Use this property to enable support to the new architecture.\n# This will allow you to use TurboModules and the Fabric render in\n# your application. You should enable this flag either if you want\n# to write custom TurboModules/Fabric components OR use libraries that\n# are providing them.\nnewArchEnabled=true\n\n# Use this property to enable or disable the Hermes JS engine.\n# If set to false, you will be using JSC instead.\nhermesEnabled=true\n"
  },
  {
    "path": "examples/vanilla/android/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# SPDX-License-Identifier: Apache-2.0\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd -P \"${APP_HOME:-./}\" > /dev/null && printf '%s\\n' \"$PWD\" ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\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    if ! command -v java >/dev/null 2>&1\n    then\n        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.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\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='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command:\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,\n#     and any embedded shellness will be escaped.\n#   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be\n#     treated as '${Hostname}' itself on the command line.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "examples/vanilla/android/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n@rem SPDX-License-Identifier: Apache-2.0\r\n@rem\r\n\r\n@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\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\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=\"-Xmx64m\" \"-Xms64m\"\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% equ 0 goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\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 execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\ngoto fail\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\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 %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 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\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "examples/vanilla/android/settings.gradle",
    "content": "pluginManagement { includeBuild(\"../../../node_modules/@react-native/gradle-plugin\") }\nplugins { id(\"com.facebook.react.settings\") }\nextensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }\nrootProject.name = 'Example'\ninclude ':app'\nincludeBuild('../../../node_modules/@react-native/gradle-plugin')\n"
  },
  {
    "path": "examples/vanilla/app.json",
    "content": "{\n  \"name\": \"Example\",\n  \"displayName\": \"Example\"\n}\n"
  },
  {
    "path": "examples/vanilla/babel.config.js",
    "content": "module.exports = {\n  presets: ['module:@react-native/babel-preset'],\n};\n"
  },
  {
    "path": "examples/vanilla/index.js",
    "content": "import { AppRegistry } from 'react-native';\nimport App from './App';\nimport { name as appName } from './app.json';\n\nAppRegistry.registerComponent(appName, () => App);\n"
  },
  {
    "path": "examples/vanilla/ios/.xcode.env",
    "content": "# This `.xcode.env` file is versioned and is used to source the environment\n# used when running script phases inside Xcode.\n# To customize your local environment, you can create an `.xcode.env.local`\n# file that is not versioned.\n\n# NODE_BINARY variable contains the PATH to the node executable.\n#\n# Customize the NODE_BINARY variable here.\n# For example, to use nvm with brew, add the following line\n# . \"$(brew --prefix nvm)/nvm.sh\" --no-use\nexport NODE_BINARY=$(command -v node)\n"
  },
  {
    "path": "examples/vanilla/ios/Example/AppDelegate.swift",
    "content": "import UIKit\nimport React\nimport React_RCTAppDelegate\nimport ReactAppDependencyProvider\n\n@main\nclass AppDelegate: RCTAppDelegate {\n  override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {\n    self.moduleName = \"Example\"\n    self.dependencyProvider = RCTAppDependencyProvider()\n\n    // You can add your custom initial props in the dictionary below.\n    // They will be passed down to the ViewController used by React Native.\n    self.initialProps = [:]\n    RNPerformance.sharedInstance().mark(\"myCustomMark\", ephemeral: false)\n      /*\n    [RNPerformance.sharedInstance mark:@\"myCustomMark\"];\n    [RNPerformance.sharedInstance mark:@\"myCustomMark\" detail:@{ @\"extra\": @\"info\" }];\n    [RNPerformance.sharedInstance mark:@\"myCustomMark\" ephemeral:NO];\n\n    [RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123)];\n    [RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123) detail:@{ @\"unit\": @\"ms\" }];\n    [RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123) ephemeral:NO];*/\n\n    return super.application(application, didFinishLaunchingWithOptions: launchOptions)\n  }\n\n  override func sourceURL(for bridge: RCTBridge) -> URL? {\n    self.bundleURL()\n  }\n\n  override func bundleURL() -> URL? {\n#if DEBUG\n    RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: \"index\")\n#else\n    Bundle.main.url(forResource: \"main\", withExtension: \"jsbundle\")\n#endif\n  }\n}\n"
  },
  {
    "path": "examples/vanilla/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "examples/vanilla/ios/Example/Images.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}\n"
  },
  {
    "path": "examples/vanilla/ios/Example/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>Example</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>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>$(MARKETING_VERSION)</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t  <!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<false/>\n\t\t<key>NSAllowsLocalNetworking</key>\n\t\t<true/>\n\t</dict>\n\t<key>NSLocationWhenInUseUsageDescription</key>\n\t<string></string>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>arm64</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</dict>\n</plist>\n"
  },
  {
    "path": "examples/vanilla/ios/Example/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"15702\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <device id=\"retina4_7\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"15704\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\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=\"Example\" textAlignment=\"center\" lineBreakMode=\"middleTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"18\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"GJd-Yh-RWb\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"202\" width=\"375\" height=\"43\"/>\n                                <fontDescription key=\"fontDescription\" type=\"boldSystem\" pointSize=\"36\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <label opaque=\"NO\" clipsSubviews=\"YES\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Powered by React Native\" textAlignment=\"center\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" minimumFontSize=\"9\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"MN2-I3-ftu\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"626\" width=\"375\" height=\"21\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                        </subviews>\n                        <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\" cocoaTouchSystemColor=\"whiteColor\"/>\n                        <constraints>\n                            <constraint firstItem=\"Bcu-3y-fUS\" firstAttribute=\"bottom\" secondItem=\"MN2-I3-ftu\" secondAttribute=\"bottom\" constant=\"20\" id=\"OZV-Vh-mqD\"/>\n                            <constraint firstItem=\"Bcu-3y-fUS\" firstAttribute=\"centerX\" secondItem=\"GJd-Yh-RWb\" secondAttribute=\"centerX\" id=\"Q3B-4B-g5h\"/>\n                            <constraint firstItem=\"MN2-I3-ftu\" firstAttribute=\"centerX\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"centerX\" id=\"akx-eg-2ui\"/>\n                            <constraint firstItem=\"MN2-I3-ftu\" firstAttribute=\"leading\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"leading\" id=\"i1E-0Y-4RG\"/>\n                            <constraint firstItem=\"GJd-Yh-RWb\" firstAttribute=\"centerY\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"bottom\" multiplier=\"1/3\" constant=\"1\" id=\"moa-c2-u7t\"/>\n                            <constraint firstItem=\"GJd-Yh-RWb\" firstAttribute=\"leading\" secondItem=\"Bcu-3y-fUS\" secondAttribute=\"leading\" symbolic=\"YES\" id=\"x7j-FC-K8j\"/>\n                        </constraints>\n                        <viewLayoutGuide key=\"safeArea\" id=\"Bcu-3y-fUS\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"52.173913043478265\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "examples/vanilla/ios/Example/PrivacyInfo.xcprivacy",
    "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>NSPrivacyAccessedAPITypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>C617.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategoryUserDefaults</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>CA92.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>NSPrivacyAccessedAPIType</key>\n\t\t\t<string>NSPrivacyAccessedAPICategorySystemBootTime</string>\n\t\t\t<key>NSPrivacyAccessedAPITypeReasons</key>\n\t\t\t<array>\n\t\t\t\t<string>35F9.1</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n\t<key>NSPrivacyCollectedDataTypes</key>\n\t<array/>\n\t<key>NSPrivacyTracking</key>\n\t<false/>\n</dict>\n</plist>\n"
  },
  {
    "path": "examples/vanilla/ios/Example-Bridging-Header.h",
    "content": "//\n//  Example-Bridging-Header.h\n//  Example\n//\n//  Created by Joel Arvidsson on 2025-04-05.\n//\n\n#import <react-native-performance/RNPerformance.h>\n"
  },
  {
    "path": "examples/vanilla/ios/Example.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 54;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t0C80B921A6F3F58F76C31292 /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */; };\n\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };\n\t\t761780ED2CA45674006654EE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 761780EC2CA45674006654EE /* AppDelegate.swift */; };\n\t\t7DEBBB6DE2ED1027D5165AD4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */; };\n\t\t81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = \"<group>\"; };\n\t\t13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = \"<group>\"; };\n\t\t13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = Example/PrivacyInfo.xcprivacy; sourceTree = \"<group>\"; };\n\t\t3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-Example.debug.xcconfig\"; path = \"Target Support Files/Pods-Example/Pods-Example.debug.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-Example.release.xcconfig\"; path = \"Target Support Files/Pods-Example/Pods-Example.release.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-Example.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5DD804042DA11CD300D134D5 /* Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = \"Example-Bridging-Header.h\"; sourceTree = \"<group>\"; };\n\t\t761780EC2CA45674006654EE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Example/AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Example/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\tED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t13B07F8C1A680F5B00A75B9A /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0C80B921A6F3F58F76C31292 /* libPods-Example.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\t13B07FAE1A68108700A75B9A /* Example */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5DD804042DA11CD300D134D5 /* Example-Bridging-Header.h */,\n\t\t\t\t13B07FB51A68108700A75B9A /* Images.xcassets */,\n\t\t\t\t761780EC2CA45674006654EE /* AppDelegate.swift */,\n\t\t\t\t13B07FB61A68108700A75B9A /* Info.plist */,\n\t\t\t\t81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,\n\t\t\t\t13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,\n\t\t\t);\n\t\t\tname = Example;\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\tED297162215061F000B7C4FE /* JavaScriptCore.framework */,\n\t\t\t\t5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\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);\n\t\t\tname = Libraries;\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 /* Example */,\n\t\t\t\t832341AE1AAA6A7D00B99B32 /* Libraries */,\n\t\t\t\t83CBBA001A601CBA00E9B192 /* Products */,\n\t\t\t\t2D16E6871FA4F8E400B85C8A /* Frameworks */,\n\t\t\t\tBBD78D7AC51CEA395F1C20DB /* Pods */,\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 /* Example.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tBBD78D7AC51CEA395F1C20DB /* Pods */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */,\n\t\t\t\t5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */,\n\t\t\t);\n\t\t\tpath = Pods;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t13B07F861A680F5B00A75B9A /* Example */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"Example\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tC38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,\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\t00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,\n\t\t\t\tE235C05ADACE081382539298 /* [CP] Copy Pods 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 = Example;\n\t\t\tproductName = Example;\n\t\t\tproductReference = 13B07F961A680F5B00A75B9A /* Example.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 = 1210;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t13B07F861A680F5B00A75B9A = {\n\t\t\t\t\t\tLastSwiftMigration = 1120;\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 \"Example\" */;\n\t\t\tcompatibilityVersion = \"Xcode 12.0\";\n\t\t\tdevelopmentRegion = en;\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\t13B07F861A680F5B00A75B9A /* Example */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t13B07F8E1A680F5B00A75B9A /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,\n\t\t\t\t7DEBBB6DE2ED1027D5165AD4 /* PrivacyInfo.xcprivacy 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\t\"$(SRCROOT)/.xcode.env.local\",\n\t\t\t\t\"$(SRCROOT)/.xcode.env\",\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 = \"set -e\\n\\nWITH_ENVIRONMENT=\\\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\\\"\\nREACT_NATIVE_XCODE=\\\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\\\"\\n\\n/bin/sh -c \\\"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\\\"\\n\";\n\t\t};\n\t\t00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Embed Pods Frameworks\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\tC38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\tE235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-input-files.xcfilelist\",\n\t\t\t);\n\t\t\tname = \"[CP] Copy Pods Resources\";\n\t\t\toutputFileListPaths = (\n\t\t\t\t\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-output-files.xcfilelist\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"\\\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t13B07F871A680F5B00A75B9A /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t761780ED2CA45674006654EE /* AppDelegate.swift 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\t13B07F941A680F5B00A75B9A /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tINFOPLIST_FILE = Example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\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_BUNDLE_IDENTIFIER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"Example-Bridging-Header.h\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 5.0;\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\tbaseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tINFOPLIST_FILE = Example/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 1.0;\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_BUNDLE_IDENTIFIER = \"org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)\";\n\t\t\t\tPRODUCT_NAME = Example;\n\t\t\t\tSWIFT_OBJC_BRIDGING_HEADER = \"Example-Bridging-Header.h\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\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_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\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_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = 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_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_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\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\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\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_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 = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t/usr/lib/swift,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/lib/swift\\\"\",\n\t\t\t\t\t\"\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(inherited)\\\"\",\n\t\t\t\t);\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = (\n\t\t\t\t\t\"$(OTHER_CFLAGS)\",\n\t\t\t\t\t\"-DFOLLY_NO_CONFIG\",\n\t\t\t\t\t\"-DFOLLY_MOBILE=1\",\n\t\t\t\t\t\"-DFOLLY_USE_LIBCPP=1\",\n\t\t\t\t\t\"-DFOLLY_CFG_NO_COROUTINES=1\",\n\t\t\t\t\t\"-DFOLLY_HAVE_CLOCK_GETTIME=1\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\" \",\n\t\t\t\t);\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = \"$(inherited) DEBUG\";\n\t\t\t\tUSE_HERMES = true;\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_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"c++20\";\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_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = 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_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_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\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\t\"EXCLUDED_ARCHS[sdk=iphonesimulator*]\" = \"\";\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 = 15.1;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t/usr/lib/swift,\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"\\\"$(SDKROOT)/usr/lib/swift\\\"\",\n\t\t\t\t\t\"\\\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\\\"\",\n\t\t\t\t\t\"\\\"$(inherited)\\\"\",\n\t\t\t\t);\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tOTHER_CPLUSPLUSFLAGS = (\n\t\t\t\t\t\"$(OTHER_CFLAGS)\",\n\t\t\t\t\t\"-DFOLLY_NO_CONFIG\",\n\t\t\t\t\t\"-DFOLLY_MOBILE=1\",\n\t\t\t\t\t\"-DFOLLY_USE_LIBCPP=1\",\n\t\t\t\t\t\"-DFOLLY_CFG_NO_COROUTINES=1\",\n\t\t\t\t\t\"-DFOLLY_HAVE_CLOCK_GETTIME=1\",\n\t\t\t\t);\n\t\t\t\tOTHER_LDFLAGS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\" \",\n\t\t\t\t);\n\t\t\t\tREACT_NATIVE_PATH = \"${PODS_ROOT}/../../../../node_modules/react-native\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tUSE_HERMES = true;\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\t13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget \"Example\" */ = {\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 \"Example\" */ = {\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": "examples/vanilla/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1210\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\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 = \"13B07F861A680F5B00A75B9A\"\n               BuildableName = \"Example.app\"\n               BlueprintName = \"Example\"\n               ReferencedContainer = \"container:Example.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 = \"ExampleTests.xctest\"\n               BlueprintName = \"ExampleTests\"\n               ReferencedContainer = \"container:Example.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\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 = \"Example.app\"\n            BlueprintName = \"Example\"\n            ReferencedContainer = \"container:Example.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\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 = \"Example.app\"\n            BlueprintName = \"Example\"\n            ReferencedContainer = \"container:Example.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": "examples/vanilla/ios/Example.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:Example.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:Pods/Pods.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "examples/vanilla/ios/Podfile",
    "content": "# Resolve react_native_pods.rb with node to allow for hoisting\nrequire Pod::Executable.execute_command('node', ['-p',\n  'require.resolve(\n    \"react-native/scripts/react_native_pods.rb\",\n    {paths: [process.argv[1]]},\n  )', __dir__]).strip\n\nplatform :ios, min_ios_version_supported\nprepare_react_native_project!\n\nlinkage = ENV['USE_FRAMEWORKS']\nif linkage != nil\n  Pod::UI.puts \"Configuring Pod with #{linkage}ally linked Frameworks\".green\n  use_frameworks! :linkage => linkage.to_sym\nend\n\ntarget 'Example' do\n  config = use_native_modules!\n\n  use_react_native!(\n    :path => config[:reactNativePath],\n    # An absolute path to your application root.\n    :app_path => \"#{Pod::Config.instance.installation_root}/..\"\n  )\n\n  post_install do |installer|\n    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202\n    react_native_post_install(\n      installer,\n      config[:reactNativePath],\n      :mac_catalyst_enabled => false,\n      # :ccache_enabled => true\n    )\n  end\nend\n"
  },
  {
    "path": "examples/vanilla/jest.config.js",
    "content": "module.exports = {\n  preset: 'react-native',\n};\n"
  },
  {
    "path": "examples/vanilla/metro.config.js",
    "content": "const path = require('path');\nconst { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');\n\n/**\n * Metro configuration\n * https://reactnative.dev/docs/metro\n *\n * @type {import('@react-native/metro-config').MetroConfig}\n */\nconst config = {\n  watchFolders: [path.resolve(__dirname, '../../')],\n};\n\nmodule.exports = mergeConfig(getDefaultConfig(__dirname), config);\n"
  },
  {
    "path": "examples/vanilla/package.json",
    "content": "{\n  \"name\": \"vanilla-example\",\n  \"version\": \"6.0.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"android\": \"react-native run-android\",\n    \"ios\": \"react-native run-ios\",\n    \"lint\": \"eslint .\",\n    \"start\": \"react-native start\",\n    \"test\": \"jest\"\n  },\n  \"dependencies\": {\n    \"react\": \"19.0.0\",\n    \"react-native\": \"0.78.2\",\n    \"react-native-performance\": \"^6.0.0\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.3\",\n    \"@babel/runtime\": \"^7.25.0\",\n    \"@react-native-community/cli\": \"15.0.1\",\n    \"@react-native-community/cli-platform-android\": \"15.0.1\",\n    \"@react-native-community/cli-platform-ios\": \"15.0.1\",\n    \"@react-native/babel-preset\": \"0.78.2\",\n    \"@react-native/eslint-config\": \"0.78.2\",\n    \"@react-native/metro-config\": \"0.78.2\",\n    \"@react-native/typescript-config\": \"0.78.2\",\n    \"@types/jest\": \"^29.5.13\",\n    \"@types/react\": \"^19.0.0\",\n    \"@types/react-test-renderer\": \"^19.0.0\",\n    \"eslint\": \"^8.19.0\",\n    \"jest\": \"^29.6.3\",\n    \"react-test-renderer\": \"19.0.0\",\n    \"typescript\": \"5.0.4\"\n  },\n  \"engines\": {\n    \"node\": \">=18\"\n  }\n}\n"
  },
  {
    "path": "examples/vanilla/tsconfig.json",
    "content": "{\n  \"extends\": \"@react-native/typescript-config/tsconfig.json\"\n}\n"
  },
  {
    "path": "examples/web/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "examples/web/README.md",
    "content": "# Getting Started with Create React App\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `yarn start`\n\nRuns the app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\\\nYou will also see any lint errors in the console.\n\n### `yarn test`\n\nLaunches the test runner in the interactive watch mode.\\\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `yarn eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n"
  },
  {
    "path": "examples/web/package.json",
    "content": "{\n  \"name\": \"web-example\",\n  \"version\": \"6.0.0\",\n  \"private\": true,\n  \"dependencies\": {\n    \"@testing-library/jest-dom\": \"^5.14.1\",\n    \"@testing-library/react\": \"^12.0.0\",\n    \"@testing-library/user-event\": \"^13.2.1\",\n    \"@types/jest\": \"^27.0.1\",\n    \"@types/node\": \"^16.7.13\",\n    \"@types/react\": \"^17.0.20\",\n    \"@types/react-dom\": \"^17.0.9\",\n    \"isomorphic-performance\": \"^6.0.0\",\n    \"react\": \"18.2.0\",\n    \"react-dom\": \"18.2.0\",\n    \"react-scripts\": \"5.0.1\",\n    \"typescript\": \"5.0.4\",\n    \"web-vitals\": \"^2.1.0\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": [\n      \"react-app\",\n      \"react-app/jest\"\n    ]\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "examples/web/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"%PUBLIC_URL%/logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "examples/web/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "examples/web/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
  },
  {
    "path": "examples/web/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n\n.App-logo {\n  height: 40vmin;\n  pointer-events: none;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .App-logo {\n    animation: App-logo-spin infinite 20s linear;\n  }\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #61dafb;\n}\n\n@keyframes App-logo-spin {\n  from {\n    transform: rotate(0deg);\n  }\n  to {\n    transform: rotate(360deg);\n  }\n}\n"
  },
  {
    "path": "examples/web/src/App.test.tsx",
    "content": "import React from 'react';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport App from './App';\n\ntest('renders App.render performance entry', async () => {\n  render(<App />);\n  await waitFor(() => screen.getByText(/App\\.render/i));\n});\n"
  },
  {
    "path": "examples/web/src/App.tsx",
    "content": "import React from 'react';\nimport logo from './logo.svg';\nimport './App.css';\nimport { performance, PerformanceObserver } from 'isomorphic-performance';\n\nfunction App() {\n  const [measures, setMeasures] = React.useState<PerformanceEntry[]>([]);\n  React.useEffect(() => {\n    performance.measure('App.render');\n    new PerformanceObserver(() => {\n      setMeasures(performance.getEntriesByName('App.render'));\n    }).observe({ type: 'measure', buffered: true });\n  }, []);\n\n  return (\n    <div className=\"App\">\n      <header className=\"App-header\">\n        <img src={logo} className=\"App-logo\" alt=\"logo\" />\n        <p>\n          Edit <code>src/App.tsx</code> and save to reload.\n        </p>\n        <a\n          className=\"App-link\"\n          href=\"https://reactjs.org\"\n          target=\"_blank\"\n          rel=\"noopener noreferrer\"\n        >\n          Learn React\n        </a>\n        <ul>\n          {measures.map((entry) => (\n            <li key={entry.startTime}>\n              {entry.name}: {entry.duration.toFixed(1)}ms\n            </li>\n          ))}\n        </ul>\n      </header>\n    </div>\n  );\n}\n\nexport default App;\n"
  },
  {
    "path": "examples/web/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "examples/web/src/index.tsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n  document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"
  },
  {
    "path": "examples/web/src/react-app-env.d.ts",
    "content": "/// <reference types=\"react-scripts\" />\n"
  },
  {
    "path": "examples/web/src/reportWebVitals.ts",
    "content": "import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n  if (onPerfEntry && onPerfEntry instanceof Function) {\n    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n      getCLS(onPerfEntry);\n      getFID(onPerfEntry);\n      getFCP(onPerfEntry);\n      getLCP(onPerfEntry);\n      getTTFB(onPerfEntry);\n    });\n  }\n};\n\nexport default reportWebVitals;\n"
  },
  {
    "path": "examples/web/src/setupTests.ts",
    "content": "// jest-dom adds custom jest matchers for asserting on DOM nodes.\n// allows you to do things like:\n// expect(element).toHaveTextContent(/react/i)\n// learn more: https://github.com/testing-library/jest-dom\nimport '@testing-library/jest-dom';\n"
  },
  {
    "path": "examples/web/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"noFallthroughCasesInSwitch\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react-jsx\"\n  },\n  \"include\": [\"src\"]\n}\n"
  },
  {
    "path": "lerna.json",
    "content": "{\n  \"version\": \"6.0.0\",\n  \"useWorkspaces\": true,\n  \"registry\": \"https://registry.npmjs.org\",\n  \"npmClient\": \"yarn\"\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"private\": true,\n  \"author\": \"Joel Arvidsson\",\n  \"license\": \"MIT\",\n  \"scripts\": {\n    \"build\": \"yarn workspace react-native-performance prepare\",\n    \"check-format\": \"prettier '{,packages/**/,examples/*/}*.{md,js,ts,tsx,json}' --check\",\n    \"format\": \"prettier '{,packages/**/,examples/*/}*.{md,js,ts,tsx,json}' --write\",\n    \"postinstall\": \"yarn build\",\n    \"test\": \"yarn workspace react-native-performance test\",\n    \"types\": \"tsc --noEmit\"\n  },\n  \"workspaces\": {\n    \"packages\": [\n      \"examples/*\",\n      \"packages/*\"\n    ]\n  },\n  \"devDependencies\": {\n    \"lerna\": \"^3.20.2\",\n    \"prettier\": \"^2.4.1\",\n    \"react\": \"19.0.0\",\n    \"react-native\": \"0.78.2\"\n  },\n  \"resolutions\": {\n    \"@types/eslint\": \"^7.28.2\",\n    \"@types/node\": \"*\",\n    \"@types/react\": \"^18.0.24\"\n  },\n  \"packageManager\": \"yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610\"\n}\n"
  },
  {
    "path": "packages/isomorphic-performance/README.md",
    "content": "# Isomorphic Performance\n\nIsomorphic Performance API for Node, Browser & React Native. Useful if your app targets both web and native.\n\n## Installation\n\n```bash\nyarn add react-native-performance isomorphic-performance\n```\n\n## Usage\n\n```js\nimport { performance, PerformanceObserver } from 'isomorphic-performance';\n\nperformance.mark('myMark');\n```\n\n## License\n\nMIT © Joel Arvidsson 2021 – present\n"
  },
  {
    "path": "packages/isomorphic-performance/package.json",
    "content": "{\n  \"name\": \"isomorphic-performance\",\n  \"version\": \"6.0.0\",\n  \"description\": \"Isomorphic Performance API for Node, Browser & React Native\",\n  \"homepage\": \"https://github.com/oblador/react-native-performance\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/oblador/react-native-performance.git\"\n  },\n  \"main\": \"src/node.js\",\n  \"browser\": \"src/browser.js\",\n  \"react-native\": \"src/react-native.js\",\n  \"types\": \"src/types.d.ts\",\n  \"files\": [\n    \"src\"\n  ],\n  \"peerDependencies\": {\n    \"react-native-performance\": \"*\"\n  },\n  \"devDependencies\": {\n    \"typescript\": \"5.0.4\"\n  },\n  \"keywords\": [\n    \"performance\",\n    \"perf\",\n    \"react-native\",\n    \"node\",\n    \"browser\",\n    \"benchmark\"\n  ],\n  \"author\": \"Joel Arvidsson\",\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "packages/isomorphic-performance/src/browser.js",
    "content": "const g = typeof globalThis === 'undefined' ? window : globalThis;\n\nmodule.exports = {\n  PerformanceObserver: g.PerformanceObserver,\n  performance: g.performance,\n};\n"
  },
  {
    "path": "packages/isomorphic-performance/src/node.js",
    "content": "const { performance } = require('perf_hooks');\nconst {\n  createPerformance,\n} = require('react-native-performance/lib/commonjs/performance');\n\nmodule.exports = createPerformance(performance.now.bind(performance));\n"
  },
  {
    "path": "packages/isomorphic-performance/src/react-native.js",
    "content": "export {\n  default as performance,\n  PerformanceObserver,\n} from 'react-native-performance';\n"
  },
  {
    "path": "packages/isomorphic-performance/src/types.d.ts",
    "content": "export { PerformanceObserver };\nexport const performance: Performance;\n"
  },
  {
    "path": "packages/isomorphic-performance/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"compilerOptions\": {\n    \"target\": \"es2015\",\n    \"module\": \"es2015\",\n    \"lib\": [\"es2015\", \"dom\"]\n  }\n}\n"
  },
  {
    "path": "packages/react-native-performance/README.md",
    "content": "# React Native Performance API\n\nThis is an implementation of the [`Performance` API](https://developer.mozilla.org/en-US/docs/Web/API/Performance) for React Native based on the [User Timing Level 3](https://www.w3.org/TR/user-timing-3/) and [Performance Timeline Level 2](https://www.w3.org/TR/performance-timeline-2/) drafts.\n\n_Note_: The timestamps used are high resolution (fractions of milliseconds) and monotonically increasing, meaning that they are independent of system clock adjustments. To convert a performance timestamp to a unix epoch timestamp do like this:\n\n```js\nconst timestamp = Date.now() - performance.timeOrigin + entry.startTime;\n```\n\n## Installation\n\n**Yarn**: `yarn add --dev react-native-performance`\n\n**NPM**: `npm install --save-dev react-native-performance`\n\n### Manual integration\n\nIf your project is not set up with autolinking you need to link manually.\n\n#### iOS\n\nAdd the following to your `Podfile` and run `pod install`:\n\n```ruby\npod 'react-native-performance', :path => '../node_modules/react-native-performance/ios'\n```\n\n## Usage\n\nSee [`examples/vanilla`](https://github.com/oblador/react-native-performance/tree/master/examples/vanilla) for a demo of the different features.\n\n### Basic measure example\n\nMarking timeline events, measuring the duration between them and fetching these entries [works just like on the web](https://developer.mozilla.org/en-US/docs/Web/API/Performance):\n\n```js\nimport performance from 'react-native-performance';\n\nperformance.mark('myMark');\nperformance.measure('myMeasure', 'myMark');\nperformance.getEntriesByName('myMeasure');\n-> [{ name: \"myMeasure\", entryType: \"measure\", startTime: 98, duration: 123 }]\n```\n\n### Meta data\n\nIf you want to add some additional details to your measurements or marks, you may pass a second options object argument with a `detail` entry per the [User Timing Level 3](https://www.w3.org/TR/user-timing-3/) draft:\n\n```js\nimport performance from 'react-native-performance';\n\nperformance.mark('myMark', {\n  detail: {\n    screen: 'settings',\n    ...\n  }\n});\nperformance.measure('myMeasure', {\n  start: 'myMark',\n  detail: {\n    category: 'render',\n    ...\n  }\n});\nperformance.getEntriesByType('measure');\n-> [{ name: \"myMeasure\", entryType: \"measure\", startTime: 98, duration: 123, detail: { ... } }]\n```\n\n### Subscribing to entries\n\nThe `PerformanceObserver` API enables subscribing to different types of performance entries. The handler is called in batches.\n\nPassing `buffered: true` would include entries produced before the `observe()` call which is useful to delay handing of measurements until after performance critical startup processing.\n\n```js\nimport { PerformanceObserver } from 'react-native-performance';\nconst measureObserver = new PerformanceObserver((list, observer) => {\n  list.getEntries().forEach((entry) => {\n    console.log(`${entry.name} took ${entry.duration}ms`);\n  });\n});\nmeasureObserver.observe({ type: 'measure', buffered: true });\n```\n\n### Network resources\n\nResource logging is disabled by default and currently will only cover `fetch`/`XMLHttpRequest` uses.\n\n```js\nimport performance, {\n  setResourceLoggingEnabled,\n} from 'react-native-performance';\n\nsetResourceLoggingEnabled(true);\n\nawait fetch('https://domain.com');\nperformance.getEntriesByType('resource');\n-> [{\n  name: \"https://domain.com\",\n  entryType: \"resource\",\n  startTime: 98,\n  duration: 123,\n  initiatorType: \"xmlhttprequest\", // fetch is a polyfill on top of XHR in react-native\n  fetchStart: 98,\n  responseEnd: 221,\n  transferSize: 456,\n  ...\n}]\n```\n\n### Custom metrics\n\nIf you want to collect custom metrics not based on time, this module provides an extension of the `Performance` API called `.metric()` that produces entries with the type `metric`.\n\n```js\nimport performance from 'react-native-performance';\n\nperformance.metric('myMetric', 123);\nperformance.getEntriesByType('metric');\n-> [{ name: \"myMetric\", entryType: \"metric\", startTime: 98, duration: 0, value: 123 }]\n```\n\n### Native marks\n\nThis library exposes a set of native timeline events and metrics such as native app startup time, script execution time etc under the entryType `react-native-mark`.\n\nTo install the native iOS dependency required, simply run `pod install` in `ios/` directory and rebuild the project. For android it should be enough by just rebuilding.\n\nIf you wish to _opt out_ of autolinking of the native dependency, you may create or alter the `react-native.config.js` file to look something like this:\n\n```js\n// react-native.config.js\n\nmodule.exports = {\n  dependencies: {\n    'react-native-performance': {\n      platforms: {\n        android: null,\n        ios: null,\n      },\n    },\n  },\n};\n```\n\nNote that the native marks are not available immediately upon creation of the JS context, so it's best to set up an observer for the relevant end event before making measurements.\n\n```js\nimport performance, { PerformanceObserver } from 'react-native-performance';\n\nnew PerformanceObserver((list, observer) => {\n  if (list.getEntries().find((entry) => entry.name === 'runJsBundleEnd')) {\n    performance.measure('nativeLaunch', 'nativeLaunchStart', 'nativeLaunchEnd');\n    performance.measure('runJsBundle', 'runJsBundleStart', 'runJsBundleEnd');\n  }\n}).observe({ type: 'react-native-mark', buffered: true });\n```\n\n#### Custom marks\n\n`ephemeral` is an optional parameter to `mark/metric` functions which if set to `NO/false` will retain the entries when the React Native bridge is (re)loaded.\n\n##### iOS\n\n```objc\n#import <react-native-performance/RNPerformance.h>\n\n[RNPerformance.sharedInstance mark:@\"myCustomMark\"];\n[RNPerformance.sharedInstance mark:@\"myCustomMark\" detail:@{ @\"extra\": @\"info\" }];\n[RNPerformance.sharedInstance mark:@\"myCustomMark\" ephemeral:NO];\n\n[RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123)];\n[RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123) detail:@{ @\"unit\": @\"ms\" }];\n[RNPerformance.sharedInstance metric:@\"myCustomMetric\" value:@(123) ephemeral:NO];\n```\n\n##### Android\n\n```java\nimport com.oblador.performance.RNPerformance;\n\nRNPerformance.getInstance().mark(\"myCustomMark\");\nRNPerformance.getInstance().mark(\"myCustomMark\", false); // ephermal flag to disable resetOnReload\nBundle bundle = new Bundle();\nbundle.putString(\"extra\", \"info\");\nRNPerformance.getInstance().mark(\"myCustomMark\", bundle); // Bundle to pass some detail payload\n\nRNPerformance.getInstance().metric(\"myCustomMetric\", 123);\nRNPerformance.getInstance().metric(\"myCustomMetric\", 123, false); // ephermal flag to disable resetOnReload\nBundle bundle = new Bundle();\nbundle.putString(\"unit\", \"ms\");\nRNPerformance.getInstance().metric(\"myCustomMetric\", 123, bundle); // Bundle to pass some detail payload\n```\n\n#### Supported marks\n\n| Name                                  | Platforms | Description                                                                 |\n| ------------------------------------- | --------- | --------------------------------------------------------------------------- |\n| `nativeLaunchStart`                   | Both      | Native process initialization started                                       |\n| `nativeLaunchEnd`                     | Both      | Native process initialization ended                                         |\n| `downloadStart`                       | Both      | **Only available in development.** Development bundle download started      |\n| `downloadEnd`                         | Both      | **Only available in development.** Development bundle download ended        |\n| `runJsBundleStart`                    | Both      | **Not available with debugger.** Parse and execution of the bundle started. |\n| `runJsBundleEnd`                      | Both      | **Not available with debugger.** Parse and execution of the bundle ended    |\n| `contentAppeared`                     | Both      | Initial component mounted and presented to the user.                        |\n| `bridgeSetupStart`                    | Both      |                                                                             |\n| `bridgeSetupEnd`                      | iOS       |                                                                             |\n| `reactContextThreadStart`             | Android   |                                                                             |\n| `reactContextThreadEnd`               | Android   |                                                                             |\n| `vmInit`                              | Android   |                                                                             |\n| `createReactContextStart`             | Android   |                                                                             |\n| `processCoreReactPackageStart`        | Android   |                                                                             |\n| `processCoreReactPackageEnd`          | Android   |                                                                             |\n| `buildNativeModuleRegistryStart`      | Android   |                                                                             |\n| `buildNativeModuleRegistryEnd`        | Android   |                                                                             |\n| `createCatalystInstanceStart`         | Android   |                                                                             |\n| `createCatalystInstanceEnd`           | Android   |                                                                             |\n| `preRunJsBundleStart`                 | Android   |                                                                             |\n| `createReactContextEnd`               | Android   |                                                                             |\n| `preSetupReactContextStart`           | Android   |                                                                             |\n| `preSetupReactContextEnd`             | Android   |                                                                             |\n| `setupReactContextStart`              | Android   |                                                                             |\n| `attachMeasuredRootViewsStart`        | Android   |                                                                             |\n| `createUiManagerModuleStart`          | Android   |                                                                             |\n| `createViewManagersStart`             | Android   |                                                                             |\n| `createViewManagersEnd`               | Android   |                                                                             |\n| `createUiManagerModuleConstantsStart` | Android   |                                                                             |\n| `createUiManagerModuleConstantsEnd`   | Android   |                                                                             |\n| `createUiManagerModuleEnd`            | Android   |                                                                             |\n| `attachMeasuredRootViewsEnd`          | Android   |                                                                             |\n| `setupReactContextEnd`                | Android   |                                                                             |\n\n## License\n\nMIT © Joel Arvidsson 2021 – present\n"
  },
  {
    "path": "packages/react-native-performance/android/.gitignore",
    "content": "/build\n/.idea/\n/.gradle/\n/local.properties\n"
  },
  {
    "path": "packages/react-native-performance/android/build.gradle",
    "content": "import java.nio.file.Paths\n\nbuildscript {\n    if (project == rootProject) {\n        repositories {\n            google()\n            jcenter()\n        }\n        dependencies {\n            classpath 'com.android.tools.build:gradle:7.0.4'\n        }\n    }\n}\n\nstatic def findNodeModules(baseDir) {\n    def basePath = baseDir.toPath().normalize()\n    // Node's module resolution algorithm searches up to the root directory,\n    // after which the base path will be null\n    while (basePath) {\n        def nodeModulesPath = Paths.get(basePath.toString(), \"node_modules\")\n        def reactNativePath = Paths.get(nodeModulesPath.toString(), \"react-native\")\n        if (nodeModulesPath.toFile().exists() && reactNativePath.toFile().exists()) {\n            return nodeModulesPath.toString()\n        }\n        basePath = basePath.getParent()\n    }\n    throw new GradleException(\"Unable to locate node_modules\")\n}\n\ndef isNewArchitectureEnabled() {\n    // To opt-in for the New Architecture, you can either:\n    // - Set `newArchEnabled` to true inside the `gradle.properties` file\n    // - Invoke gradle with `-newArchEnabled=true`\n    // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`\n    return rootProject.hasProperty(\"newArchEnabled\") && rootProject.newArchEnabled == \"true\"\n}\n\nif (isNewArchitectureEnabled()) {\n    apply plugin: 'com.facebook.react'\n}\napply plugin: 'com.android.library'\n\ndef safeExtGet(prop, fallback) {\n    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback\n}\n\ndef nodeModules = findNodeModules(projectDir)\n\nandroid {\n    compileSdkVersion safeExtGet('compileSdkVersion', 31)\n    buildToolsVersion safeExtGet('buildToolsVersion', \"31.0.0\")\n\n    def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()\n    if (agpVersion >= 7) {\n      namespace 'com.oblador.performance'\n    }\n\n    defaultConfig {\n        minSdkVersion safeExtGet('minSdkVersion', 21)\n        targetSdkVersion safeExtGet('targetSdkVersion', 31)\n        buildConfigField \"boolean\", \"IS_NEW_ARCHITECTURE_ENABLED\", isNewArchitectureEnabled().toString()\n        if (isNewArchitectureEnabled()) {\n            var appProject = rootProject.allprojects.find {it.plugins.hasPlugin('com.android.application')}\n            externalNativeBuild {\n                ndkBuild {\n                    arguments \"APP_PLATFORM=android-21\",\n                            \"APP_STL=c++_shared\",\n                            \"NDK_TOOLCHAIN_VERSION=clang\",\n                            \"GENERATED_SRC_DIR=${appProject.buildDir}/generated/source\",\n                            \"PROJECT_BUILD_DIR=${appProject.buildDir}\",\n                            \"REACT_ANDROID_DIR=${nodeModules}/react-native/ReactAndroid\",\n                            \"REACT_ANDROID_BUILD_DIR=${nodeModules}/react-native/ReactAndroid/build\"\n                    cFlags \"-Wall\", \"-Werror\", \"-fexceptions\", \"-frtti\", \"-DWITH_INSPECTOR=1\"\n                    cppFlags \"-std=c++17\"\n                    targets \"rnperformance_modules\"\n                }\n            }\n        }\n    }\n\n    if (agpVersion < 8) {\n      compileOptions {\n          sourceCompatibility JavaVersion.VERSION_1_8\n          targetCompatibility JavaVersion.VERSION_1_8\n      }\n    }\n}\n\nrepositories {\n    if (project == rootProject) {\n        repositories {\n            maven {\n                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm\n                url(\"${nodeModules}/react-native/android\")\n            }\n            mavenCentral {\n                // We don't want to fetch react-native from Maven Central as there are\n                // older versions over there.\n                content {\n                    excludeGroup \"com.facebook.react\"\n                }\n            }\n            google()\n            maven { url 'https://www.jitpack.io' }\n        }\n    }\n}\n\ndependencies {\n    implementation 'com.facebook.react:react-native:+'\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "packages/react-native-performance/android/gradle.properties",
    "content": "android.useAndroidX=true\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.oblador.performance\">\n\n    <application>\n        <provider\n            android:name=\".StartTimeProvider\"\n            android:authorities=\"${applicationId}.start.time.provider\"\n            android:exported=\"false\"\n            android:initOrder=\"200\" />\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceEntry.java",
    "content": "package com.oblador.performance;\n\nimport android.os.Bundle;\n\nabstract class PerformanceEntry {\n    protected String name;\n    protected long startTime;\n    protected boolean ephemeral = true;\n    protected Bundle detail = null;\n\n    protected String getName() {\n        return name;\n    }\n\n    protected long getStartTime() {\n        return startTime;\n    }\n\n    protected boolean isEphemeral() {\n        return ephemeral;\n    }\n\n    protected Bundle getDetail() {\n        return detail;\n    }\n}\n\n\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceMark.java",
    "content": "package com.oblador.performance;\n\nimport android.os.Bundle;\n\nclass PerformanceMark extends PerformanceEntry {\n\n    protected PerformanceMark(String name, long startTime) {\n        this(name, startTime, true);\n    }\n\n    protected PerformanceMark(String name, long startTime, boolean ephemeral) {\n        this(name, startTime, ephemeral, null);\n    }\n\n    protected PerformanceMark(String name, long startTime, Bundle detail) {\n        this(name, startTime, true, detail);\n    }\n\n    protected PerformanceMark(String name, long startTime, boolean ephemeral, Bundle detail) {\n        this.name = name;\n        this.startTime = startTime;\n        this.ephemeral = ephemeral;\n        this.detail = detail;\n    }\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceMetric.java",
    "content": "package com.oblador.performance;\n\nimport android.os.Bundle;\n\nclass PerformanceMetric extends PerformanceEntry {\n\n    private final double value;\n\n    protected PerformanceMetric(String name, double value, long startTime) {\n        this(name, value, startTime, true);\n    }\n\n    protected PerformanceMetric(String name, double value, long startTime, boolean ephemeral) {\n        this(name, value, startTime, ephemeral, null);\n    }\n\n    protected PerformanceMetric(String name, double value, long startTime, Bundle detail) {\n        this(name, value, startTime, true, detail);\n    }\n\n    protected PerformanceMetric(String name, double value, long startTime, boolean ephemeral, Bundle detail) {\n        this.name = name;\n        this.value = value;\n        this.startTime = startTime;\n        this.ephemeral = ephemeral;\n        this.detail = detail;\n    }\n\n    protected double getValue() {\n        return value;\n    }\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformanceModule.java",
    "content": "package com.oblador.performance;\n\nimport android.os.SystemClock;\nimport androidx.annotation.NonNull;\n\nimport com.facebook.react.bridge.Arguments;\nimport com.facebook.react.bridge.ReactApplicationContext;\nimport com.facebook.react.bridge.ReactContextBaseJavaModule;\nimport com.facebook.react.bridge.ReactMarker;\nimport com.facebook.react.bridge.ReactMarkerConstants;\nimport com.facebook.react.bridge.WritableMap;\nimport com.facebook.react.modules.core.DeviceEventManagerModule;\nimport com.facebook.react.turbomodule.core.interfaces.TurboModule;\n\nimport java.util.Iterator;\nimport java.util.Queue;\nimport java.util.concurrent.ConcurrentLinkedQueue;\n\n// Should extend NativeRNPerformanceManagerSpec when codegen for old architecture is solved\npublic class PerformanceModule extends ReactContextBaseJavaModule implements TurboModule, RNPerformance.MarkerListener {\n    public static final String PERFORMANCE_MODULE = \"RNPerformanceManager\";\n    public static final String BRIDGE_SETUP_START = \"bridgeSetupStart\";\n\n    private static boolean eventsBuffered = true;\n    private static final Queue<PerformanceEntry> markBuffer = new ConcurrentLinkedQueue<>();\n    private static boolean didEmit = false;\n\n    private static final ReactMarker.MarkerListener startupMarkerListener = (name, tag, instanceKey) -> {\n        switch (name) {\n            case RELOAD:\n                clearMarkBuffer();\n                addMark(new PerformanceMark(BRIDGE_SETUP_START, SystemClock.uptimeMillis()));\n                break;\n            case ATTACH_MEASURED_ROOT_VIEWS_END:\n            case ATTACH_MEASURED_ROOT_VIEWS_START:\n            case BUILD_NATIVE_MODULE_REGISTRY_END:\n            case BUILD_NATIVE_MODULE_REGISTRY_START:\n            case CONTENT_APPEARED:\n            case CREATE_CATALYST_INSTANCE_END:\n            case CREATE_CATALYST_INSTANCE_START:\n            case CREATE_REACT_CONTEXT_END:\n            case CREATE_REACT_CONTEXT_START:\n            case CREATE_UI_MANAGER_MODULE_CONSTANTS_END:\n            case CREATE_UI_MANAGER_MODULE_CONSTANTS_START:\n            case CREATE_UI_MANAGER_MODULE_END:\n            case CREATE_UI_MANAGER_MODULE_START:\n            case CREATE_VIEW_MANAGERS_END:\n            case CREATE_VIEW_MANAGERS_START:\n            case DOWNLOAD_END:\n            case DOWNLOAD_START:\n            case LOAD_REACT_NATIVE_SO_FILE_END:\n            case LOAD_REACT_NATIVE_SO_FILE_START:\n            case PRE_RUN_JS_BUNDLE_START:\n            case PRE_SETUP_REACT_CONTEXT_END:\n            case PRE_SETUP_REACT_CONTEXT_START:\n            case PROCESS_CORE_REACT_PACKAGE_END:\n            case PROCESS_CORE_REACT_PACKAGE_START:\n            case REACT_CONTEXT_THREAD_END:\n            case REACT_CONTEXT_THREAD_START:\n            case RUN_JS_BUNDLE_END:\n            case RUN_JS_BUNDLE_START:\n            case SETUP_REACT_CONTEXT_END:\n            case SETUP_REACT_CONTEXT_START:\n            case VM_INIT:\n                long startTime = SystemClock.uptimeMillis();\n                addMark(new PerformanceMark(getMarkName(name), startTime));\n                break;\n        }\n    };\n\n    private final ReactMarker.MarkerListener contentAppearedListener = (name, tag, instanceKey) -> {\n        switch (name) {\n            case CONTENT_APPEARED:\n                eventsBuffered = false;\n                emitNativeStartupTime();\n                emitBufferedMarks();\n                break;\n            case RELOAD:\n                eventsBuffered = true;\n                break;\n        }\n    };\n\n    public PerformanceModule(@NonNull final ReactApplicationContext reactContext) {\n        super(reactContext);\n        setupMarkerListener();\n        setupNativeMarkerListener();\n    }\n\n    private void setupMarkerListener() {\n        ReactMarker.addListener(\n                contentAppearedListener\n        );\n    }\n\n    private void setupNativeMarkerListener() {\n        RNPerformance.getInstance().addListener(this);\n    }\n\n    // Need to set up the marker listener before the react module is initialized\n    // to capture all events\n    public static void setupListener() {\n        ReactMarker.addListener(startupMarkerListener);\n    }\n\n    private static void clearMarkBuffer() {\n        RNPerformance.getInstance().clearEphermalEntries();\n\n        Iterator<PerformanceEntry> iterator = markBuffer.iterator();\n        while (iterator.hasNext()) {\n            PerformanceEntry entry = iterator.next();\n            if (entry.isEphemeral()) {\n                iterator.remove();\n            }\n        }\n    }\n\n    private static String getMarkName(ReactMarkerConstants name) {\n        StringBuffer sb = new StringBuffer();\n        for (String s : name.toString().toLowerCase().split(\"_\")) {\n            if (sb.length() == 0) {\n                sb.append(s);\n            } else {\n                sb.append(Character.toUpperCase(s.charAt(0)));\n                if (s.length() > 1) {\n                    sb.append(s.substring(1, s.length()));\n                }\n            }\n        }\n        return sb.toString();\n    }\n\n    @Override\n    @NonNull\n    public String getName() {\n        return PERFORMANCE_MODULE;\n    }\n\n    private void emitNativeStartupTime() {\n        safelyEmitMark(new PerformanceMark(\"nativeLaunchStart\", StartTimeProvider.getStartTime()));\n        safelyEmitMark(new PerformanceMark(\"nativeLaunchEnd\", StartTimeProvider.getEndTime()));\n    }\n\n    private void safelyEmitMark(PerformanceEntry entry) {\n        if (eventsBuffered) {\n            addMark(entry);\n        } else {\n            emitMark(entry);\n        }\n    }\n\n    private static void addMark(PerformanceEntry entry) {\n        markBuffer.add(entry);\n    }\n\n    private void emitBufferedMarks() {\n        didEmit = true;\n        Iterator<PerformanceEntry> iterator = markBuffer.iterator();\n        while (iterator.hasNext()) {\n            PerformanceEntry entry = iterator.next();\n            emitMark(entry);\n        }\n        emitNativeBufferedMarks();\n    }\n\n    private void emitNativeBufferedMarks() {\n        Iterator<PerformanceEntry> iterator = RNPerformance.getInstance().getEntries().iterator();\n        while (iterator.hasNext()) {\n            PerformanceEntry entry = iterator.next();\n            emitMark(entry);\n        }\n    }\n\n    private void emitMark(PerformanceEntry entry) {\n        if (entry instanceof PerformanceMark) {\n            emit((PerformanceMark) entry);\n        } else if (entry instanceof PerformanceMetric) {\n            emit((PerformanceMetric) entry);\n        }\n    }\n\n    private void emit(PerformanceMetric metric) {\n        WritableMap params = Arguments.createMap();\n        params.putString(\"name\", metric.getName());\n        params.putDouble(\"startTime\", metric.getStartTime());\n        params.putDouble(\"value\", metric.getValue());\n        if (metric.getDetail() != null) {\n            WritableMap map = Arguments.fromBundle(metric.getDetail());\n            params.putMap(\"detail\", map);\n        }\n        if (getReactApplicationContext().hasActiveReactInstance()) {\n            getReactApplicationContext()\n                    .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n                    .emit(\"metric\", params);\n        }\n    }\n\n    private void emit(PerformanceMark mark) {\n        WritableMap params = Arguments.createMap();\n        params.putString(\"name\", mark.getName());\n        params.putDouble(\"startTime\", mark.getStartTime());\n        if (mark.getDetail() != null) {\n            WritableMap map = Arguments.fromBundle(mark.getDetail());\n            params.putMap(\"detail\", map);\n        }\n        if (getReactApplicationContext().hasActiveReactInstance()) {\n            getReactApplicationContext()\n                    .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)\n                    .emit(\"mark\", params);\n        }\n    }\n\n    @Override\n    public void logMarker(PerformanceEntry entry) {\n        if (didEmit) {\n            emitMark(entry);\n        }\n    }\n\n    @Override\n    public void invalidate() {\n        super.invalidate();\n        RNPerformance.getInstance().removeListener(this);\n        ReactMarker.removeListener(contentAppearedListener);\n    }\n\n    // Fix new arch runtime error\n    public void addListener(String eventName) {\n\n    }\n\n    public void removeListeners(double count) {\n\n    }\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/PerformancePackage.java",
    "content": "package com.oblador.performance;\n\nimport androidx.annotation.NonNull;\n\nimport com.facebook.react.ReactPackage;\nimport com.facebook.react.bridge.JavaScriptModule;\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.Collections;\nimport java.util.List;\n\n@SuppressWarnings(\"unused\")\npublic class PerformancePackage implements ReactPackage {\n\n  public PerformancePackage() {\n    PerformanceModule.setupListener();\n  }\n\n  @Override\n  @NonNull\n  public List<NativeModule> createNativeModules(@NonNull final ReactApplicationContext reactContext) {\n    List<NativeModule> modules = new ArrayList<>();\n\n    modules.add(new PerformanceModule(reactContext));\n\n    return modules;\n  }\n\n  @NonNull\n  public List<Class<? extends JavaScriptModule>> createJSModules() {\n    return Collections.emptyList();\n  }\n\n  @Override\n  @NonNull\n  public List<ViewManager> createViewManagers(@NonNull final ReactApplicationContext reactContext) {\n    return Collections.emptyList();\n  }\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/RNPerformance.java",
    "content": "package com.oblador.performance;\n\nimport android.os.Bundle;\nimport android.os.SystemClock;\n\nimport androidx.annotation.NonNull;\n\nimport com.facebook.proguard.annotations.DoNotStrip;\n\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Queue;\nimport java.util.concurrent.ConcurrentLinkedQueue;\nimport java.util.concurrent.CopyOnWriteArrayList;\n\npublic class RNPerformance {\n\n    private RNPerformance() {\n    }\n\n    private static class LoadRNPerformance {\n        static final RNPerformance instance = new RNPerformance();\n    }\n\n    @NonNull\n    public static RNPerformance getInstance() {\n        return LoadRNPerformance.instance;\n    }\n\n    interface MarkerListener {\n        void logMarker(PerformanceEntry entry);\n    }\n\n    private static final List<MarkerListener> sListeners = new CopyOnWriteArrayList<>();\n    private final Queue<PerformanceEntry> entries = new ConcurrentLinkedQueue<>();\n\n    @DoNotStrip\n    protected void addListener(MarkerListener listener) {\n        if (!sListeners.contains(listener)) {\n            sListeners.add(listener);\n        }\n    }\n\n    @DoNotStrip\n    protected void removeListener(MarkerListener listener) {\n        if (sListeners.contains(listener)) {\n            sListeners.remove(listener);\n        }\n    }\n\n    public void mark(@NonNull String markName) {\n        mark(markName, true);\n    }\n\n    public void mark(@NonNull String markName, boolean ephemeral) {\n        mark(markName, null, ephemeral);\n    }\n\n    public void mark(@NonNull String markName, Bundle detail) {\n        mark(markName, detail, true);\n    }\n\n    public void mark(@NonNull String markName, Bundle detail, boolean ephemeral) {\n        PerformanceEntry mark = new PerformanceMark(\n                markName,\n                SystemClock.uptimeMillis(),\n                ephemeral,\n                detail\n        );\n        addEntry(mark);\n    }\n\n    public void metric(@NonNull String metricName, double value) {\n        metric(metricName, value, true);\n    }\n\n    public void metric(@NonNull String metricName, double value, boolean ephemeral) {\n        metric(metricName, value, null, ephemeral);\n    }\n\n    public void metric(@NonNull String metricName, double value, Bundle detail) {\n        metric(metricName, value, detail, true);\n    }\n\n    public void metric(\n            @NonNull String metricName,\n            double value,\n            Bundle detail,\n            boolean ephemeral\n    ) {\n        PerformanceEntry mark = new PerformanceMetric(\n                metricName,\n                value,\n                SystemClock.uptimeMillis(),\n                ephemeral,\n                detail\n        );\n        addEntry(mark);\n    }\n\n    private void addEntry(@NonNull PerformanceEntry mark) {\n        entries.add(mark);\n        emitMark(mark);\n    }\n\n    private void emitMark(@NonNull PerformanceEntry entry) {\n        for (MarkerListener listener : sListeners) {\n            listener.logMarker(entry);\n        }\n    }\n\n    protected @NonNull\n    Queue<PerformanceEntry> getEntries() {\n        return entries;\n    }\n\n    protected void clearEntries() {\n        entries.clear();\n    }\n\n    protected void clearEntries(String name) {\n        Iterator<PerformanceEntry> iterator = entries.iterator();\n        while (iterator.hasNext()) {\n            PerformanceEntry entry = iterator.next();\n            if (entry.getName().equals(name)) {\n                iterator.remove();\n            }\n        }\n    }\n\n    protected void clearEphermalEntries() {\n        if (sListeners.isEmpty()) {\n            return;\n        }\n\n        Iterator<PerformanceEntry> iterator = entries.iterator();\n        while (iterator.hasNext()) {\n            PerformanceEntry entry = iterator.next();\n            if (entry.isEphemeral()) {\n                iterator.remove();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "packages/react-native-performance/android/src/main/java/com/oblador/performance/StartTimeProvider.java",
    "content": "package com.oblador.performance;\n\nimport android.content.ContentProvider;\nimport android.content.ContentValues;\nimport android.database.Cursor;\nimport android.net.Uri;\nimport android.os.Process;\nimport android.os.SystemClock;\n\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\n\npublic class StartTimeProvider extends ContentProvider {\n\n    private static long startTime = 0;\n    private static long endTime = 0;\n\n    public static long getStartTime() {\n        return startTime;\n    }\n\n    public static long getEndTime() {\n        return endTime;\n    }\n\n    private static void setStartTime() {\n        if (startTime == 0) {\n            startTime = endTime - Process.getElapsedCpuTime();\n        }\n    }\n\n    private static void setEndTime() {\n        if (endTime == 0) {\n            endTime = SystemClock.uptimeMillis();\n        }\n    }\n\n    @Override\n    public boolean onCreate() {\n        setEndTime();\n        setStartTime();\n        return false;\n    }\n\n    @Nullable\n    @Override\n    public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) {\n        return null;\n    }\n\n    @Nullable\n    @Override\n    public String getType(@NonNull Uri uri) {\n        return null;\n    }\n\n    @Nullable\n    @Override\n    public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) {\n        return null;\n    }\n\n    @Override\n    public int delete(@NonNull Uri uri, @Nullable String selection, @Nullable String[] selectionArgs) {\n        return 0;\n    }\n\n    @Override\n    public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection, @Nullable String[] selectionArgs) {\n        return 0;\n    }\n}\n"
  },
  {
    "path": "packages/react-native-performance/babel.config.js",
    "content": "module.exports = {\n  presets: ['module:@react-native/babel-preset'],\n};\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformance.h",
    "content": "#import \"RNPerformanceEntry.h\"\n\n@interface RNPerformance: NSObject\n\n+ (RNPerformance *_Nonnull)sharedInstance;\n- (void)mark:(nonnull NSString *)markName;\n- (void)mark:(nonnull NSString *)markName ephemeral:(BOOL)ephemeral;\n- (void)mark:(nonnull NSString *)markName detail:(nullable NSDictionary *)detail;\n- (void)mark:(nonnull NSString *)markName detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral;\n- (void)metric:(nonnull NSString *)metricName value:(nonnull NSNumber *)value;\n- (void)metric:(nonnull NSString *)metricName value:(nonnull NSNumber *)value ephemeral:(BOOL)ephemeral;\n- (void)metric:(nonnull NSString *)metricName value:(nonnull NSNumber *)value detail:(nullable NSDictionary *)detail;\n- (void)metric:(nonnull NSString *)metricName value:(nonnull NSNumber *)value detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral;\n- (NSArray<RNPerformanceEntry *>*_Nonnull)getEntries;\n- (void)clearEntries;\n- (void)clearEntries:(nonnull NSString *)name;\n- (void)clearEphemeralEntries;\n\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformance.mm",
    "content": "#import \"RNPerformance.h\"\n#import \"RNPerformanceEntry.h\"\n#import \"RNPerformanceUtils.h\"\n\nNSString *const RNPerformanceEntryWasAddedNotification = @\"RNPerformanceEntryWasAdded\";\n\n@implementation RNPerformance\n{\n    NSMutableArray<RNPerformanceEntry *> *_entries;\n}\n\nstatic RNPerformance *_sharedInstance = nil;\n\n+ (RNPerformance *)sharedInstance\n{\n    static dispatch_once_t onceToken;\n    dispatch_once(&onceToken, ^{\n        _sharedInstance = [[self alloc] init];\n\n    });\n\n    return _sharedInstance;\n}\n\n- (id)init\n{\n if (self = [super init]) {\n     _entries = [NSMutableArray new];\n }\n  return self;\n}\n\n- (void)mark:(nonnull NSString *)name\n{\n    [self mark:name detail:nil];\n}\n\n- (void)mark:(nonnull NSString *)name ephemeral:(BOOL)ephemeral\n{\n    [self mark:name detail:nil ephemeral:ephemeral];\n}\n\n- (void)mark:(nonnull NSString *)name detail:(nullable NSDictionary *)detail\n{\n    [self mark:name detail:detail ephemeral:YES];\n}\n\n- (void)mark:(nonnull NSString *)name detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral\n{\n    RNPerformanceMark *mark = [[RNPerformanceMark alloc] initWithName:name startTime:RNPerformanceGetTimestamp() detail:detail ephemeral:ephemeral];\n    [self addEntry:mark];\n}\n\n- (void)metric:(nonnull NSString *)name value:(nonnull NSNumber *)value\n{\n    [self metric:name value:value detail:nil];\n}\n\n- (void)metric:(nonnull NSString *)name value:(nonnull NSNumber *)value ephemeral:(BOOL)ephemeral\n{\n    [self metric:name value:value detail:nil ephemeral:ephemeral];\n}\n\n- (void)metric:(nonnull NSString *)name value:(nonnull NSNumber *)value detail:(nullable NSDictionary *)detail\n{\n    [self metric:name value:value detail:detail ephemeral:YES];\n}\n\n- (void)metric:(nonnull NSString *)name value:(nonnull NSNumber *)value detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral\n{\n    RNPerformanceMetric *metric = [[RNPerformanceMetric alloc] initWithName:name value:value startTime:RNPerformanceGetTimestamp() detail:detail ephemeral:ephemeral];\n    [self addEntry:metric];\n}\n\n- (void)addEntry:(nonnull RNPerformanceEntry *)entry\n{\n    [_entries addObject:entry];\n    NSNotification *notification = [[NSNotification alloc] initWithName:RNPerformanceEntryWasAddedNotification object:nil userInfo:@{ @\"entry\": entry }];\n    [NSNotificationCenter.defaultCenter postNotification:notification];\n}\n\n- (NSArray<RNPerformanceMark *>*)getEntries\n{\n    return [[NSArray alloc] initWithArray:_entries];\n}\n\n- (void)clearEntries\n{\n    [_entries removeAllObjects];\n}\n\n- (void)clearEntries:(nonnull NSString *)name\n{\n    [_entries enumerateObjectsUsingBlock:^(RNPerformanceEntry * _Nonnull entry, NSUInteger idx, BOOL * _Nonnull stop) {\n        if([entry.name isEqualToString:name]) {\n            [_entries removeObject:entry];\n        }\n    }];\n}\n\n- (void)clearEphemeralEntries\n{\n    [_entries enumerateObjectsUsingBlock:^(RNPerformanceEntry * _Nonnull entry, NSUInteger idx, BOOL * _Nonnull stop) {\n        if(entry.ephemeral) {\n            [_entries removeObject:entry];\n        }\n    }];\n}\n\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformanceEntry.h",
    "content": "#import <Foundation/Foundation.h>\n\ntypedef enum EntryType : NSUInteger {\n    kMark,\n    kMetric\n} EntryType;\n\n@interface RNPerformanceEntry: NSObject\n\n@property (nonatomic, copy, readonly) NSString * _Nonnull name;\n@property (nonatomic, assign, readonly) EntryType type;\n@property (nonatomic, assign, readonly) int64_t startTime;\n@property (nonatomic, assign, readonly) BOOL ephemeral;\n@property (nonatomic, copy, readonly) NSDictionary * _Nullable detail;\n\n@end\n\n@interface RNPerformanceMark: RNPerformanceEntry\n\n- (id)initWithName:(nonnull NSString *)name startTime:(int64_t)startTime detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral;\n\n@end\n\n@interface RNPerformanceMetric: RNPerformanceEntry\n\n@property (nonatomic, copy, readonly) NSNumber * _Nonnull value;\n\n- (id)initWithName:(nonnull NSString *)name value:(nonnull NSNumber *)value startTime:(int64_t)startTime detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral;\n\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformanceEntry.m",
    "content": "#import \"RNPerformanceEntry.h\"\n\n@implementation RNPerformanceEntry\n- (id)initWithName:(nonnull NSString *)name type:(EntryType)type startTime:(int64_t)startTime detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral\n{\n if (self = [super init]) {\n     _name = name;\n     _type = type;\n     _startTime = startTime;\n     _detail = detail;\n     _ephemeral = ephemeral;\n }\n  return self;\n}\n@end\n\n@implementation RNPerformanceMark\n- (id)initWithName:(nonnull NSString *)name startTime:(int64_t)startTime detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral\n{\n  self = [super initWithName:name type:kMark startTime:startTime detail:detail ephemeral:ephemeral];\n  return self;\n}\n@end\n\n@implementation RNPerformanceMetric\n- (id)initWithName:(nonnull NSString *)name value:(nonnull NSNumber *)value startTime:(int64_t)startTime detail:(nullable NSDictionary *)detail ephemeral:(BOOL)ephemeral\n{\n  if (self = [super initWithName:name type:kMetric startTime:startTime detail:detail ephemeral:ephemeral]) {\n      _value = value;\n  }\n  return self;\n}\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformanceManager.h",
    "content": "#import <Foundation/Foundation.h>\n#import <React/RCTBridgeModule.h>\n#import <React/RCTEventEmitter.h>\n\n@interface RNPerformanceManager : RCTEventEmitter <RCTBridgeModule>\n\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformanceManager.mm",
    "content": "#import \"RNPerformanceManager.h\"\n#import \"RNPerformance.h\"\n#import <sys/sysctl.h>\n#import <QuartzCore/QuartzCore.h>\n#import <React/RCTRootView.h>\n#import <React/RCTPerformanceLogger.h>\n#import <cxxreact/ReactMarker.h>\n\n#import \"RNPerformanceUtils.h\"\n\n#ifdef RCT_NEW_ARCH_ENABLED\n#import <RNPerformanceSpec/RNPerformanceSpec.h>\n#endif\n\nstatic int64_t sNativeLaunchStart;\nstatic int64_t sNativeLaunchEnd;\n\nusing namespace facebook::react;\n\n@implementation RNPerformanceManager\n{\n    bool hasListeners;\n    bool didEmit;\n    int64_t contentAppeared;\n}\n\nRCT_EXPORT_MODULE();\n\n+ (void) initialize\n{\n    [super initialize];\n    struct timespec tp;\n    clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp);\n    sNativeLaunchEnd = RNPerformanceGetTimestamp();\n    sNativeLaunchStart = sNativeLaunchEnd - (tp.tv_sec * 1e3 + tp.tv_nsec / 1e6);\n}\n\n- (instancetype)init\n{\n    if (self = [super init]) {\n        hasListeners = NO;\n        didEmit = NO;\n        contentAppeared = -1;\n    }\n    return self;\n}\n\n- (void)setBridge:(RCTBridge *)bridge\n{\n    [super setBridge:bridge];\n    [RNPerformance.sharedInstance clearEphemeralEntries];\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(contentAppeared)\n                                                 name:RCTContentDidAppearNotification\n                                               object:nil];\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(emitIfReady)\n                                                 name:RCTJavaScriptDidLoadNotification\n                                               object:nil];\n    [[NSNotificationCenter defaultCenter] addObserver:self\n                                             selector:@selector(customEntryWasAdded:)\n                                                 name:RNPerformanceEntryWasAddedNotification\n                                               object:nil];\n}\n\n- (BOOL)isReady\n{\n    return contentAppeared != -1 && !std::isnan(ReactMarker::StartupLogger::getInstance().getRunJSBundleEndTime());\n}\n\n- (void) contentAppeared\n{\n    contentAppeared = RNPerformanceGetTimestamp();\n    [self emitIfReady];\n}\n\n- (void)emitIfReady\n{\n    if (!didEmit && hasListeners && [self isReady]) {\n        [self emitEntries];\n    }\n}\n\n- (void)customEntryWasAdded:(NSNotification *)notification\n{\n    if(didEmit == YES) {\n        [self emitEntry:notification.userInfo[@\"entry\"]];\n    }\n}\n\n- (void)emitEntries\n{\n    didEmit = YES;\n    [self emitMarkNamed:@\"nativeLaunchStart\" withStartTime:sNativeLaunchStart];\n    [self emitMarkNamed:@\"nativeLaunchEnd\" withStartTime:sNativeLaunchEnd];\n    [self emitMarkNamed:@\"runJsBundleStart\" withMediaTime:ReactMarker::StartupLogger::getInstance().getRunJSBundleStartTime()];\n    [self emitMarkNamed:@\"runJsBundleEnd\" withMediaTime:ReactMarker::StartupLogger::getInstance().getRunJSBundleEndTime()];\n    [self emitMarkNamed:@\"appStartupStart\" withMediaTime:ReactMarker::StartupLogger::getInstance().getAppStartupStartTime()];\n    [self emitMarkNamed:@\"appStartupEnd\" withMediaTime:ReactMarker::StartupLogger::getInstance().getAppStartupEndTime()];\n    [self emitMarkNamed:@\"initReactRuntimeStart\" withMediaTime:ReactMarker::StartupLogger::getInstance().getInitReactRuntimeStartTime()];\n    [self emitMarkNamed:@\"initReactRuntimeEnd\" withMediaTime:ReactMarker::StartupLogger::getInstance().getInitReactRuntimeEndTime()];\n    [self emitMarkNamed:@\"contentAppeared\" withStartTime:contentAppeared];\n    [self emitMetricNamed:@\"bundleSize\" withValue:@([self.bridge.performanceLogger valueForTag:RCTPLBundleSize]) withStartTime:RNPerformanceGetTimestamp() withDetail:@{ @\"unit\": @\"byte\" }];\n    [[RNPerformance.sharedInstance getEntries]\n     enumerateObjectsUsingBlock:^(RNPerformanceEntry * _Nonnull entry, NSUInteger idx, BOOL * _Nonnull stop) {\n        [self emitEntry:entry];\n    }];\n}\n\n- (void)emitEntry:(nonnull RNPerformanceEntry *)entry\n{\n    switch (entry.type) {\n        case kMark:\n            [self emitMarkNamed:entry.name withStartTime:entry.startTime withDetail:entry.detail];\n            break;\n            \n        case kMetric:\n            RNPerformanceMetric *metric = (RNPerformanceMetric *)entry;\n            [self emitMetricNamed:metric.name withValue:metric.value withStartTime:metric.startTime withDetail:metric.detail];\n            break;\n    }\n}\n\n- (NSArray<NSString *> *)supportedEvents\n{\n    return @[ @\"mark\", @\"metric\" ];\n}\n\n- (void)invalidate\n{\n    [super invalidate];\n    [NSNotificationCenter.defaultCenter removeObserver:self];\n}\n\n- (void)startObserving\n{\n    hasListeners = YES;\n    if (didEmit != YES && [self isReady]) {\n        [self emitEntries];\n    }\n}\n\n-(void)stopObserving\n{\n    hasListeners = NO;\n}\n\n- (void)emitMarkNamed:(NSString *)name withMediaTime:(int64_t)mediaTime\n{\n    if (mediaTime == 0) {\n        NSLog(@\"Ignoring mark named %@ as timestamp is not set\", name);\n        return;\n    }\n    [self emitMarkNamed:name withStartTime:mediaTime + RNPerformanceGetTimestamp() - (CACurrentMediaTime() * 1000)];\n}\n\n- (void)emitMarkNamed:(NSString *)name withStartTime:(int64_t)startTime\n{\n    [self emitMarkNamed:name withStartTime:startTime withDetail:nil];\n}\n\n- (void)emitMarkNamed:(NSString *)name withStartTime:(int64_t)startTime withDetail:(NSDictionary *)detail\n{\n    if (hasListeners) {\n        [self sendEventWithName:@\"mark\" body:@{\n            @\"name\": name,\n            @\"startTime\": @(startTime),\n            @\"detail\": detail == nil ? [NSNull null] : detail\n        }];\n    }\n}\n\n- (void)emitMetricNamed:(NSString *)name withValue:(NSNumber *)value withStartTime:(int64_t)startTime withDetail:(NSDictionary *)detail\n{\n    if (hasListeners) {\n        [self sendEventWithName:@\"metric\" body:@{\n            @\"name\": name,\n            @\"startTime\": @(startTime),\n            @\"value\": value,\n            @\"detail\": detail == nil ? [NSNull null] : detail\n        }];\n    }\n}\n\n#ifdef RCT_NEW_ARCH_ENABLED\n- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params\n{\n    return std::make_shared<facebook::react::NativeRNPerformanceManagerSpecJSI>(params);\n}\n#endif\n\n@end\n"
  },
  {
    "path": "packages/react-native-performance/ios/RNPerformanceUtils.h",
    "content": "#ifndef RNPerformanceUtils_h\n#define RNPerformanceUtils_h\n\n#import <React/RCTDefines.h>\n\nRCT_EXTERN NSString * _Nonnull const RNPerformanceEntryWasAddedNotification;\n\n#include <chrono>\n\nstatic int64_t RNPerformanceGetTimestamp()\n{\n    // Copied from https://github.com/facebook/react-native/blob/main/React/CxxBridge/RCTJSIExecutorRuntimeInstaller.mm#L25\n    auto time = std::chrono::steady_clock::now();\n    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(\n                        time.time_since_epoch())\n                        .count();\n\n    constexpr double NANOSECONDS_IN_MILLISECOND = 1000000.0;\n\n    return duration / NANOSECONDS_IN_MILLISECOND;\n}\n\n#endif /* RNPerformanceUtils_h */\n"
  },
  {
    "path": "packages/react-native-performance/jest.config.js",
    "content": "module.exports = {\n  setupFilesAfterEnv: ['./test/setup.js'],\n  preset: 'react-native',\n};\n"
  },
  {
    "path": "packages/react-native-performance/package.json",
    "content": "{\n  \"name\": \"react-native-performance\",\n  \"version\": \"6.0.0\",\n  \"description\": \"Measure React Native performance\",\n  \"homepage\": \"https://github.com/oblador/react-native-performance\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/oblador/react-native-performance.git\",\n    \"directory\": \"packages/react-native-performance\"\n  },\n  \"main\": \"lib/commonjs/index.js\",\n  \"types\": \"lib/typescript/index.d.ts\",\n  \"react-native\": \"src/index.ts\",\n  \"source\": \"src/index\",\n  \"files\": [\n    \"src\",\n    \"lib\",\n    \"!**/__tests__\",\n    \"!**/__fixtures__\",\n    \"!**/__mocks__\",\n    \"android\",\n    \"ios\",\n    \"react-native-performance.*\",\n    \"!.DS_Store\",\n    \"!android/build\",\n    \"!ios/build\"\n  ],\n  \"scripts\": {\n    \"test\": \"jest\",\n    \"prepare\": \"bob build\"\n  },\n  \"keywords\": [\n    \"react-native\",\n    \"performance\",\n    \"perf\",\n    \"benchmark\"\n  ],\n  \"author\": \"Joel Arvidsson\",\n  \"license\": \"MIT\",\n  \"peerDependencies\": {\n    \"react-native\": \"*\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.25.2\",\n    \"@babel/preset-env\": \"^7.25.3\",\n    \"@babel/runtime\": \"^7.25.0\",\n    \"@react-native/babel-preset\": \"0.78.2\",\n    \"@types/jest\": \"^29.5.13\",\n    \"babel-jest\": \"^29.6.3\",\n    \"jest\": \"^29.6.3\",\n    \"react-native-builder-bob\": \"^0.21.2\",\n    \"typescript\": \"5.0.4\"\n  },\n  \"codegenConfig\": {\n    \"name\": \"RNPerformanceSpec\",\n    \"type\": \"modules\",\n    \"jsSrcsDir\": \"./src\",\n    \"android\": {\n      \"javaPackageName\": \"com.oblador.performance\"\n    }\n  },\n  \"react-native-builder-bob\": {\n    \"source\": \"src\",\n    \"output\": \"lib\",\n    \"targets\": [\n      \"commonjs\",\n      [\n        \"typescript\",\n        {\n          \"project\": \"tsconfig.build.json\"\n        }\n      ]\n    ]\n  }\n}\n"
  },
  {
    "path": "packages/react-native-performance/react-native-performance.podspec",
    "content": "require 'json'\n\npackage = JSON.parse(File.read(File.join(__dir__, './package.json')))\n\nfolly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'\n\nPod::Spec.new do |s|\n  s.name         = package['name']\n  s.version      = package['version']\n  s.summary      = package['description']\n  s.author       = package['author']\n  s.homepage     = package['homepage']\n  s.license      = package['license']\n  s.source       = { :git => 'https://github.com/oblador/react-native-performance.git', :tag => \"v#{s.version}\" }\n\n  s.platform     = :ios, \"11.0\"\n  s.source_files = \"ios/**/*.{h,m,mm}\"\n\n  s.dependency 'React-Core'\n\n  # This guard prevent to install the dependencies when we run `pod install` in the old architecture.\n  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then\n      s.compiler_flags = folly_compiler_flags + \" -DRCT_NEW_ARCH_ENABLED=1\"\n      s.pod_target_xcconfig    = {\n          \"HEADER_SEARCH_PATHS\" => \"\\\"$(PODS_ROOT)/boost\\\"\",\n          \"CLANG_CXX_LANGUAGE_STANDARD\" => \"c++17\"\n      }\n\n      install_modules_dependencies(s)\n  end\nend\n"
  },
  {
    "path": "packages/react-native-performance/react-native-performance.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\t93CE2D3B25AF808F00589E8F /* RNPerformanceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE2D3925AF808F00589E8F /* RNPerformanceManager.h */; };\n\t\t93CE2D3C25AF808F00589E8F /* RNPerformanceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CE2D3925AF808F00589E8F /* RNPerformanceManager.h */; };\n\t\t93CE2D3D25AF808F00589E8F /* RNPerformanceManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CE2D3A25AF808F00589E8F /* RNPerformanceManager.m */; };\n\t\t93CE2D3E25AF808F00589E8F /* RNPerformanceManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CE2D3A25AF808F00589E8F /* RNPerformanceManager.m */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t5D82366D1B0CE05B005A9EF3 /* Copy Headers */ = {\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\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t6478985D1F38BF9100DA1C12 /* Copy Headers */ = {\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\tname = \"Copy Headers\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t93CE2D3925AF808F00589E8F /* RNPerformanceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNPerformanceManager.h; sourceTree = \"<group>\"; };\n\t\t93CE2D3A25AF808F00589E8F /* RNPerformanceManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNPerformanceManager.m; sourceTree = \"<group>\"; };\n\t\t93CE2D7425AF810600589E8F /* libreact-native-performance.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libreact-native-performance.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t93CE2D7C25AF815700589E8F /* lib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = lib.a; path = \"/Users/joel.arvidsson/Code/flipper-plugin-react-native-performance/packages/react-native-performance/ios/build/Debug-appletvos/lib.a\"; sourceTree = \"<absolute>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t5D82366C1B0CE05B005A9EF3 /* 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\t6478985C1F38BF9100DA1C12 /* 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\t5D8236661B0CE05B005A9EF3 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t93B250D4256EA09C007CC95B /* RNPerformanceManager */,\n\t\t\t\t93CE2D7425AF810600589E8F /* libreact-native-performance.a */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t\twrapsLines = 0;\n\t\t};\n\t\t93B250D4256EA09C007CC95B /* RNPerformanceManager */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t93CE2D3925AF808F00589E8F /* RNPerformanceManager.h */,\n\t\t\t\t93CE2D3A25AF808F00589E8F /* RNPerformanceManager.m */,\n\t\t\t);\n\t\t\tname = RNPerformanceManager;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t5DE632D820434281004F9598 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t93CE2D3B25AF808F00589E8F /* RNPerformanceManager.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t5DE632DD204342BC004F9598 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t93CE2D3C25AF808F00589E8F /* RNPerformanceManager.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\t5D82366E1B0CE05B005A9EF3 /* react-native-performance */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 5D8236831B0CE05B005A9EF3 /* Build configuration list for PBXNativeTarget \"react-native-performance\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t5D82366B1B0CE05B005A9EF3 /* Sources */,\n\t\t\t\t5D82366C1B0CE05B005A9EF3 /* Frameworks */,\n\t\t\t\t5DE632D820434281004F9598 /* Headers */,\n\t\t\t\t5D82366D1B0CE05B005A9EF3 /* Copy Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"react-native-performance\";\n\t\t\tproductName = RNKeychain;\n\t\t\tproductReference = 93CE2D7425AF810600589E8F /* libreact-native-performance.a */;\n\t\t\tproductType = \"com.apple.product-type.library.static\";\n\t\t};\n\t\t6478985E1F38BF9100DA1C12 /* react-native-performance-tvOS */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 647898671F38BF9100DA1C12 /* Build configuration list for PBXNativeTarget \"react-native-performance-tvOS\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t6478985B1F38BF9100DA1C12 /* Sources */,\n\t\t\t\t6478985C1F38BF9100DA1C12 /* Frameworks */,\n\t\t\t\t5DE632DD204342BC004F9598 /* Headers */,\n\t\t\t\t6478985D1F38BF9100DA1C12 /* Copy Headers */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = \"react-native-performance-tvOS\";\n\t\t\tproductName = \"RNKeychain-tvOS\";\n\t\t\tproductReference = 93CE2D7C25AF815700589E8F /* lib.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\t5D8236671B0CE05B005A9EF3 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 0630;\n\t\t\t\tORGANIZATIONNAME = \"Joel Arvidsson\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t5D82366E1B0CE05B005A9EF3 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 6.3.1;\n\t\t\t\t\t};\n\t\t\t\t\t6478985E1F38BF9100DA1C12 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.3.3;\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 = 5D82366A1B0CE05B005A9EF3 /* Build configuration list for PBXProject \"react-native-performance\" */;\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\tEnglish,\n\t\t\t\ten,\n\t\t\t);\n\t\t\tmainGroup = 5D8236661B0CE05B005A9EF3;\n\t\t\tproductRefGroup = 5D8236661B0CE05B005A9EF3;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t5D82366E1B0CE05B005A9EF3 /* react-native-performance */,\n\t\t\t\t6478985E1F38BF9100DA1C12 /* react-native-performance-tvOS */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t5D82366B1B0CE05B005A9EF3 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t93CE2D3D25AF808F00589E8F /* RNPerformanceManager.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t6478985B1F38BF9100DA1C12 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t93CE2D3E25AF808F00589E8F /* RNPerformanceManager.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\t5D8236811B0CE05B005A9EF3 /* 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\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_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 = 9.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\t5D8236821B0CE05B005A9EF3 /* 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\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 = 9.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\t5D8236841B0CE05B005A9EF3 /* 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\t\"$(SRCROOT)/node_modules/react-native/React/**\",\n\t\t\t\t);\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\t5D8236851B0CE05B005A9EF3 /* 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\t\"$(SRCROOT)/node_modules/react-native/React/**\",\n\t\t\t\t);\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\t647898651F38BF9100DA1C12 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\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\tOTHER_LDFLAGS = \"-ObjC\";\n\t\t\t\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.2;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t647898661F38BF9100DA1C12 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\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\tSDKROOT = appletvos;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 10.2;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t5D82366A1B0CE05B005A9EF3 /* Build configuration list for PBXProject \"react-native-performance\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5D8236811B0CE05B005A9EF3 /* Debug */,\n\t\t\t\t5D8236821B0CE05B005A9EF3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t5D8236831B0CE05B005A9EF3 /* Build configuration list for PBXNativeTarget \"react-native-performance\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5D8236841B0CE05B005A9EF3 /* Debug */,\n\t\t\t\t5D8236851B0CE05B005A9EF3 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t647898671F38BF9100DA1C12 /* Build configuration list for PBXNativeTarget \"react-native-performance-tvOS\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t647898651F38BF9100DA1C12 /* Debug */,\n\t\t\t\t647898661F38BF9100DA1C12 /* 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 = 5D8236671B0CE05B005A9EF3 /* Project object */;\n}\n"
  },
  {
    "path": "packages/react-native-performance/react-native-performance.xcodeproj/xcshareddata/xcschemes/react-native-performance-tvOS.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1230\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\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 = \"6478985E1F38BF9100DA1C12\"\n               BuildableName = \"lib.a\"\n               BlueprintName = \"react-native-performance-tvOS\"\n               ReferencedContainer = \"container:react-native-performance.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      </Testables>\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   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"6478985E1F38BF9100DA1C12\"\n            BuildableName = \"lib.a\"\n            BlueprintName = \"react-native-performance-tvOS\"\n            ReferencedContainer = \"container:react-native-performance.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "packages/react-native-performance/react-native-performance.xcodeproj/xcshareddata/xcschemes/react-native-performance.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1230\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\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 = \"5D82366E1B0CE05B005A9EF3\"\n               BuildableName = \"libreact-native-performance.a\"\n               BlueprintName = \"react-native-performance\"\n               ReferencedContainer = \"container:react-native-performance.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      </Testables>\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   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"5D82366E1B0CE05B005A9EF3\"\n            BuildableName = \"libreact-native-performance.a\"\n            BlueprintName = \"react-native-performance\"\n            ReferencedContainer = \"container:react-native-performance.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "packages/react-native-performance/src/NativeRNPerformanceManager.ts",
    "content": "import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';\nimport { TurboModuleRegistry } from 'react-native';\n\nexport interface Spec extends TurboModule {\n  // Events\n  addListener: (eventName: string) => void;\n  removeListeners: (count: number) => void;\n}\n\nexport default TurboModuleRegistry.get<Spec>('RNPerformanceManager');\n"
  },
  {
    "path": "packages/react-native-performance/src/event-emitter.ts",
    "content": "type Callback<T> = (entry: T) => void;\n\nexport const createEventEmitter = <T>() => {\n  const callbacks = new Set<Callback<T>>();\n\n  const addEventListener = (callback: Callback<T>) => {\n    callbacks.add(callback);\n  };\n\n  const removeEventListener = (callback: Callback<T>) => {\n    callbacks.delete(callback);\n  };\n\n  const emit = (event: T) => {\n    callbacks.forEach((callback) => {\n      callback(event);\n    });\n  };\n\n  return {\n    addEventListener,\n    removeEventListener,\n    emit,\n  };\n};\n"
  },
  {
    "path": "packages/react-native-performance/src/index.ts",
    "content": "import { NativeEventEmitter, NativeModules, Platform } from 'react-native';\nimport {\n  PerformanceReactNativeMark,\n  PerformanceMetric,\n} from './performance-entry';\nimport {\n  installResourceLogger,\n  uninstallResourceLogger,\n} from './resource-logger';\nimport { PerformanceObserver, addEntry, performance } from './instance';\n\ndeclare const global: {\n  __turboModuleProxy: null | {};\n  RN$Bridgeless?: boolean;\n};\n\nconst isTurboModuleEnabled =\n  global.RN$Bridgeless || global.__turboModuleProxy != null;\n\nconst RNPerformanceManager = isTurboModuleEnabled\n  ? require('./NativeRNPerformanceManager').default\n  : NativeModules.RNPerformanceManager;\n\nif (Platform.OS === 'android' || RNPerformanceManager) {\n  const emitter = new NativeEventEmitter(RNPerformanceManager);\n\n  emitter.addListener('mark', (data) => {\n    addEntry(\n      new PerformanceReactNativeMark(data.name, data.startTime, data.detail)\n    );\n  });\n\n  emitter.addListener('metric', (data) => {\n    addEntry(\n      new PerformanceMetric(data.name, {\n        startTime: data.startTime,\n        value: data.value,\n        detail: data.detail,\n      })\n    );\n  });\n}\n\nexport default performance;\nexport type Performance = typeof performance;\n\nexport const setResourceLoggingEnabled = (enabled = true) => {\n  if (enabled) {\n    //@ts-ignore\n    installResourceLogger(globalThis, performance, addEntry);\n  } else {\n    uninstallResourceLogger(globalThis);\n  }\n};\n\nexport { PerformanceObserver };\nexport type {\n  EntryType,\n  PerformanceMark,\n  PerformanceMeasure,\n  PerformanceMetric,\n  PerformanceEntry,\n  PerformanceReactNativeMark,\n  PerformanceResourceTiming,\n} from './performance-entry';\n"
  },
  {
    "path": "packages/react-native-performance/src/instance.ts",
    "content": "import { createPerformance } from './performance';\nexport const { PerformanceObserver, addEntry, performance } =\n  createPerformance();\n"
  },
  {
    "path": "packages/react-native-performance/src/performance-entry.ts",
    "content": "type MarkOptions = {\n  startTime?: number;\n  detail?: any;\n};\n\ntype MetricOptions = {\n  startTime: number;\n  value: string | number;\n  detail?: any;\n};\n\ntype MeasureOptions = {\n  startTime?: number;\n  detail?: any;\n  duration?: number;\n};\n\nexport type EntryType =\n  | 'mark'\n  | 'measure'\n  | 'resource'\n  | 'metric'\n  | 'react-native-mark';\n\nexport class PerformanceEntry {\n  name: string;\n  entryType: EntryType;\n  startTime: number;\n  duration: number;\n\n  constructor(\n    name: string,\n    entryType: EntryType,\n    startTime: number,\n    duration: number\n  ) {\n    this.name = name;\n    this.entryType = entryType;\n    this.startTime = startTime;\n    this.duration = duration;\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n    };\n  }\n}\n\nexport class PerformanceMark extends PerformanceEntry {\n  detail?: any;\n\n  constructor(markName: string, markOptions: MarkOptions = {}) {\n    super(markName, 'mark', markOptions.startTime, 0);\n    this.detail = markOptions.detail;\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n      detail: this.detail,\n    };\n  }\n}\n\nexport class PerformanceReactNativeMark extends PerformanceEntry {\n  detail?: any;\n\n  constructor(name: string, startTime: number, detail: any) {\n    super(name, 'react-native-mark', startTime, 0);\n    this.detail = detail;\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n      detail: this.detail,\n    };\n  }\n}\n\nexport class PerformanceMetric extends PerformanceEntry {\n  value: string | number;\n  detail?: any;\n\n  constructor(name: string, metricOptions: MetricOptions) {\n    super(name, 'metric', metricOptions.startTime, 0);\n    this.value = metricOptions.value;\n    this.detail = metricOptions.detail;\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n      detail: this.detail,\n      value: this.value,\n    };\n  }\n}\n\nexport class PerformanceMeasure extends PerformanceEntry {\n  detail?: any;\n\n  constructor(measureName: string, measureOptions: MeasureOptions = {}) {\n    super(\n      measureName,\n      'measure',\n      measureOptions.startTime,\n      measureOptions.duration\n    );\n    this.detail = measureOptions.detail;\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n      detail: this.detail,\n    };\n  }\n}\n\nexport class PerformanceResourceTiming extends PerformanceEntry {\n  initiatorType?: string;\n  responseEnd: number;\n  fetchStart: number;\n  transferSize: number;\n  connectEnd: number;\n  connectStart: number;\n  decodedBodySize: number;\n  domainLookupEnd: number;\n  domainLookupStart: number;\n  encodedBodySize: number;\n  redirectEnd: number;\n  redirectStart: number;\n  requestStart: number;\n  responseStart: number;\n  secureConnectionStart?: number;\n  serverTiming: number[];\n  workerStart: number;\n  workerTiming: number[];\n\n  constructor({\n    name,\n    startTime,\n    duration,\n    initiatorType,\n    responseEnd,\n    transferSize,\n  }: {\n    name?: string;\n    startTime?: number;\n    duration?: number;\n    initiatorType?: string;\n    responseEnd?: number;\n    transferSize?: number;\n  } = {}) {\n    super(name, 'resource', startTime, duration);\n    this.initiatorType = initiatorType;\n    this.fetchStart = startTime;\n    this.responseEnd = responseEnd;\n    this.transferSize = transferSize;\n    this.connectEnd = 0;\n    this.connectStart = 0;\n    this.decodedBodySize = 0;\n    this.domainLookupEnd = 0;\n    this.domainLookupStart = 0;\n    this.encodedBodySize = 0;\n    this.redirectEnd = 0;\n    this.redirectStart = 0;\n    this.requestStart = 0;\n    this.responseStart = 0;\n    this.secureConnectionStart = 0;\n    this.serverTiming = [];\n    this.transferSize = 0;\n    this.workerStart = 0;\n    this.workerTiming = [];\n  }\n\n  toJSON() {\n    return {\n      name: this.name,\n      entryType: this.entryType,\n      startTime: this.startTime,\n      duration: this.duration,\n      initiatorType: this.initiatorType,\n      fetchStart: this.fetchStart,\n      responseEnd: this.responseEnd,\n      transferSize: this.transferSize,\n      connectEnd: this.connectEnd,\n      connectStart: this.connectStart,\n      decodedBodySize: this.decodedBodySize,\n      domainLookupEnd: this.domainLookupEnd,\n      domainLookupStart: this.domainLookupStart,\n      encodedBodySize: this.encodedBodySize,\n      redirectEnd: this.redirectEnd,\n      redirectStart: this.redirectStart,\n      requestStart: this.requestStart,\n      responseStart: this.responseStart,\n      secureConnectionStart: this.secureConnectionStart,\n      serverTiming: this.serverTiming,\n      workerStart: this.workerStart,\n      workerTiming: this.workerTiming,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/react-native-performance/src/performance-observer.ts",
    "content": "import type { EntryType, PerformanceEntry } from './performance-entry';\n\ntype ObserveOptionType1 = {\n  entryTypes: EntryType[];\n};\n\ntype ObserveOptionType2 = {\n  type: EntryType;\n  buffered?: boolean;\n};\n\nexport class PerformanceObserverEntryList {\n  entries: PerformanceEntry[];\n\n  constructor(entries: PerformanceEntry[]) {\n    this.entries = entries;\n  }\n\n  getEntries() {\n    return this.entries.slice(0);\n  }\n\n  getEntriesByType(type: EntryType) {\n    return this.entries.filter((entry) => entry.entryType === type);\n  }\n\n  getEntriesByName(name: string, type?: EntryType) {\n    return this.entries.filter(\n      (entry) => entry.name === name && (!type || entry.entryType === type)\n    );\n  }\n}\n\nconst SUPPORTED_ENTRY_TYPES = [\n  'mark',\n  'measure',\n  'metric',\n  'react-native-mark',\n  'resource',\n];\n\nconst sortByStartTime = (a, b) => a.startTime - b.startTime;\n\nconst OBSERVER_TYPE_SINGLE = 'single';\nconst OBSERVER_TYPE_MULTIPLE = 'multiple';\n\nexport const createPerformanceObserver = ({\n  addEventListener,\n  removeEventListener,\n  getEntriesByType,\n}) =>\n  class PerformanceObserver {\n    callback: (\n      list: PerformanceObserverEntryList,\n      observer: PerformanceObserver\n    ) => void;\n    buffer: PerformanceEntry[];\n    entryTypes: Set<EntryType>;\n    timer?: number;\n    observerType:\n      | null\n      | typeof OBSERVER_TYPE_SINGLE\n      | typeof OBSERVER_TYPE_MULTIPLE;\n\n    static supportedEntryTypes = SUPPORTED_ENTRY_TYPES;\n\n    constructor(\n      callback: (\n        list: PerformanceObserverEntryList,\n        observer: PerformanceObserver\n      ) => void\n    ) {\n      this.callback = callback;\n      this.buffer = [];\n      this.timer = null;\n      this.entryTypes = new Set();\n      this.observerType = null;\n    }\n\n    emitRecords = () => {\n      this.callback(new PerformanceObserverEntryList(this.takeRecords()), this);\n    };\n\n    scheduleEmission() {\n      if (this.timer === null) {\n        this.timer = requestAnimationFrame(() => {\n          this.timer = null;\n          this.emitRecords();\n        });\n      }\n    }\n\n    receiveRecord = (entry: PerformanceEntry) => {\n      if (this.entryTypes.has(entry.entryType)) {\n        this.buffer.push(entry);\n        this.scheduleEmission();\n      }\n    };\n\n    observe(options: ObserveOptionType1): void;\n    observe(options: ObserveOptionType2): void;\n\n    observe(options: any) {\n      if (!options || (!options.entryTypes && !options.type)) {\n        throw new TypeError(\n          \"Failed to execute 'observe' on 'PerformanceObserver': An observe() call must include either entryTypes or type arguments.\"\n        );\n      }\n      if (options.entryTypes && options.type) {\n        throw new TypeError(\n          \"Failed to execute 'observe' on 'PerformanceObserver': An observe() call must not include both entryTypes and type arguments.\"\n        );\n      }\n\n      if (options.entryTypes) {\n        if (this.observerType === OBSERVER_TYPE_SINGLE) {\n          throw new Error(\n            'This PerformanceObserver has performed observe({type:...}, therefore it cannot perform observe({entryTypes:...})'\n          );\n        }\n        if (!Array.isArray(options.entryTypes)) {\n          throw new TypeError('entryTypes argument must be an array');\n        }\n        this.observerType = OBSERVER_TYPE_MULTIPLE;\n        this.entryTypes = new Set(options.entryTypes);\n        this.buffer = [];\n        if (options.buffered) {\n          console.warn(\n            'The PerformanceObserver does not support buffered flag with the entryTypes argument.'\n          );\n        }\n      } else {\n        if (this.observerType === OBSERVER_TYPE_MULTIPLE) {\n          throw new Error(\n            'This PerformanceObserver has performed observe({entryTypes:...}, therefore it cannot perform observe({type:...})'\n          );\n        }\n        this.observerType = OBSERVER_TYPE_SINGLE;\n        this.entryTypes.add(options.type);\n        if (options.buffered) {\n          this.buffer = getEntriesByType(options.type);\n          this.scheduleEmission();\n        }\n      }\n\n      this.entryTypes.forEach((entryType) => {\n        if (!SUPPORTED_ENTRY_TYPES.includes(entryType)) {\n          console.warn(\n            `The entry type '${entryType}' does not exist or isn't supported.`\n          );\n        }\n      });\n\n      addEventListener(this.receiveRecord);\n    }\n\n    disconnect() {\n      removeEventListener(this.receiveRecord);\n      this.entryTypes = new Set();\n      this.observerType = null;\n      this.buffer = [];\n      if (this.timer !== null) {\n        cancelAnimationFrame(this.timer);\n        this.timer = null;\n      }\n    }\n\n    takeRecords() {\n      const entries = this.buffer.sort(sortByStartTime);\n      this.buffer = [];\n      return entries;\n    }\n  };\n"
  },
  {
    "path": "packages/react-native-performance/src/performance.ts",
    "content": "import { createEventEmitter } from './event-emitter';\nimport { createPerformanceObserver } from './performance-observer';\nimport {\n  EntryType,\n  PerformanceMark,\n  PerformanceMeasure,\n  PerformanceMetric,\n  PerformanceEntry,\n  PerformanceReactNativeMark,\n  PerformanceResourceTiming,\n} from './performance-entry';\n\n// @ts-ignore\nexport const defaultNow: () => number = global.performance.now.bind(\n  // @ts-ignore\n  global.performance\n);\n\nexport type MarkOptions = {\n  startTime?: number;\n  detail?: any;\n};\n\nexport type MeasureOptions = {\n  start?: string | number;\n  end?: string | number;\n  duration?: number;\n  detail?: any;\n};\n\nexport type StartOrMeasureOptions = string | MeasureOptions | undefined;\n\nexport type MetricOptions = {\n  startTime: number;\n  detail: any;\n  value: number | string;\n};\n\nexport type ValueOrOptions = number | string | MetricOptions;\n\nexport const createPerformance = (now: () => number = defaultNow) => {\n  const timeOrigin = now();\n  const { addEventListener, removeEventListener, emit } =\n    createEventEmitter<PerformanceEntry>();\n  const marks = new Map<string, number>();\n  let entries: PerformanceEntry[] = [];\n\n  function addEntry<T extends PerformanceEntry>(entry: T): T {\n    entries.push(entry);\n    if (entry.entryType === 'mark' || entry.entryType === 'react-native-mark') {\n      marks.set(entry.name, entry.startTime);\n    }\n    emit(entry);\n    return entry;\n  }\n\n  const removeEntries = (type: EntryType, name?: string) => {\n    entries = entries.filter((entry) => {\n      if (entry.entryType === type && (!name || entry.name === name)) {\n        marks.delete(entry.name);\n        return false;\n      }\n      return true;\n    });\n  };\n\n  const mark = (markName: string, markOptions: MarkOptions = {}) =>\n    addEntry(\n      new PerformanceMark(markName, {\n        startTime:\n          'startTime' in markOptions && markOptions.startTime !== undefined\n            ? markOptions.startTime\n            : now(),\n        detail: markOptions.detail,\n      })\n    );\n\n  const clearMarks = (name?: string) => removeEntries('mark', name);\n\n  const clearMeasures = (name?: string) => removeEntries('measure', name);\n\n  const clearMetrics = (name?: string) => removeEntries('metric', name);\n\n  const clearResourceTimings = (name?: string) =>\n    removeEntries('resource', name);\n\n  const convertMarkToTimestamp = (markOrTimestamp: string | number) => {\n    switch (typeof markOrTimestamp) {\n      case 'string': {\n        if (!marks.has(markOrTimestamp)) {\n          throw new Error(\n            `Failed to execute 'measure' on 'Performance': The mark '${markOrTimestamp}' does not exist.`\n          );\n        }\n        return marks.get(markOrTimestamp);\n      }\n      case 'number': {\n        return markOrTimestamp;\n      }\n      default:\n        throw new TypeError(\n          `Failed to execute 'measure' on 'Performance': Expected mark name or timestamp, got '${markOrTimestamp}'.`\n        );\n    }\n  };\n\n  const measure = (\n    measureName: string,\n    startOrMeasureOptions?: StartOrMeasureOptions,\n    endMark?: string | number\n  ) => {\n    let start = 0;\n    let end = 0;\n    let detail: any;\n\n    if (\n      startOrMeasureOptions &&\n      typeof startOrMeasureOptions === 'object' &&\n      startOrMeasureOptions.constructor == Object\n    ) {\n      if (endMark) {\n        throw new TypeError(\n          `Failed to execute 'measure' on 'Performance': The measureOptions and endMark arguments may not be combined.`\n        );\n      }\n      if (!startOrMeasureOptions.start && !startOrMeasureOptions.end) {\n        throw new TypeError(\n          `Failed to execute 'measure' on 'Performance': At least one of the start and end option must be passed.`\n        );\n      }\n      if (\n        startOrMeasureOptions.start &&\n        startOrMeasureOptions.end &&\n        startOrMeasureOptions.duration\n      ) {\n        throw new TypeError(\n          `Failed to execute 'measure' on 'Performance': Cannot send start, end and duration options together.`\n        );\n      }\n\n      detail = startOrMeasureOptions.detail;\n\n      if (startOrMeasureOptions && startOrMeasureOptions.end) {\n        end = convertMarkToTimestamp(startOrMeasureOptions.end);\n      } else if (\n        startOrMeasureOptions &&\n        startOrMeasureOptions.start &&\n        startOrMeasureOptions.duration\n      ) {\n        end =\n          convertMarkToTimestamp(startOrMeasureOptions.start) +\n          convertMarkToTimestamp(startOrMeasureOptions.duration);\n      } else {\n        end = now();\n      }\n\n      if (startOrMeasureOptions && startOrMeasureOptions.start) {\n        start = convertMarkToTimestamp(startOrMeasureOptions.start);\n      } else if (\n        startOrMeasureOptions &&\n        startOrMeasureOptions.end &&\n        startOrMeasureOptions.duration\n      ) {\n        start =\n          convertMarkToTimestamp(startOrMeasureOptions.end) -\n          convertMarkToTimestamp(startOrMeasureOptions.duration);\n      } else {\n        start = timeOrigin;\n      }\n    } else {\n      if (endMark) {\n        end = convertMarkToTimestamp(endMark);\n      } else {\n        end = now();\n      }\n\n      if (typeof startOrMeasureOptions === 'string') {\n        start = convertMarkToTimestamp(startOrMeasureOptions);\n      } else {\n        start = timeOrigin;\n      }\n    }\n\n    return addEntry(\n      new PerformanceMeasure(measureName, {\n        detail,\n        startTime: start,\n        duration: end - start,\n      })\n    );\n  };\n\n  const metric = (name: string, valueOrOptions: ValueOrOptions) => {\n    let value: string | number;\n    let startTime: number | undefined;\n    let detail: any;\n\n    if (\n      typeof valueOrOptions === 'object' &&\n      valueOrOptions.constructor == Object\n    ) {\n      if (!valueOrOptions.value) {\n        throw new TypeError(\n          `Failed to execute 'metric' on 'Performance': The value option must be passed.`\n        );\n      }\n      value = valueOrOptions.value;\n      startTime = valueOrOptions.startTime;\n      detail = valueOrOptions.detail;\n    } else if (\n      typeof valueOrOptions === 'undefined' ||\n      valueOrOptions === null\n    ) {\n      throw new TypeError(\n        `Failed to execute 'metric' on 'Performance': The value option must be passed.`\n      );\n    } else {\n      value = valueOrOptions as string | number;\n    }\n\n    return addEntry(\n      new PerformanceMetric(name, {\n        startTime: startTime ? startTime : now(),\n        value,\n        detail,\n      })\n    );\n  };\n\n  const getEntries = () => entries.slice(0);\n\n  const getEntriesByName = (name: string, type?: EntryType) =>\n    entries.filter(\n      (entry) => entry.name === name && (!type || entry.entryType === type)\n    );\n\n  function getEntriesByType(type: 'measure'): PerformanceMeasure[];\n  function getEntriesByType(type: 'mark'): PerformanceMark[];\n  function getEntriesByType(type: 'resource'): PerformanceResourceTiming[];\n  function getEntriesByType(type: 'metric'): PerformanceMetric[];\n  function getEntriesByType(\n    type: 'react-native-mark'\n  ): PerformanceReactNativeMark[];\n  function getEntriesByType(type: EntryType) {\n    return entries.filter((entry) => entry.entryType === type);\n  }\n\n  const PerformanceObserver = createPerformanceObserver({\n    addEventListener,\n    removeEventListener,\n    getEntriesByType,\n  });\n\n  return {\n    PerformanceObserver,\n    addEntry,\n    performance: {\n      timeOrigin,\n      now,\n      mark,\n      clearMarks,\n      measure,\n      clearMeasures,\n      metric,\n      clearMetrics,\n      clearResourceTimings,\n      getEntries,\n      getEntriesByName,\n      getEntriesByType,\n    },\n  };\n};\n\nexport type Performance = ReturnType<typeof createPerformance>['performance'];\n"
  },
  {
    "path": "packages/react-native-performance/src/resource-logger.ts",
    "content": "import { PerformanceResourceTiming } from './performance-entry';\nimport type { PerformanceEntry } from './performance-entry';\nimport type { Performance } from './performance';\n\ninterface XMLHttpRequestType extends XMLHttpRequest {\n  new (...args: any): XMLHttpRequestType;\n  performanceOriginal: XMLHttpRequest;\n  performanceStartTime?: number;\n  responseURL: string;\n  responseHeaders: string[];\n}\ninterface Context {\n  XMLHttpRequest: XMLHttpRequestType;\n}\n\nexport const installResourceLogger = (\n  context: Context,\n  performance: Performance,\n  addEntry: (entry: PerformanceEntry) => PerformanceEntry\n) => {\n  if (context.XMLHttpRequest && !context.XMLHttpRequest.performanceOriginal) {\n    class XMLHttpRequest extends context.XMLHttpRequest {\n      constructor(...args: any) {\n        super(...args);\n        this.performanceStartTime = null;\n\n        super.addEventListener('readystatechange', () => {\n          if (this.readyState === this.DONE) {\n            if (this.responseURL && this.responseHeaders) {\n              const responseEnd = performance.now();\n              const contentLength = Object.entries(this.responseHeaders).find(\n                ([header]) => header.toLowerCase() === 'content-length'\n              );\n              addEntry(\n                new PerformanceResourceTiming({\n                  name: this.responseURL,\n                  startTime: this.performanceStartTime,\n                  duration: responseEnd - this.performanceStartTime,\n                  initiatorType: 'xmlhttprequest',\n                  responseEnd,\n                  transferSize: contentLength ? parseInt(contentLength[1]) : 0,\n                })\n              );\n            }\n          }\n        });\n      }\n\n      open(...args: any) {\n        this.performanceStartTime = performance.now();\n        //@ts-ignore\n        super.open(...args);\n      }\n    }\n    XMLHttpRequest.performanceOriginal = context.XMLHttpRequest;\n    context.XMLHttpRequest = XMLHttpRequest;\n  }\n};\n\nexport const uninstallResourceLogger = (context: any) => {\n  if (context.XMLHttpRequest && context.XMLHttpRequest.performanceOriginal) {\n    context.XMLHttpRequest = context.XMLHttpRequest.performanceOriginal;\n  }\n};\n"
  },
  {
    "path": "packages/react-native-performance/test/README.md",
    "content": "# Tests\n\nThese tests are based on the [`web-platform-tests` project](https://web-platform-tests.org) under the [3-Clause BSD License](https://github.com/web-platform-tests/wpt/blob/master/LICENSE.md). Copyright 2019 [web-platform-tests contributors](https://github.com/web-platform-tests/wpt/graphs/contributors).\n\n## Running\n\n```bash\nyarn test\n```\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-entry.spec.ts",
    "content": "import { createPerformance } from '../src/performance';\n\ntest('PerformanceEntry.toJSON()', () => {\n  const { performance } = createPerformance();\n\n  performance.mark('markName');\n  performance.measure('measureName');\n\n  const entries = performance.getEntries();\n  const performanceEntryKeys = ['name', 'entryType', 'startTime', 'duration'];\n  for (let i = 0; i < entries.length; ++i) {\n    expect(typeof entries[i].toJSON).toBe('function');\n    const json = entries[i].toJSON();\n    expect(typeof json).toBe('object');\n    for (const key of performanceEntryKeys) {\n      expect(json[key]).toBe(entries[i][key]);\n    }\n  }\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-now.spec.ts",
    "content": "import { createPerformance } from '../src/performance';\n\ndescribe('as a polyfill', () => {\n  afterEach(() => {\n    jest.restoreAllMocks();\n  });\n\n  test('performance.now() does not cause infinite recursion', () => {\n    const { performance } = createPerformance();\n    // In react-native we can just polyfill the whole global object with `global.performance = performance`\n    // Doing the same in Node has no effect. The test would pass even without any change to `performance.ts`\n    jest\n      // @ts-ignore\n      .spyOn(global.performance, 'now')\n      .mockImplementation(performance.now.bind(performance));\n\n    // @ts-ignore\n    expect(() => global.performance.now()).not.toThrow();\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/buffered-false.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver', () => {\n  test('PerformanceObserver without buffered flag set to false cannot see past entries', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    performance.mark('foo');\n    // Use a timeout to ensure the remainder of the test runs after the entry is created.\n    setTimeout(() => {\n      // Observer with buffered flag set to false should not see entry.\n      new PerformanceObserver(() => {\n        throw new Error('Should not have observed any entry!');\n      }).observe({ type: 'mark', buffered: false });\n      // Use a timeout to give time to the observer.\n      setTimeout(done, 100);\n    }, 0);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/buffered-flag-after-timeout.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver', () => {\n  test('PerformanceObserver with buffered flag sees entry after timeout', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    performance.mark('foo');\n    setTimeout(() => {\n      // After a timeout, PerformanceObserver should still receive entry if using the buffered flag.\n      new PerformanceObserver((list) => {\n        const entries = list.getEntries();\n        expect(entries.length).toBe(1);\n        expect(entries[0].entryType).toBe('mark');\n        done();\n      }).observe({ type: 'mark', buffered: true });\n    }, 100);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/buffered-flag.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver', () => {\n  test('PerformanceObserver with buffered flag should see past and future entries', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    for (let i = 0; i < 50; i++) performance.mark('foo' + i);\n    let marksCreated = 50;\n    let marksReceived = 0;\n    new PerformanceObserver((list) => {\n      marksReceived += list.getEntries().length;\n      if (marksCreated < 100) {\n        performance.mark('bar' + marksCreated);\n        marksCreated++;\n      }\n      if (marksReceived == 100) done();\n    }).observe({ type: 'mark', buffered: true });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/disconnect-removes-observed-types.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test('Types observed are forgotten when disconnect() is called', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver((entryList) => {\n      // There should be no mark entry.\n      checkEntries(entryList.getEntries(), [\n        { entryType: 'measure', name: 'b' },\n      ]);\n      done();\n    });\n    observer.observe({ type: 'mark' });\n    // Disconnect the observer.\n    observer.disconnect();\n    // Now, only observe measure.\n    observer.observe({ type: 'measure' });\n    performance.mark('a');\n    performance.measure('b');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/disconnect.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver', () => {\n  test('disconnected callbacks must not be invoked', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver(() => {\n      throw new Error('This callback must not be invoked');\n    });\n    observer.observe({ entryTypes: ['mark', 'measure'] });\n    observer.disconnect();\n    performance.mark('mark1');\n    performance.measure('measure1');\n    setTimeout(done, 2000);\n  });\n\n  test('disconnecting an unconnected observer is a no-op', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => true);\n    obs.disconnect();\n    obs.disconnect();\n  });\n\n  test('An observer disconnected after a mark must not have its callback invoked', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver(() => {\n      throw new Error('This callback must not be invoked');\n    });\n    observer.observe({ entryTypes: ['mark'] });\n    performance.mark('mark1');\n    observer.disconnect();\n    performance.mark('mark2');\n    setTimeout(done, 2000);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/entries-sort.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries, checkSorted, wait } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test('getEntries, getEntriesByType, getEntriesByName sort order', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver((entryList) => {\n      const stored_entries = entryList.getEntries();\n      const stored_entries_by_type = entryList.getEntriesByType('mark');\n      const stored_entries_by_name = entryList.getEntriesByName('name-repeat');\n\n      checkSorted(stored_entries);\n      checkEntries(stored_entries, [\n        { entryType: 'measure', name: 'measure1' },\n        { entryType: 'measure', name: 'measure2' },\n        { entryType: 'measure', name: 'measure3' },\n        { entryType: 'measure', name: 'name-repeat' },\n        { entryType: 'mark', name: 'mark1' },\n        { entryType: 'mark', name: 'mark2' },\n        { entryType: 'measure', name: 'measure-matching-mark2-1' },\n        { entryType: 'measure', name: 'measure-matching-mark2-2' },\n        { entryType: 'mark', name: 'name-repeat' },\n        { entryType: 'mark', name: 'name-repeat' },\n      ]);\n\n      checkSorted(stored_entries_by_type);\n      checkEntries(stored_entries_by_type, [\n        { entryType: 'mark', name: 'mark1' },\n        { entryType: 'mark', name: 'mark2' },\n        { entryType: 'mark', name: 'name-repeat' },\n        { entryType: 'mark', name: 'name-repeat' },\n      ]);\n\n      checkSorted(stored_entries_by_name);\n      checkEntries(stored_entries_by_name, [\n        { entryType: 'measure', name: 'name-repeat' },\n        { entryType: 'mark', name: 'name-repeat' },\n        { entryType: 'mark', name: 'name-repeat' },\n      ]);\n\n      observer.disconnect();\n      done();\n    });\n\n    observer.observe({ entryTypes: ['mark', 'measure'] });\n\n    performance.mark('mark1');\n    performance.measure('measure1');\n    wait(); // Ensure mark1 !== mark2 startTime by making sure performance.now advances.\n    performance.mark('mark2');\n    performance.measure('measure2');\n    performance.measure('measure-matching-mark2-1', 'mark2');\n    wait(); // Ensure mark2 !== mark3 startTime by making sure performance.now advances.\n    performance.mark('name-repeat');\n    performance.measure('measure3');\n    performance.measure('measure-matching-mark2-2', 'mark2');\n    wait(); // Ensure name-repeat startTime will differ.\n    performance.mark('name-repeat');\n    wait(); // Ensure name-repeat startTime will differ.\n    performance.measure('name-repeat');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/get-entries.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test('getEntries, getEntriesByType and getEntriesByName work', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver((entryList) => {\n      checkEntries(entryList.getEntries(), [\n        { entryType: 'mark', name: 'mark1' },\n      ]);\n\n      checkEntries(entryList.getEntriesByType('mark'), [\n        { entryType: 'mark', name: 'mark1' },\n      ]);\n      expect(entryList.getEntriesByType('measure').length).toBe(0);\n      // @ts-ignore\n      expect(entryList.getEntriesByType('234567').length).toBe(0);\n\n      checkEntries(entryList.getEntriesByName('mark1'), [\n        { entryType: 'mark', name: 'mark1' },\n      ]);\n      expect(entryList.getEntriesByName('mark2').length).toBe(0);\n      expect(entryList.getEntriesByName('234567').length).toBe(0);\n\n      checkEntries(entryList.getEntriesByName('mark1', 'mark'), [\n        { entryType: 'mark', name: 'mark1' },\n      ]);\n      expect(entryList.getEntriesByName('mark1', 'measure').length).toBe(0);\n      expect(entryList.getEntriesByName('mark2', 'measure').length).toBe(0);\n      // @ts-ignore\n      expect(entryList.getEntriesByName('mark1', '234567').length).toBe(0);\n\n      observer.disconnect();\n      done();\n    });\n    observer.observe({ entryTypes: ['mark'] });\n    performance.mark('mark1');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/helpers.ts",
    "content": "// Vendored from https://github.com/web-platform-tests/wpt/blob/master/performance-timeline/performanceobservers.js\n\n// Compares a performance entry to a predefined one\n// perfEntriesToCheck is an array of performance entries from the user agent\n// expectedEntries is an array of performance entries minted by the test\nexport function checkEntries(perfEntriesToCheck, expectedEntries) {\n  function findMatch(pe) {\n    // we match based on entryType and name\n    for (var i = expectedEntries.length - 1; i >= 0; i--) {\n      var ex = expectedEntries[i];\n      if (ex.entryType === pe.entryType && ex.name === pe.name) {\n        return ex;\n      }\n    }\n    return null;\n  }\n\n  expect(perfEntriesToCheck.length).toBe(expectedEntries.length);\n\n  perfEntriesToCheck.forEach(function (pe1) {\n    expect(findMatch(pe1)).not.toBe(null);\n  });\n}\n\n// Waits for performance.now to advance. Since precision reduction might\n// cause it to return the same value across multiple calls.\nexport function wait() {\n  // @ts-ignore\n  const now = global.performance.now();\n  // @ts-ignore\n  while (now === global.performance.now()) continue;\n}\n\n// Ensure the entries list is sorted by startTime.\nexport function checkSorted(entries) {\n  expect(entries.length).not.toBe(0);\n  if (!entries.length) return;\n\n  var lastStartTime = entries[0].startTime;\n  for (var i = 1; i < entries.length; ++i) {\n    var currStartTime = entries[i].startTime;\n    expect(lastStartTime).toBeLessThanOrEqual(currStartTime);\n    lastStartTime = currStartTime;\n  }\n}\n\nexport function muteConsoleWarn() {\n  beforeAll(() => {\n    const originalWarn = console.warn;\n    console.warn = () => {};\n    // @ts-ignore\n    console.warn.original = originalWarn;\n  });\n\n  afterAll(() => {\n    // @ts-ignore\n    console.warn = console.warn.original;\n  });\n}\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/mark-measure.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test('entries are observable', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    let stored_entries = [];\n\n    const observer = new PerformanceObserver((entryList) => {\n      stored_entries = stored_entries.concat(entryList.getEntries());\n      if (stored_entries.length >= 4) {\n        checkEntries(stored_entries, [\n          { entryType: 'mark', name: 'mark1' },\n          { entryType: 'mark', name: 'mark2' },\n          { entryType: 'measure', name: 'measure1' },\n          { entryType: 'measure', name: 'measure2' },\n        ]);\n        observer.disconnect();\n        done();\n      }\n    });\n    observer.observe({ entryTypes: ['mark', 'measure'] });\n    performance.mark('mark1');\n    performance.mark('mark2');\n    performance.measure('measure1');\n    performance.measure('measure2');\n  });\n\n  test('mark entries are observable', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    let mark_entries = [];\n\n    const observer = new PerformanceObserver((entryList) => {\n      mark_entries = mark_entries.concat(entryList.getEntries());\n      if (mark_entries.length >= 2) {\n        checkEntries(mark_entries, [\n          { entryType: 'mark', name: 'mark1' },\n          { entryType: 'mark', name: 'mark2' },\n        ]);\n        observer.disconnect();\n        done();\n      }\n    });\n    observer.observe({ entryTypes: ['mark'] });\n    performance.mark('mark1');\n    performance.mark('mark2');\n  });\n\n  test('measure entries are observable', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    let measure_entries = [];\n\n    const observer = new PerformanceObserver((entryList) => {\n      measure_entries = measure_entries.concat(entryList.getEntries());\n      if (measure_entries.length >= 2) {\n        checkEntries(measure_entries, [\n          { entryType: 'measure', name: 'measure1' },\n          { entryType: 'measure', name: 'measure2' },\n        ]);\n        observer.disconnect();\n        done();\n      }\n    });\n    observer.observe({ entryTypes: ['measure'] });\n    performance.measure('measure1');\n    performance.measure('measure2');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/multiple-buffered-flag-observers.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver', () => {\n  test('Multiple PerformanceObservers with buffered flag see all entries', () => {\n    const { performance, PerformanceObserver } = createPerformance();\n\n    // The first promise waits for one buffered flag observer to receive 3 entries.\n    const promise1 = new Promise((resolve1) => {\n      let numObserved1 = 0;\n      new PerformanceObserver((_, obs) => {\n        // This buffered flag observer is constructed after a regular observer detects a mark.\n        new PerformanceObserver((list) => {\n          numObserved1 += list.getEntries().length;\n          if (numObserved1 == 3) resolve1(null);\n        }).observe({ type: 'mark', buffered: true });\n        obs.disconnect();\n      }).observe({ entryTypes: ['mark'] });\n      performance.mark('foo');\n    });\n\n    // The second promise waits for another buffered flag observer to receive 3 entries.\n    const promise2 = new Promise((resolve2) => {\n      setTimeout(() => {\n        let numObserved2 = 0;\n        // This buffered flag observer is constructed after a delay of 100ms.\n        new PerformanceObserver((list) => {\n          numObserved2 += list.getEntries().length;\n          if (numObserved2 == 3) resolve2(null);\n        }).observe({ type: 'mark', buffered: true });\n      }, 100);\n      performance.mark('bar');\n    });\n\n    performance.mark('meow');\n\n    // Pass if and only if both buffered observers received all 3 mark entries.\n    return Promise.all([promise1, promise2]);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/observe-repeated-type.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test(\"Two calls of observe() with the same 'type' cause override\", (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver((entryList) => {\n      checkEntries(entryList.getEntries(), [\n        { entryType: 'mark', name: 'early' },\n      ]);\n      observer.disconnect();\n      done();\n    });\n    performance.mark('early');\n    // This call will not trigger anything.\n    observer.observe({ type: 'mark' });\n    // This call should override the previous call and detect the early mark.\n    observer.observe({ type: 'mark', buffered: true });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/observe-type.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { muteConsoleWarn } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  muteConsoleWarn();\n\n  test(\"Calling observe() without 'type' or 'entryTypes' throws a TypeError\", () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    // @ts-ignore\n    expect(() => obs.observe({})).toThrow(TypeError);\n    // @ts-ignore\n    expect(() => obs.observe({ entryType: ['mark', 'measure'] })).toThrow(\n      TypeError\n    );\n  });\n\n  test('Calling observe() with entryTypes and then type should throw an InvalidModificationError', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    obs.observe({ entryTypes: ['mark'] });\n    expect(() => obs.observe({ type: 'measure' })).toThrow();\n  });\n\n  test('Calling observe() with type and then entryTypes should throw an InvalidModificationError', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    obs.observe({ type: 'mark' });\n    expect(() => obs.observe({ entryTypes: ['measure'] })).toThrow();\n  });\n\n  test('Passing in unknown values to type does not throw an exception', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    // Definitely not an entry type.\n    // @ts-ignore\n    obs.observe({ type: 'this-cannot-match-an-entryType' });\n    // Close to an entry type, but not quite.\n    // @ts-ignore\n    obs.observe({ type: 'marks' });\n  });\n\n  test('observe() with different type values stacks', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    let observedMark = 0;\n    let observedMeasure = 0;\n    const observer = new PerformanceObserver(function (entryList) {\n      observedMark |= entryList\n        .getEntries()\n        .filter((entry) => entry.entryType === 'mark').length;\n      observedMeasure |= entryList\n        .getEntries()\n        .filter((entry) => entry.entryType === 'measure').length;\n      // Only conclude the test once we receive both entries!\n      if (observedMark && observedMeasure) {\n        observer.disconnect();\n        done();\n      }\n    });\n    observer.observe({ type: 'mark' });\n    observer.observe({ type: 'measure' });\n    performance.mark('mark1');\n    performance.measure('measure1');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/observe.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { PerformanceObserverEntryList } from '../../src/performance-observer';\nimport { checkEntries, muteConsoleWarn } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  muteConsoleWarn();\n\n  test('entryTypes must be a sequence or throw a TypeError', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    // @ts-ignore\n    expect(() => obs.observe({ entryTypes: 'mark' })).toThrow(TypeError);\n  });\n\n  test('Unknown entryTypes do not throw an exception', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    // @ts-ignore\n    obs.observe({ entryTypes: ['this-cannot-match-an-entryType'] });\n    // @ts-ignore\n    obs.observe({ entryTypes: ['marks', 'navigate', 'resources'] });\n  });\n\n  test('Filter unsupported entryType entryType names within the entryTypes sequence', () => {\n    const { PerformanceObserver } = createPerformance();\n    const obs = new PerformanceObserver(() => {});\n    // @ts-ignore\n    obs.observe({ entryTypes: ['mark', 'this-cannot-match-an-entryType'] });\n    // @ts-ignore\n    obs.observe({ entryTypes: ['this-cannot-match-an-entryType', 'mark'] });\n    // @ts-ignore\n    obs.observe({ entryTypes: ['mark'], others: true });\n  });\n\n  test('Check observer callback parameter and this values', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver(function (entryList, obs) {\n      expect(entryList).toBeInstanceOf(PerformanceObserverEntryList);\n      expect(obs).toBeInstanceOf(PerformanceObserver);\n      expect(observer).toBe(this);\n      expect(observer).toBe(obs);\n      expect(this).toBe(obs);\n      observer.disconnect();\n      done();\n    });\n    performance.clearMarks();\n    observer.observe({ entryTypes: ['mark'] });\n    performance.mark('mark1');\n  });\n\n  test('replace observer if already present', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver(function (entryList) {\n      checkEntries(entryList.getEntries(), [\n        { entryType: 'measure', name: 'measure1' },\n      ]);\n      observer.disconnect();\n      done();\n    });\n    performance.clearMarks();\n    observer.observe({ entryTypes: ['mark'] });\n    observer.observe({ entryTypes: ['measure'] });\n    performance.mark('mark1');\n    performance.measure('measure1');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/supported-entry-types.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\n\ndescribe('PerformanceObserver.supportedEntryTypes', () => {\n  it('exists and returns entries in alphabetical order', () => {\n    const { PerformanceObserver } = createPerformance();\n\n    expect(PerformanceObserver.supportedEntryTypes).not.toBeUndefined();\n    const types = PerformanceObserver.supportedEntryTypes;\n    for (let i = 1; i < types.length; i++) {\n      expect(types[i - 1] < types[i]).toBe(true);\n    }\n  });\n\n  it('caches result', () => {\n    const { PerformanceObserver } = createPerformance();\n\n    expect(PerformanceObserver.supportedEntryTypes).toBe(\n      PerformanceObserver.supportedEntryTypes\n    );\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/performance-observer/take-records.spec.ts",
    "content": "import { createPerformance } from '../../src/performance';\nimport { checkEntries } from './helpers';\n\ndescribe('PerformanceObserver', () => {\n  test('takeRecords()', (done) => {\n    const { performance, PerformanceObserver } = createPerformance();\n    const observer = new PerformanceObserver(() => {\n      throw new Error('This callback should not have been called.');\n    });\n    let entries = observer.takeRecords();\n    checkEntries(entries, []); // No records before observe\n    observer.observe({ entryTypes: ['mark'] });\n    entries = observer.takeRecords();\n    checkEntries(entries, []); // No records just from observe\n    performance.mark('a');\n    performance.mark('b');\n    entries = observer.takeRecords();\n    checkEntries(entries, [\n      { entryType: 'mark', name: 'a' },\n      { entryType: 'mark', name: 'b' },\n    ]);\n    performance.mark('c');\n    performance.mark('d');\n    performance.mark('e');\n    entries = observer.takeRecords();\n    checkEntries(entries, [\n      { entryType: 'mark', name: 'c' },\n      { entryType: 'mark', name: 'd' },\n      { entryType: 'mark', name: 'e' },\n    ]);\n    entries = observer.takeRecords();\n    checkEntries(entries, []); // No entries right after takeRecords\n    observer.disconnect();\n    done();\n  });\n});\n"
  },
  {
    "path": "packages/react-native-performance/test/setup.js",
    "content": "const perf = require('perf_hooks').performance;\nglobal.performance.now = perf.now.bind(perf);\n"
  },
  {
    "path": "packages/react-native-performance/test/user-timing-3.spec.ts",
    "content": "import { createPerformance } from '../src/performance';\n\ntest('Performance.measure with start', () => {\n  const mockNow = jest.fn();\n  mockNow.mockReturnValue(1);\n  const { performance } = createPerformance(mockNow);\n\n  mockNow.mockReturnValue(2);\n  performance.mark('start');\n  mockNow.mockReturnValue(8);\n  const measure1 = performance.measure('measure1', 'start');\n  const measure2 = performance.measure('measure2', { start: 'start' });\n  expect(measure1.startTime).toBe(2);\n  expect(measure2.startTime).toBe(2);\n  expect(measure1.duration).toBe(6);\n  expect(measure2.duration).toBe(6);\n});\n\ntest('Performance.measure with end', () => {\n  const mockNow = jest.fn();\n  mockNow.mockReturnValue(1);\n  const { performance } = createPerformance(mockNow);\n\n  mockNow.mockReturnValue(5);\n  performance.mark('end');\n  mockNow.mockReturnValue(8);\n  const measure1 = performance.measure('measure1', null, 'end');\n  const measure2 = performance.measure('measure2', {\n    end: 'end',\n    detail: 'lol',\n  });\n  expect(measure1.startTime).toBe(1);\n  expect(measure2.startTime).toBe(1);\n  expect(measure1.duration).toBe(4);\n  expect(measure2.duration).toBe(4);\n});\n\ntest('Performance.measure with duration', () => {\n  const mockNow = jest.fn();\n  mockNow.mockReturnValue(1);\n  const { performance } = createPerformance(mockNow);\n\n  mockNow.mockReturnValue(2);\n  performance.mark('start');\n  mockNow.mockReturnValue(5);\n  performance.mark('end');\n  mockNow.mockReturnValue(8);\n  const measure1 = performance.measure('measure2', {\n    duration: 1,\n    end: 'end',\n  });\n  expect(measure1.startTime).toBe(4);\n  expect(measure1.duration).toBe(1);\n  const measure2 = performance.measure('measure2', {\n    duration: 2,\n    start: 'start',\n  });\n  expect(measure2.startTime).toBe(2);\n  expect(measure2.duration).toBe(2);\n});\n"
  },
  {
    "path": "packages/react-native-performance/tsconfig.build.json",
    "content": "{\n  \"extends\": \"./tsconfig.json\",\n  \"exclude\": [\"test\"]\n}\n"
  },
  {
    "path": "packages/react-native-performance/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\"\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"allowUnreachableCode\": false,\n    \"allowUnusedLabels\": false,\n    \"esModuleInterop\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"jsx\": \"react\",\n    \"lib\": [\"esnext\"],\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"noFallthroughCasesInSwitch\": true,\n    \"noImplicitReturns\": true,\n    \"noImplicitUseStrict\": false,\n    \"noStrictGenericChecks\": false,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"skipLibCheck\": true,\n    \"target\": \"esnext\"\n  },\n  \"exclude\": [\"examples\"]\n}\n"
  }
]