From 921869214d0278610de98863635bd7764ded66a5 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 6 Sep 2024 16:24:47 +0000 Subject: [PATCH 1/5] Update `react@experimental` --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1402a0e080b8e..ca454316802e2 100644 --- a/package.json +++ b/package.json @@ -212,13 +212,13 @@ "react-dom": "19.0.0-rc-7771d3a7-20240827", "react-dom-17": "npm:react-dom@17.0.2", "react-dom-builtin": "npm:react-dom@19.0.0-rc-7771d3a7-20240827", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-7771d3a7-20240827", - "react-experimental-builtin": "npm:react@0.0.0-experimental-7771d3a7-20240827", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-a03254bc-20240905", + "react-experimental-builtin": "npm:react@0.0.0-experimental-a03254bc-20240905", "react-is-builtin": "npm:react-is@19.0.0-rc-7771d3a7-20240827", "react-server-dom-turbopack": "19.0.0-rc-7771d3a7-20240827", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905", "react-server-dom-webpack": "19.0.0-rc-7771d3a7-20240827", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -229,7 +229,7 @@ "sass": "1.54.0", "satori": "0.10.9", "scheduler-builtin": "npm:scheduler@0.25.0-rc-7771d3a7-20240827", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-7771d3a7-20240827", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-a03254bc-20240905", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", From 456a80346d2d031e7f8ed49ae7695e1d08956154 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 6 Sep 2024 16:24:47 +0000 Subject: [PATCH 2/5] Update `react@rc` --- package.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index ca454316802e2..ac45b4890c097 100644 --- a/package.json +++ b/package.json @@ -206,18 +206,18 @@ "pretty-bytes": "5.3.0", "pretty-ms": "7.0.0", "random-seed": "0.3.0", - "react": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-a03254bc-20240905", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react-builtin": "npm:react@19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-7771d3a7-20240827", + "react-dom-builtin": "npm:react-dom@19.0.0-rc-a03254bc-20240905", "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-a03254bc-20240905", "react-experimental-builtin": "npm:react@0.0.0-experimental-a03254bc-20240905", - "react-is-builtin": "npm:react-is@19.0.0-rc-7771d3a7-20240827", - "react-server-dom-turbopack": "19.0.0-rc-7771d3a7-20240827", + "react-is-builtin": "npm:react-is@19.0.0-rc-a03254bc-20240905", + "react-server-dom-turbopack": "19.0.0-rc-a03254bc-20240905", "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905", - "react-server-dom-webpack": "19.0.0-rc-7771d3a7-20240827", + "react-server-dom-webpack": "19.0.0-rc-a03254bc-20240905", "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", @@ -228,7 +228,7 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-7771d3a7-20240827", + "scheduler-builtin": "npm:scheduler@0.25.0-rc-a03254bc-20240905", "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-a03254bc-20240905", "seedrandom": "3.0.5", "semver": "7.3.7", @@ -269,10 +269,10 @@ "@babel/traverse": "7.22.5", "@types/react": "npm:types-react@19.0.0-rc.0", "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", - "react-is": "19.0.0-rc-7771d3a7-20240827", - "scheduler": "0.25.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905", + "react-is": "19.0.0-rc-a03254bc-20240905", + "scheduler": "0.25.0-rc-a03254bc-20240905" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch" From 30c93dff2df88f4c4b443f472653f9766dc8ea59 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 6 Sep 2024 16:24:48 +0000 Subject: [PATCH 3/5] Updated peer dependency references --- examples/reproduction-template/package.json | 4 ++-- packages/create-next-app/templates/index.ts | 2 +- packages/next/package.json | 4 ++-- run-tests.js | 2 +- test/.stats-app/package.json | 4 ++-- test/e2e/next-test/first-time-setup-js/package.json | 4 ++-- test/e2e/next-test/first-time-setup-ts/package.json | 4 ++-- test/lib/next-modes/base.ts | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/reproduction-template/package.json b/examples/reproduction-template/package.json index e46540ae538d7..3b9cb604fefb4 100644 --- a/examples/reproduction-template/package.json +++ b/examples/reproduction-template/package.json @@ -7,8 +7,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905" }, "devDependencies": { "@types/node": "20.12.12", diff --git a/packages/create-next-app/templates/index.ts b/packages/create-next-app/templates/index.ts index ffbcd544c9b58..25893fa819bf2 100644 --- a/packages/create-next-app/templates/index.ts +++ b/packages/create-next-app/templates/index.ts @@ -13,7 +13,7 @@ import { GetTemplateFileArgs, InstallTemplateArgs } from "./types"; // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-a03254bc-20240905"; /** * Get the file path for a given file in a template, e.g. "next.config.js". diff --git a/packages/next/package.json b/packages/next/package.json index bc39575d6aef9..a0fe4778e2c0d 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -108,8 +108,8 @@ "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905", "sass": "^1.3.0" }, "peerDependenciesMeta": { diff --git a/run-tests.js b/run-tests.js index f1f00f88e64c1..86adc581ce20a 100644 --- a/run-tests.js +++ b/run-tests.js @@ -20,7 +20,7 @@ const { getTestFilter } = require('./test/get-test-filter') // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-a03254bc-20240905"; let argv = require('yargs/yargs')(process.argv.slice(2)) .string('type') diff --git a/test/.stats-app/package.json b/test/.stats-app/package.json index 58cf2ed6c29fd..cdbe6d4ec77a1 100644 --- a/test/.stats-app/package.json +++ b/test/.stats-app/package.json @@ -4,8 +4,8 @@ "license": "MIT", "dependencies": { "next": "latest", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905" }, "engines": { "node": ">=18.18.0" diff --git a/test/e2e/next-test/first-time-setup-js/package.json b/test/e2e/next-test/first-time-setup-js/package.json index a135b40a27c11..0843438df9e3c 100644 --- a/test/e2e/next-test/first-time-setup-js/package.json +++ b/test/e2e/next-test/first-time-setup-js/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905" } } diff --git a/test/e2e/next-test/first-time-setup-ts/package.json b/test/e2e/next-test/first-time-setup-ts/package.json index 107dfe0c5b5f7..a48f8a1634ae7 100644 --- a/test/e2e/next-test/first-time-setup-ts/package.json +++ b/test/e2e/next-test/first-time-setup-ts/package.json @@ -8,8 +8,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905" }, "devDependencies": { "@types/react": "^18", diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index 561e5229302fc..0fff78467c16b 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -51,7 +51,7 @@ type OmitFirstArgument = F extends ( // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-7771d3a7-20240827"; +const nextjsReactPeerVersion = "19.0.0-rc-a03254bc-20240905"; export class NextInstance { protected files: FileRef | { [filename: string]: string | FileRef } From a288cc8761a2561337ac4f637ab7a89bd4a2bdb7 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 6 Sep 2024 16:24:59 +0000 Subject: [PATCH 4/5] Update lockfile --- pnpm-lock.yaml | 384 ++++++++++++++++++++++++------------------------- 1 file changed, 192 insertions(+), 192 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8113a02d81bea..732f5452dd684 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,10 +15,10 @@ overrides: '@babel/traverse': 7.22.5 '@types/react': npm:types-react@19.0.0-rc.0 '@types/react-dom': npm:types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 + react-is: 19.0.0-rc-a03254bc-20240905 + scheduler: 0.25.0-rc-a03254bc-20240905 patchedDependencies: webpack-sources@3.2.3: @@ -64,7 +64,7 @@ importers: version: 11.11.0 '@emotion/react': specifier: 11.11.1 - version: 11.11.1(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0) + version: 11.11.1(react@19.0.0-rc-a03254bc-20240905)(types-react@19.0.0-rc.0) '@fullhuman/postcss-purgecss': specifier: 1.3.0 version: 1.3.0 @@ -73,7 +73,7 @@ importers: version: 2.2.1(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))) '@mdx-js/react': specifier: 2.2.1 - version: 2.2.1(react@19.0.0-rc-7771d3a7-20240827) + version: 2.2.1(react@19.0.0-rc-a03254bc-20240905) '@next/bundle-analyzer': specifier: workspace:* version: link:packages/next-bundle-analyzer @@ -139,7 +139,7 @@ importers: version: 6.1.2(@jest/globals@29.7.0)(@types/jest@29.5.5)(jest@29.7.0(@types/node@20.12.3)(babel-plugin-macros@3.1.0)) '@testing-library/react': specifier: ^15.0.5 - version: 15.0.7(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0) + version: 15.0.7(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(types-react@19.0.0-rc.0) '@types/busboy': specifier: 1.5.3 version: 1.5.3 @@ -450,50 +450,50 @@ importers: specifier: 0.3.0 version: 0.3.0 react: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827 + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905 react-17: specifier: npm:react@17.0.2 version: react@17.0.2 react-builtin: - specifier: npm:react@19.0.0-rc-7771d3a7-20240827 - version: react@19.0.0-rc-7771d3a7-20240827 + specifier: npm:react@19.0.0-rc-a03254bc-20240905 + version: react@19.0.0-rc-a03254bc-20240905 react-dom: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) react-dom-17: specifier: npm:react-dom@17.0.2 - version: react-dom@17.0.2(react@19.0.0-rc-7771d3a7-20240827) + version: react-dom@17.0.2(react@19.0.0-rc-a03254bc-20240905) react-dom-builtin: - specifier: npm:react-dom@19.0.0-rc-7771d3a7-20240827 - version: react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + specifier: npm:react-dom@19.0.0-rc-a03254bc-20240905 + version: react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) react-dom-experimental-builtin: - specifier: npm:react-dom@0.0.0-experimental-7771d3a7-20240827 - version: react-dom@0.0.0-experimental-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + specifier: npm:react-dom@0.0.0-experimental-a03254bc-20240905 + version: react-dom@0.0.0-experimental-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) react-experimental-builtin: - specifier: npm:react@0.0.0-experimental-7771d3a7-20240827 - version: react@0.0.0-experimental-7771d3a7-20240827 + specifier: npm:react@0.0.0-experimental-a03254bc-20240905 + version: react@0.0.0-experimental-a03254bc-20240905 react-is-builtin: - specifier: npm:react-is@19.0.0-rc-7771d3a7-20240827 - version: react-is@19.0.0-rc-7771d3a7-20240827 + specifier: npm:react-is@19.0.0-rc-a03254bc-20240905 + version: react-is@19.0.0-rc-a03254bc-20240905 react-server-dom-turbopack: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827) + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905) react-server-dom-turbopack-experimental: - specifier: npm:react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827 - version: react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827) + specifier: npm:react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905 + version: react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905) react-server-dom-webpack: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))) + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))) react-server-dom-webpack-experimental: - specifier: npm:react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827 - version: react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))) + specifier: npm:react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905 + version: react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))) react-ssr-prepass: specifier: 1.0.8 - version: 1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-7771d3a7-20240827) + version: 1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-a03254bc-20240905) react-virtualized: specifier: 9.22.3 - version: 9.22.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827) + version: 9.22.3(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905) relay-compiler: specifier: 13.0.2 version: 13.0.2 @@ -516,11 +516,11 @@ importers: specifier: 0.10.9 version: 0.10.9 scheduler-builtin: - specifier: npm:scheduler@0.25.0-rc-7771d3a7-20240827 - version: scheduler@0.25.0-rc-7771d3a7-20240827 + specifier: npm:scheduler@0.25.0-rc-a03254bc-20240905 + version: scheduler@0.25.0-rc-a03254bc-20240905 scheduler-experimental-builtin: - specifier: npm:scheduler@0.0.0-experimental-7771d3a7-20240827 - version: scheduler@0.0.0-experimental-7771d3a7-20240827 + specifier: npm:scheduler@0.0.0-experimental-a03254bc-20240905 + version: scheduler@0.0.0-experimental-a03254bc-20240905 seedrandom: specifier: 3.0.5 version: 3.0.5 @@ -535,16 +535,16 @@ importers: version: 6.0.0 styled-components: specifier: 6.0.0-rc.3 - version: 6.0.0-rc.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827) + version: 6.0.0-rc.3(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905) styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7771d3a7-20240827) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-a03254bc-20240905) styled-jsx-plugin-postcss: specifier: 3.0.2 version: 3.0.2 swr: specifier: ^2.2.4 - version: 2.2.4(react@19.0.0-rc-7771d3a7-20240827) + version: 2.2.4(react@19.0.0-rc-a03254bc-20240905) tailwindcss: specifier: 3.2.7 version: 3.2.7(postcss@8.4.31) @@ -857,7 +857,7 @@ importers: version: 0.5.13 babel-plugin-react-compiler: specifier: '*' - version: 0.0.0-experimental-7449567-20240904 + version: 0.0.0-experimental-7449567-20240905 busboy: specifier: 1.6.0 version: 1.6.0 @@ -871,17 +871,17 @@ importers: specifier: 8.4.31 version: 8.4.31 react: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827 + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905 react-dom: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) sass: specifier: ^1.3.0 version: 1.77.8 styled-jsx: specifier: 5.1.6 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7771d3a7-20240827) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-a03254bc-20240905) optionalDependencies: sharp: specifier: ^0.33.5 @@ -1462,7 +1462,7 @@ importers: version: 1.0.35 unistore: specifier: 3.4.1 - version: 3.4.1(react@19.0.0-rc-7771d3a7-20240827) + version: 3.4.1(react@19.0.0-rc-a03254bc-20240905) util: specifier: 0.12.4 version: 0.12.4 @@ -1596,8 +1596,8 @@ importers: packages/third-parties: dependencies: react: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827 + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905 third-party-capital: specifier: 1.0.20 version: 1.0.20 @@ -1657,14 +1657,14 @@ importers: specifier: 29.5.0 version: 29.5.0 react: - specifier: 19.0.0-rc-7771d3a7-20240827 - version: 19.0.0-rc-7771d3a7-20240827 + specifier: 19.0.0-rc-a03254bc-20240905 + version: 19.0.0-rc-a03254bc-20240905 react-test-renderer: specifier: 18.2.0 - version: 18.2.0(react@19.0.0-rc-7771d3a7-20240827) + version: 18.2.0(react@19.0.0-rc-a03254bc-20240905) styled-jsx: specifier: ^5.1.2 - version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7771d3a7-20240827) + version: 5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-a03254bc-20240905) turbopack/packages/devlow-bench: dependencies: @@ -3276,7 +3276,7 @@ packages: resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -3293,7 +3293,7 @@ packages: '@emotion/use-insertion-effect-with-fallbacks@1.0.1': resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 '@emotion/utils@1.2.1': resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} @@ -3486,14 +3486,14 @@ packages: '@floating-ui/react-dom@2.1.0': resolution: {integrity: sha512-lNzj5EQmEKn5FFKc04+zasr09h/uX8RtJRNj5gUXsSQIXHVWTVh+hVAg1vOMCexkX8EgvemMvIFpQfkosnVNyA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 '@floating-ui/react@0.26.16': resolution: {integrity: sha512-HEf43zxZNAI/E781QIVpYSF3K2VH4TTYZpqecjdsFkjsaU1EbaWcM++kw0HXFffj7gDUcBFevX8s0rQGQpxkow==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 '@floating-ui/utils@0.2.2': resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} @@ -4133,13 +4133,13 @@ packages: resolution: {integrity: sha512-l9ypojKN3PjwO1CSLIsqxi7mA25+7w+xc71Q+JuCCREI0tuGwkZsKbIOpuTATIJOjPh8ycLiW7QxX1LYsRTq6w==} peerDependencies: '@mantine/hooks': 7.10.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 '@mantine/hooks@7.11.2': resolution: {integrity: sha512-jhyVe/sbDEG2U8rr2lMecUPgQxcfr5hh9HazqGfkS7ZRIMDO7uJ947yAcTMGGkp5Lxtt5TBFt1Cb6tiB2/1agg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 '@mapbox/node-pre-gyp@1.0.5': resolution: {integrity: sha512-4srsKPXWlIxp5Vbqz5uLfBN+du2fJChBoYn/f2h991WLdk7jUvcSk/McVLSv/X+xQIPI8eGD5GjrnygdyHnhPA==} @@ -4156,7 +4156,7 @@ packages: '@mdx-js/react@2.2.1': resolution: {integrity: sha512-YdXcMcEnqZhzql98RNrqYo9cEhTTesBiCclEtoiQUbJwx87q9453GTapYU6kJ8ZZ2ek1Vp25SiAXEFy5O/eAPw==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 '@mswjs/cookies@1.1.0': resolution: {integrity: sha512-0ZcCVQxifZmhwNBoQIrystCb+2sWBY2Zw8lpfJBPCHGCA/HWqehITeCRVIv4VMy8MPlaHo2w2pTHFV2pFfqKPw==} @@ -4839,8 +4839,8 @@ packages: engines: {node: '>=18'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -5920,8 +5920,8 @@ packages: peerDependencies: '@babel/core': 7.22.5 - babel-plugin-react-compiler@0.0.0-experimental-7449567-20240904: - resolution: {integrity: sha512-IqCWVU3ItO/BOTJA9gM+FNLwe8CGnCky5ZC3EULqMKkG7NVr/9XzUOApj8xtmQIM9WuZzzqRaJMXmW88xF+0Tw==} + babel-plugin-react-compiler@0.0.0-experimental-7449567-20240905: + resolution: {integrity: sha512-ltBywPFOEf1rRnkRQ1TiiPJeqJ1Cte86bo4tpSPsfqGTTsiyUo8OLyOR13EG08QIFTQd6HfGGgjpE9Kv/t5Vcg==} babel-plugin-react-compiler@0.0.0-experimental-c23de8d-20240515: resolution: {integrity: sha512-0XN2gmpT55QtAz5n7d5g91y1AuO9tRhWBaLgCRyc4ExHrlr7+LfxW+YTb3mOwxngkkiggwM8HyYsaEK9MqhnlQ==} @@ -10368,7 +10368,7 @@ packages: lucide-react@0.383.0: resolution: {integrity: sha512-13xlG0CQCJtzjSQYwwJ3WRqMHtRj3EXmLlorrARt7y+IHnxUCp3XyFNL1DfaGySWxHObDvnu1u1dV+0VMKHUSg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -12604,28 +12604,28 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-dom@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-lgOBiTipHJIKgJyiaV/YhL28X0vdt30fuHQxiW73/3WSu/ePSO/hV8uSefpiPhqMTq4TUKKylOBHhcG1/fy3Jw==} + react-dom@0.0.0-experimental-a03254bc-20240905: + resolution: {integrity: sha512-+PAKz2Rz+ketxna3UcvtkEifKh+8KGrWoOqHfmjIdv3XuNcm/d+5xvIdDwYHZn6gIxU9ngJn993D6aj9RCtY0w==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-dom@17.0.2: resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 - react-dom@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-EMgZJX6EEQEr+pso+9ySkrEMPv3N7zF2fbi0f6uB+X7r8E+O2GqPRcIHtFigMdW8uS0XCVFHAocMnIc4yPULYQ==} + react-dom@19.0.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-gcT0dNxfpx6LYkeuaTgOLf3xKpiQy5CkKTjynLGLimzBDrHT5sUZ4j0L5mS4IJ8kDri/8gn3tbumlgtT9qSZzA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-dom@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-oUa/reDvGtjRcxi8u+GYHaDHanudaO28+G+Wvxm50CItW1xwIFN2Nn7foJxxDS9lFLGdRWZvjxldZEPAUSuXbg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 - react-is@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-vy9RwFmrhsGQAJEbFQyTskRWXVm39Ax2Ikao51VX2GBXoV2XOQ17vdhyhltCOa+yuoNj0p3X2C90+bxG+w2u0Q==} + react-is@19.0.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-bXg2IuxD6BIHVp7t7B2BUc+VvoWj+k6lEBTsi7GVrp8/Q7BkYGcvKFH48t0RHiEWcOmgXeD7dsljAsqOpXEnKA==} react-is@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-1tXoLFzVbqHAQeY3CwpyF5IYbkwgSoNHhrhS8qOrfiZIh2461h/C1BP/JVIxwyL51wHhUgLsAc/M8g0OcEhV1A==} @@ -12636,8 +12636,8 @@ packages: react-number-format@5.4.0: resolution: {integrity: sha512-NWdICrqLhI7rAS8yUeLVd6Wr4cN7UjJ9IBTS0f/a9i7UB4x4Ti70kGnksBtZ7o4Z7YRbvCMMR/jQmkoOBa/4fg==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 react-refresh@0.12.0: resolution: {integrity: sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A==} @@ -12648,7 +12648,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -12658,58 +12658,58 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-5j6sur5W5Oj7XZfS8EjvwmnbvaW42HHPY00ur0/HCvUxZNEPsTg7Ri4y3WlP4ebZTKdubCU5hD/Nt5/GkxvnuQ==} + react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905: + resolution: {integrity: sha512-3b+txfYMHPQAAsXmYBWdaxLQ/tPY+wUWRsrbKrJ96Exuu4z0+Ew4fdkhK9jxnwoBPYdzjNuQaJ2PywYIC8m1yw==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 - react-server-dom-turbopack@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-KkipAuYaTTQivseV0DNwRS8K6o8K5YuohXlXS5NY9QPXAyyk/Q2LSFUayMrk9ICAmty+Fs5xVjN4UAIpi1gmOQ==} + react-server-dom-turbopack@19.0.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-RVIWS2sxhFHXgsBrQB/HDc5O4DEZtx9wgRbCL7hxVlhOMriBD/TH8M9u/naFQCFW0WByhIugdP0J7wbaOL0IGw==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 - react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-swlsAzmGKLEp+afolIWJo8jIwt0GLux2j4IQzqVRRw1j/1nn7aO6a5po/rveOMR6XT/ktsE307vre8rEBungxQ==} + react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905: + resolution: {integrity: sha512-y0mHPgvO63liCvHHfDkDzDq+DjvNUMe0v0cliU8cGk3HrJIjzDHrdb2AbofWJXMsAcW6dCcw75frwtnv0nrs9g==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 webpack: 5.90.0 - react-server-dom-webpack@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-2r7481kcNjYtQ97f9fuVnT6YSPk4b6RCno+4UoBSKYDq1nCU/Ybj0b1O/68BqYGdpu5fYI0UVDrfI3ywWVuvbg==} + react-server-dom-webpack@19.0.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-HjAorv2VN997pifx7SN+e4U/ejCIzQ+c/uNJbjW4BLVFbHVzRlcjmT0UZTj5TNSApnQFANKOBFqZOUnQj8g0Kw==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 webpack: 5.90.0 react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-ssr-prepass@1.0.8: resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-is: 19.0.0-rc-a03254bc-20240905 react-style-singleton@2.2.1: resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -12717,30 +12717,30 @@ packages: react-test-renderer@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-virtualized@9.22.3: resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 - react@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-Jh40juQIRyTl4q5yH53JzVLCP5h5CcnDBgfcz8hYQTLvvKoxWFr5dR78mUIrc8IPInn8bcOconodGJaXYVqTSQ==} + react@0.0.0-experimental-a03254bc-20240905: + resolution: {integrity: sha512-ua3E8kKViKZQtP68Q0tAvpGLOgzJ+Hw1GsIsW9G/YtR6FZb4IqhNEphcgUcZJNMjjdFRUtKceCA+ZoPT3UVe+w==} engines: {node: '>=0.10.0'} react@17.0.2: resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} engines: {node: '>=0.10.0'} - react@19.0.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-Xg6LoxgPpT4efYHzRB2gUUQCoNXu2df3sOBRgiUvzTVT1qQNOV611/w80JiOmnTWlIyCaUfSkNrMG8OUO/D+AA==} + react@19.0.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-ZeZnU7zFU1eyjU6MwDc9f3H6iOS0MtY/e4zI8WNNkwKNjzajJaEqhumbgu8O9haEiPq9rV98QAPrQv4qwAgxeA==} engines: {node: '>=0.10.0'} react@19.0.0-rc-f90a6bcc-20240827: @@ -13266,11 +13266,11 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.0.0-experimental-7771d3a7-20240827: - resolution: {integrity: sha512-/5YtUIFqGx1aHcSLqT9VBmzJ1nX8XOYkooipvfwH4ZRYuGptkHypXx+FUO4caZoN0O29dI3yUBUk3msVp6wMyg==} + scheduler@0.0.0-experimental-a03254bc-20240905: + resolution: {integrity: sha512-RjOfVyx1MLGrjon5bVeE26cx/iray4C4GJa6cz5HKNZuJTloxh5Z97poT6oDZonCogLUhoZt8azpMqH0Zx3frQ==} - scheduler@0.25.0-rc-7771d3a7-20240827: - resolution: {integrity: sha512-n4nHmAoerbIOSrH24w0+fcdCUwQ4Npm7yXfsrn09FL01OWIaxpuo4P0rj3qPyLFgsJDbn18sWvLVB/e/KPnR+A==} + scheduler@0.25.0-rc-a03254bc-20240905: + resolution: {integrity: sha512-YAqLXn+WwogKpm3KdBTekXCTkbGzgeH3YwnrzMKurtT7f0CMYFSIp+sqQydlXAt/YQU7xYaedSWnlM/F2UaHQA==} schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -13844,8 +13844,8 @@ packages: engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -13859,7 +13859,7 @@ packages: peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@babel/core': optional: true @@ -13936,7 +13936,7 @@ packages: swr@2.2.4: resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 symbol-observable@1.0.1: resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} @@ -14674,7 +14674,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -14682,13 +14682,13 @@ packages: use-composed-ref@1.3.0: resolution: {integrity: sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 use-isomorphic-layout-effect@1.1.2: resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -14697,7 +14697,7 @@ packages: resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -14707,7 +14707,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 peerDependenciesMeta: '@types/react': optional: true @@ -14715,7 +14715,7 @@ packages: use-sync-external-store@1.2.0: resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 use@3.1.1: resolution: {integrity: sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==} @@ -17103,17 +17103,17 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/react@11.11.1(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0)': + '@emotion/react@11.11.1(react@19.0.0-rc-a03254bc-20240905)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-7771d3a7-20240827) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-a03254bc-20240905) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 hoist-non-react-statics: 3.3.2 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 optionalDependencies: '@types/react': types-react@19.0.0-rc.0 @@ -17129,9 +17129,9 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-7771d3a7-20240827)': + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-a03254bc-20240905)': dependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 '@emotion/utils@1.2.1': {} @@ -18491,11 +18491,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@2.2.1(react@19.0.0-rc-7771d3a7-20240827)': + '@mdx-js/react@2.2.1(react@19.0.0-rc-a03254bc-20240905)': dependencies: '@types/mdx': 2.0.3 '@types/react': types-react@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 '@mdx-js/react@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)': dependencies: @@ -19314,13 +19314,13 @@ snapshots: '@types/jest': 29.5.5 jest: 29.7.0(@types/node@20.12.3)(babel-plugin-macros@3.1.0) - '@testing-library/react@15.0.7(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(types-react@19.0.0-rc.0)': + '@testing-library/react@15.0.7(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@testing-library/dom': 10.1.0 '@types/react-dom': types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) optionalDependencies: '@types/react': types-react@19.0.0-rc.0 @@ -20568,7 +20568,7 @@ snapshots: transitivePeerDependencies: - supports-color - babel-plugin-react-compiler@0.0.0-experimental-7449567-20240904: + babel-plugin-react-compiler@0.0.0-experimental-7449567-20240905: dependencies: '@babel/generator': 7.2.0 '@babel/types': 7.22.5 @@ -24247,7 +24247,7 @@ snapshots: hoist-non-react-statics@3.3.2: dependencies: - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 homedir-polyfill@1.0.3: dependencies: @@ -28686,25 +28686,25 @@ snapshots: '@jest/types': 24.9.0 ansi-regex: 4.1.0 ansi-styles: 3.2.1 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 pretty-format@27.5.1: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 pretty-format@29.5.0: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 pretty-ms@7.0.0: dependencies: @@ -28761,7 +28761,7 @@ snapshots: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.0.0-rc-7771d3a7-20240827 + react-is: 19.0.0-rc-a03254bc-20240905 property-information@5.6.0: dependencies: @@ -28933,29 +28933,29 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dom@0.0.0-experimental-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827): + react-dom@0.0.0-experimental-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + scheduler: 0.25.0-rc-a03254bc-20240905 - react-dom@17.0.2(react@19.0.0-rc-7771d3a7-20240827): + react-dom@17.0.2(react@19.0.0-rc-a03254bc-20240905): dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + scheduler: 0.25.0-rc-a03254bc-20240905 - react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827): + react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + scheduler: 0.25.0-rc-a03254bc-20240905 react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827): dependencies: react: 19.0.0-rc-f90a6bcc-20240827 - scheduler: 0.25.0-rc-7771d3a7-20240827 + scheduler: 0.25.0-rc-a03254bc-20240905 - react-is@19.0.0-rc-7771d3a7-20240827: {} + react-is@19.0.0-rc-a03254bc-20240905: {} react-is@19.0.0-rc-f90a6bcc-20240827: {} @@ -28988,48 +28988,48 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-server-dom-turbopack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-server-dom-turbopack@0.0.0-experimental-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) - react-server-dom-turbopack@19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-server-dom-turbopack@19.0.0-rc-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) - react-server-dom-webpack@0.0.0-experimental-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@0.0.0-experimental-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-server-dom-webpack@19.0.0-rc-7771d3a7-20240827(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@19.0.0-rc-a03254bc-20240905(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-shallow-renderer@16.15.0(react@19.0.0-rc-7771d3a7-20240827): + react-shallow-renderer@16.15.0(react@19.0.0-rc-a03254bc-20240905): dependencies: object-assign: 4.1.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-is: 19.0.0-rc-a03254bc-20240905 - react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-7771d3a7-20240827): + react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-a03254bc-20240905): dependencies: object-is: 1.0.2 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 react-is: 19.0.0-rc-f90a6bcc-20240827 react-style-singleton@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): @@ -29041,12 +29041,12 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-test-renderer@18.2.0(react@19.0.0-rc-7771d3a7-20240827): + react-test-renderer@18.2.0(react@19.0.0-rc-a03254bc-20240905): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 - react-is: 19.0.0-rc-7771d3a7-20240827 - react-shallow-renderer: 16.15.0(react@19.0.0-rc-7771d3a7-20240827) - scheduler: 0.25.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 + react-is: 19.0.0-rc-a03254bc-20240905 + react-shallow-renderer: 16.15.0(react@19.0.0-rc-a03254bc-20240905) + scheduler: 0.25.0-rc-a03254bc-20240905 react-textarea-autosize@8.5.3(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): dependencies: @@ -29057,25 +29057,25 @@ snapshots: transitivePeerDependencies: - '@types/react' - react-virtualized@9.22.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + react-virtualized@9.22.3(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905): dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-7771d3a7-20240827: {} + react@0.0.0-experimental-a03254bc-20240905: {} react@17.0.2: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react@19.0.0-rc-7771d3a7-20240827: {} + react@19.0.0-rc-a03254bc-20240905: {} react@19.0.0-rc-f90a6bcc-20240827: {} @@ -29765,9 +29765,9 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.0.0-experimental-7771d3a7-20240827: {} + scheduler@0.0.0-experimental-a03254bc-20240905: {} - scheduler@0.25.0-rc-7771d3a7-20240827: {} + scheduler@0.25.0-rc-a03254bc-20240905: {} schema-utils@2.7.1: dependencies: @@ -30419,7 +30419,7 @@ snapshots: dependencies: inline-style-parser: 0.1.1 - styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827))(react@19.0.0-rc-7771d3a7-20240827): + styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905))(react@19.0.0-rc-a03254bc-20240905): dependencies: '@babel/cli': 7.21.5(@babel/core@7.22.5) '@babel/core': 7.22.5 @@ -30434,8 +30434,8 @@ snapshots: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.0.0-rc-7771d3a7-20240827 - react-dom: 19.0.0-rc-7771d3a7-20240827(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + react-dom: 19.0.0-rc-a03254bc-20240905(react@19.0.0-rc-a03254bc-20240905) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -30447,10 +30447,10 @@ snapshots: postcss: 7.0.32 postcss-load-plugins: 2.3.0 - styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-7771d3a7-20240827): + styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-a03254bc-20240905): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 optionalDependencies: '@babel/core': 7.22.5 babel-plugin-macros: 3.1.0 @@ -30540,11 +30540,11 @@ snapshots: picocolors: 1.0.1 stable: 0.1.8 - swr@2.2.4(react@19.0.0-rc-7771d3a7-20240827): + swr@2.2.4(react@19.0.0-rc-a03254bc-20240905): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-7771d3a7-20240827 - use-sync-external-store: 1.2.0(react@19.0.0-rc-7771d3a7-20240827) + react: 19.0.0-rc-a03254bc-20240905 + use-sync-external-store: 1.2.0(react@19.0.0-rc-a03254bc-20240905) symbol-observable@1.0.1: {} @@ -31229,9 +31229,9 @@ snapshots: unist-util-is: 5.2.0 unist-util-visit-parents: 5.1.3 - unistore@3.4.1(react@19.0.0-rc-7771d3a7-20240827): + unistore@3.4.1(react@19.0.0-rc-a03254bc-20240905): optionalDependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 universal-github-app-jwt@1.1.1: dependencies: @@ -31356,9 +31356,9 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - use-sync-external-store@1.2.0(react@19.0.0-rc-7771d3a7-20240827): + use-sync-external-store@1.2.0(react@19.0.0-rc-a03254bc-20240905): dependencies: - react: 19.0.0-rc-7771d3a7-20240827 + react: 19.0.0-rc-a03254bc-20240905 use@3.1.1: {} From ca044ca76a0d49f6f2c244337195c6611ae74731 Mon Sep 17 00:00:00 2001 From: vercel-release-bot Date: Fri, 6 Sep 2024 16:25:36 +0000 Subject: [PATCH 5/5] ncc-compiled --- .../cjs/react-dom-client.development.js | 3381 +++++++++-------- .../cjs/react-dom-client.production.js | 1940 +++++----- .../cjs/react-dom-profiling.development.js | 3381 +++++++++-------- .../cjs/react-dom-profiling.profiling.js | 2449 ++++++------ ...t-dom-server-legacy.browser.development.js | 2 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 2 +- ...react-dom-server-legacy.node.production.js | 2 +- .../react-dom-server.browser.development.js | 6 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 6 +- .../cjs/react-dom-server.edge.development.js | 6 +- .../cjs/react-dom-server.edge.production.js | 6 +- .../cjs/react-dom-server.node.development.js | 6 +- .../cjs/react-dom-server.node.production.js | 6 +- .../react-dom-unstable_testing.development.js | 3381 +++++++++-------- .../react-dom-unstable_testing.production.js | 1940 +++++----- .../cjs/react-dom.development.js | 2 +- .../cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../react-dom-experimental/package.json | 4 +- .../cjs/react-dom-client.development.js | 3333 ++++++++-------- .../cjs/react-dom-client.production.js | 1869 ++++----- .../cjs/react-dom-profiling.development.js | 3333 ++++++++-------- .../cjs/react-dom-profiling.profiling.js | 2340 ++++++------ ...t-dom-server-legacy.browser.development.js | 2 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 2 +- ...react-dom-server-legacy.node.production.js | 2 +- .../react-dom-server.browser.development.js | 6 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 6 +- .../cjs/react-dom-server.edge.development.js | 6 +- .../cjs/react-dom-server.edge.production.js | 6 +- .../cjs/react-dom-server.node.development.js | 6 +- .../cjs/react-dom-server.node.production.js | 6 +- .../react-dom/cjs/react-dom.development.js | 2 +- .../react-dom/cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../next/src/compiled/react-dom/package.json | 4 +- .../cjs/react.development.js | 2 +- .../cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/react-is/package.json | 2 +- .../package.json | 4 +- ...om-turbopack-server.browser.development.js | 216 +- ...r-dom-turbopack-server.edge.development.js | 226 +- ...r-dom-turbopack-server.node.development.js | 217 +- .../react-server-dom-turbopack/package.json | 4 +- .../package.json | 4 +- ...-dom-webpack-server.browser.development.js | 216 +- ...ver-dom-webpack-server.edge.development.js | 226 +- ...ver-dom-webpack-server.node.development.js | 217 +- ...bpack-server.node.unbundled.development.js | 217 +- .../react-server-dom-webpack/package.json | 4 +- .../compiled/react/cjs/react.development.js | 2 +- .../compiled/react/cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/unistore/unistore.js | 2 +- 63 files changed, 15391 insertions(+), 13651 deletions(-) diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 5b1d8511cab05..f134653370330 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -1094,28 +1094,37 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -1194,6 +1203,7 @@ root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -3998,6 +4008,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5855,6 +5920,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -7333,60 +7406,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8028,8 +8169,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8258,8 +8399,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8695,33 +8836,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2306; - var JSCompiler_object_inline_stack_2305 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2292; + var JSCompiler_object_inline_stack_2291 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2303 = !1; + var JSCompiler_object_inline_message_2289 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2306 = didSuspend) || - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2292 = didSuspend) || + (JSCompiler_object_inline_componentStack_2292 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2306 && - ((JSCompiler_object_inline_message_2303 = !0), + JSCompiler_object_inline_componentStack_2292 && + ((JSCompiler_object_inline_message_2289 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2306 = + JSCompiler_object_inline_componentStack_2292 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2289 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2304 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2290 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2304)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2290)) { c: { - var instance = JSCompiler_object_inline_digest_2304; + var instance = JSCompiler_object_inline_digest_2290; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8762,19 +8903,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2290 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2304 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2290 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_digest_2304.dehydrated), - null !== JSCompiler_object_inline_digest_2304) + null !== JSCompiler_object_inline_digest_2290 && + ((JSCompiler_object_inline_digest_2290 = + JSCompiler_object_inline_digest_2290.dehydrated), + null !== JSCompiler_object_inline_digest_2290) ) return ( - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2290.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8782,68 +8923,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_stack_2305.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2305.fallback; - if (JSCompiler_object_inline_message_2303) + JSCompiler_object_inline_digest_2290 = + JSCompiler_object_inline_stack_2291.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2291.fallback; + if (JSCompiler_object_inline_message_2289) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_stack_2291 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2290, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_message_2303.memoizedState = + (JSCompiler_object_inline_message_2289 = workInProgress.child), + (JSCompiler_object_inline_message_2289.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2289.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2292, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2291 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2305.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2291.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_stack_2291 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2290, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_message_2303.memoizedState = + (JSCompiler_object_inline_message_2289 = workInProgress.child), + (JSCompiler_object_inline_message_2289.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2289.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2292, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2291 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2290 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2304 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2304) + ((JSCompiler_object_inline_digest_2290 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2290) ) { if (didSuspend) workInProgress.flags & 256 @@ -8860,94 +9001,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_digest_2304 = workInProgress.mode), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_message_2289 = + JSCompiler_object_inline_stack_2291.fallback), + (JSCompiler_object_inline_digest_2290 = workInProgress.mode), + (JSCompiler_object_inline_stack_2291 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2291.children }, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_digest_2290 )), - (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_message_2289 = createFiberFromFragment( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_message_2289, + JSCompiler_object_inline_digest_2290, renderLanes, null )), - (JSCompiler_object_inline_message_2303.flags |= 2), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_message_2303), - (workInProgress.child = JSCompiler_object_inline_stack_2305), + (JSCompiler_object_inline_message_2289.flags |= 2), + (JSCompiler_object_inline_stack_2291.return = workInProgress), + (JSCompiler_object_inline_message_2289.return = workInProgress), + (JSCompiler_object_inline_stack_2291.sibling = + JSCompiler_object_inline_message_2289), + (workInProgress.child = JSCompiler_object_inline_stack_2291), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2305 = workInProgress.child), - (JSCompiler_object_inline_stack_2305.memoizedState = + (JSCompiler_object_inline_stack_2291 = workInProgress.child), + (JSCompiler_object_inline_stack_2291.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2305.childLanes = + (JSCompiler_object_inline_stack_2291.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2292, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2303)); + (workInProgress = JSCompiler_object_inline_message_2289)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2290.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_digest_2304.nextSibling && - JSCompiler_object_inline_digest_2304.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2306) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2306.dgst; - var message = JSCompiler_object_inline_componentStack_2306.msg; - instance = JSCompiler_object_inline_componentStack_2306.stck; + JSCompiler_object_inline_componentStack_2292 = + JSCompiler_object_inline_digest_2290.nextSibling && + JSCompiler_object_inline_digest_2290.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2292) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2292.dgst; + var message = JSCompiler_object_inline_componentStack_2292.msg; + instance = JSCompiler_object_inline_componentStack_2292.stck; var componentStack = - JSCompiler_object_inline_componentStack_2306.cstck; + JSCompiler_object_inline_componentStack_2292.cstck; } - JSCompiler_object_inline_message_2303 = message; - JSCompiler_object_inline_digest_2304 = JSCompiler_temp; - JSCompiler_object_inline_stack_2305 = instance; - JSCompiler_object_inline_componentStack_2306 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303 - ? Error(JSCompiler_object_inline_message_2303) + JSCompiler_object_inline_message_2289 = message; + JSCompiler_object_inline_digest_2290 = JSCompiler_temp; + JSCompiler_object_inline_stack_2291 = instance; + JSCompiler_object_inline_componentStack_2292 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2290 && + ((JSCompiler_object_inline_message_2289 = + JSCompiler_object_inline_message_2289 + ? Error(JSCompiler_object_inline_message_2289) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2303.stack = - JSCompiler_object_inline_stack_2305 || ""), - (JSCompiler_object_inline_message_2303.digest = - JSCompiler_object_inline_digest_2304), - (JSCompiler_object_inline_componentStack_2306 = - void 0 === JSCompiler_object_inline_componentStack_2306 + (JSCompiler_object_inline_message_2289.stack = + JSCompiler_object_inline_stack_2291 || ""), + (JSCompiler_object_inline_message_2289.digest = + JSCompiler_object_inline_digest_2290), + (JSCompiler_object_inline_componentStack_2292 = + void 0 === JSCompiler_object_inline_componentStack_2292 ? null - : JSCompiler_object_inline_componentStack_2306), - "string" === typeof JSCompiler_object_inline_componentStack_2306 && + : JSCompiler_object_inline_componentStack_2292), + "string" === typeof JSCompiler_object_inline_componentStack_2292 && CapturedStacks.set( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_message_2289, + JSCompiler_object_inline_componentStack_2292 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2303, + value: JSCompiler_object_inline_message_2289, source: null, - stack: JSCompiler_object_inline_componentStack_2306 + stack: JSCompiler_object_inline_componentStack_2292 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8962,25 +9103,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2292 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2306) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2292) ) { - JSCompiler_object_inline_componentStack_2306 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2306) { - JSCompiler_object_inline_stack_2305 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2305 & 42)) - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_componentStack_2292 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2292) { + JSCompiler_object_inline_stack_2291 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2291 & 42)) + JSCompiler_object_inline_stack_2291 = 1; else - switch (JSCompiler_object_inline_stack_2305) { + switch (JSCompiler_object_inline_stack_2291) { case 2: - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_stack_2291 = 1; break; case 8: - JSCompiler_object_inline_stack_2305 = 4; + JSCompiler_object_inline_stack_2291 = 4; break; case 32: - JSCompiler_object_inline_stack_2305 = 16; + JSCompiler_object_inline_stack_2291 = 16; break; case 128: case 256: @@ -9001,40 +9142,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2305 = 64; + JSCompiler_object_inline_stack_2291 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2305 = 134217728; + JSCompiler_object_inline_stack_2291 = 134217728; break; default: - JSCompiler_object_inline_stack_2305 = 0; + JSCompiler_object_inline_stack_2291 = 0; } - JSCompiler_object_inline_stack_2305 = + JSCompiler_object_inline_stack_2291 = 0 !== - (JSCompiler_object_inline_stack_2305 & - (JSCompiler_object_inline_componentStack_2306.suspendedLanes | + (JSCompiler_object_inline_stack_2291 & + (JSCompiler_object_inline_componentStack_2292.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2305; + : JSCompiler_object_inline_stack_2291; if ( - 0 !== JSCompiler_object_inline_stack_2305 && - JSCompiler_object_inline_stack_2305 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2291 && + JSCompiler_object_inline_stack_2291 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2305), + ((prevState.retryLane = JSCompiler_object_inline_stack_2291), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2291 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2292, current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2291 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2290.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9042,7 +9183,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2304.data === + JSCompiler_object_inline_digest_2290.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9050,12 +9191,12 @@ null, current )), - (JSCompiler_object_inline_digest_2304._reactRetry = + (JSCompiler_object_inline_digest_2290._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2304.nextSibling + JSCompiler_object_inline_digest_2290.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9073,54 +9214,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2305.children + JSCompiler_object_inline_stack_2291.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2303) + if (JSCompiler_object_inline_message_2289) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_digest_2304 = workInProgress.mode), + (JSCompiler_object_inline_message_2289 = + JSCompiler_object_inline_stack_2291.fallback), + (JSCompiler_object_inline_digest_2290 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2305 = createWorkInProgress( + (JSCompiler_object_inline_stack_2291 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2291.children } )), - (JSCompiler_object_inline_stack_2305.subtreeFlags = + (JSCompiler_object_inline_stack_2291.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2303 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2289 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2289 )) - : ((JSCompiler_object_inline_message_2303 = createFiberFromFragment( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304, + : ((JSCompiler_object_inline_message_2289 = createFiberFromFragment( + JSCompiler_object_inline_message_2289, + JSCompiler_object_inline_digest_2290, renderLanes, null )), - (JSCompiler_object_inline_message_2303.flags |= 2)), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_message_2303), - (workInProgress.child = JSCompiler_object_inline_stack_2305), - (JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_message_2303 = workInProgress.child), - (JSCompiler_object_inline_digest_2304 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2304 - ? (JSCompiler_object_inline_digest_2304 = + (JSCompiler_object_inline_message_2289.flags |= 2)), + (JSCompiler_object_inline_message_2289.return = workInProgress), + (JSCompiler_object_inline_stack_2291.return = workInProgress), + (JSCompiler_object_inline_stack_2291.sibling = + JSCompiler_object_inline_message_2289), + (workInProgress.child = JSCompiler_object_inline_stack_2291), + (JSCompiler_object_inline_stack_2291 = + JSCompiler_object_inline_message_2289), + (JSCompiler_object_inline_message_2289 = workInProgress.child), + (JSCompiler_object_inline_digest_2290 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2290 + ? (JSCompiler_object_inline_digest_2290 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2304.cachePool), + JSCompiler_object_inline_digest_2290.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9128,38 +9269,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2304 = { + (JSCompiler_object_inline_digest_2290 = { baseLanes: - JSCompiler_object_inline_digest_2304.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2290.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2303.memoizedState = - JSCompiler_object_inline_digest_2304), - (JSCompiler_object_inline_message_2303.childLanes = + (JSCompiler_object_inline_message_2289.memoizedState = + JSCompiler_object_inline_digest_2290), + (JSCompiler_object_inline_message_2289.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2306, + JSCompiler_object_inline_componentStack_2292, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2291 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2291.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2306 = + ((JSCompiler_object_inline_componentStack_2292 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2306 + null === JSCompiler_object_inline_componentStack_2292 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2306.push(current)); + : JSCompiler_object_inline_componentStack_2292.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10444,7 +10585,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10733,6 +10878,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10743,128 +10898,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10872,101 +11441,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11040,351 +11514,98 @@ selectionRange: JSCompiler_temp }; _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((firstChild = nextEffect), + (root = firstChild.child), + 0 !== (firstChild.subtreeFlags & 1028) && null !== root) + ) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11400,17 +11621,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11424,21 +11655,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11446,11 +11681,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11466,59 +11697,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11526,11 +11762,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11540,11 +11772,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11567,78 +11795,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11718,14 +11874,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11771,7 +11950,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11781,14 +11962,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11856,7 +12041,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11905,74 +12094,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11980,53 +12148,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$10 - ); - } - } + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, + finishedWork, + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12043,116 +12189,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12161,9 +12309,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12178,117 +12326,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12297,23 +12413,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12321,7 +12440,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12330,13 +12449,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12346,12 +12465,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12367,15 +12486,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12383,13 +12502,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12398,47 +12517,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12469,7 +12587,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12480,7 +12598,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12488,52 +12606,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12553,27 +12626,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12656,24 +12715,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12690,7 +12753,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12699,9 +12762,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12738,9 +12825,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12748,22 +12833,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12794,9 +12863,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12843,9 +12910,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12854,18 +12921,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12909,9 +12974,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12944,9 +13007,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12956,11 +13019,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12998,62 +13059,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13114,25 +13158,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13149,11 +13174,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13197,7 +13218,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13227,22 +13248,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13255,31 +13291,6 @@ } } } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -13359,7 +13370,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13412,7 +13424,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13634,13 +13647,26 @@ (resource.state.loading & Inserted) !== NotLoaded ) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if ( + ((workInProgress.flags |= 16777216), !preloadResource(resource)) + ) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -14445,7 +14471,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14487,7 +14514,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14512,7 +14540,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14544,7 +14577,12 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -14560,7 +14598,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14594,7 +14633,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14606,7 +14646,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14619,7 +14660,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14674,7 +14716,8 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14693,7 +14736,7 @@ didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14741,26 +14784,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14790,13 +14838,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14849,6 +14902,12 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressDeferredLane = @@ -14885,12 +14944,7 @@ current = null; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? SuspendedOnData - : SuspendedOnImmediate)) + (workInProgressSuspendedReason = SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = SuspendedOnInstance)) @@ -14941,21 +14995,6 @@ ); } } - function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; - } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -14974,7 +15013,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15029,8 +15069,8 @@ } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15170,8 +15210,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15296,43 +15336,25 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || workInProgressSuspendedReason === SuspendedOnError + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15366,6 +15388,38 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, @@ -15569,55 +15623,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15763,6 +15802,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -19221,6 +19261,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19244,6 +19316,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19444,6 +19537,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19482,6 +19581,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20198,6 +20328,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22242,6 +22373,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23824,84 +23962,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23969,6 +24037,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23988,7 +24119,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24039,6 +24170,8 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24615,11 +24748,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24656,11 +24789,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24804,7 +24937,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index 1cf7cbe835a8d..e125a22876331 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -597,28 +597,37 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -689,6 +698,7 @@ function markRootFinished(root, remainingLanes, spawnedLane) { root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -700,18 +710,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -731,10 +741,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -884,8 +894,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$9 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$9 && "aria-" !== prefix$9) { + var prefix$10 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$10 && "aria-" !== prefix$10) { node.removeAttribute(name); return; } @@ -1218,15 +1228,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$15 in styles) - (styleName = styles[styleName$15]), - styles.hasOwnProperty(styleName$15) && - prevStyles[styleName$15] !== styleName && - setValueForStyle(node, styleName$15, styleName); - } else for (var styleName$16 in styles) - styles.hasOwnProperty(styleName$16) && - setValueForStyle(node, styleName$16, styles[styleName$16]); + (styleName = styles[styleName$16]), + styles.hasOwnProperty(styleName$16) && + prevStyles[styleName$16] !== styleName && + setValueForStyle(node, styleName$16, styleName); + } else + for (var styleName$17 in styles) + styles.hasOwnProperty(styleName$17) && + setValueForStyle(node, styleName$17, styles[styleName$17]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1955,19 +1965,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$290; + var JSCompiler_inline_result$jscomp$283; if (canUseDOM) { - var isSupported$jscomp$inline_425 = "oninput" in document; - if (!isSupported$jscomp$inline_425) { - var element$jscomp$inline_426 = document.createElement("div"); - element$jscomp$inline_426.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_425 = - "function" === typeof element$jscomp$inline_426.oninput; + var isSupported$jscomp$inline_418 = "oninput" in document; + if (!isSupported$jscomp$inline_418) { + var element$jscomp$inline_419 = document.createElement("div"); + element$jscomp$inline_419.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_418 = + "function" === typeof element$jscomp$inline_419.oninput; } - JSCompiler_inline_result$jscomp$290 = isSupported$jscomp$inline_425; - } else JSCompiler_inline_result$jscomp$290 = !1; + JSCompiler_inline_result$jscomp$283 = isSupported$jscomp$inline_418; + } else JSCompiler_inline_result$jscomp$283 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$290 && + JSCompiler_inline_result$jscomp$283 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3901,7 +3911,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$54 = !1; + didReadFromEntangledAsyncAction$55 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3922,11 +3932,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); continue; } else (updateLane = { @@ -3972,7 +3982,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4170,8 +4180,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$60) { - onActionError(actionQueue, node, error$60); + } catch (error$61) { + onActionError(actionQueue, node, error$61); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4609,14 +4619,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$63 = enqueueUpdate(provider, fiber, lane); - null !== root$63 && - (scheduleUpdateOnFiber(root$63, provider, lane), - entangleTransitions(root$63, provider, lane)); + var root$64 = enqueueUpdate(provider, fiber, lane); + null !== root$64 && + (scheduleUpdateOnFiber(root$64, provider, lane), + entangleTransitions(root$64, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$63 && + null !== root$64 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5043,6 +5053,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5085,9 +5197,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -5098,9 +5210,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$68) { + } catch (e$70) { setTimeout(function () { - throw e$68; + throw e$70; }); } } @@ -7440,113 +7552,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$112 in Component) - void 0 === newProps[propName$112] && - (newProps[propName$112] = Component[propName$112]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7602,8 +7666,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$113) { - captureCommitPhaseError(current, nearestMountedAncestor, error$113); + } catch (error$115) { + captureCommitPhaseError(current, nearestMountedAncestor, error$115); } else ref.current = null; } @@ -7614,32 +7678,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode; + selection = selection.focusOffset; + try { + JSCompiler_temp.nodeType, focusNode.nodeType; + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7695,69 +7863,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7767,85 +7948,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7854,7 +7959,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7877,11 +7982,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } } @@ -7915,11 +8020,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7973,75 +8095,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -8089,8 +8142,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8099,35 +8156,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$123 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$123; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8156,18 +8233,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$123 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$123 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$123 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8273,39 +8350,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8323,19 +8396,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8360,56 +8424,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8417,36 +8480,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8454,16 +8517,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8478,64 +8541,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$128) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$128 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8544,24 +8606,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$131) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$131); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8570,12 +8629,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8589,8 +8648,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$133) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$133); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8621,15 +8680,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8637,13 +8696,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8652,45 +8711,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$117) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$117 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8740,11 +8798,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8757,21 +8815,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$118 = JSCompiler_inline_result.stateNode; + var parent$116 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$118, ""), + (setTextContent(parent$116, ""), (JSCompiler_inline_result.flags &= -33)); - var before$119 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$119, parent$118); + var before$117 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$117, parent$116); break; case 3: case 4: - var parent$120 = JSCompiler_inline_result.stateNode.containerInfo, - before$121 = getHostSibling(finishedWork); + var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, + before$119 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$121, - parent$120 + before$119, + parent$118 ); break; default: @@ -8860,7 +8918,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8868,23 +8926,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8902,7 +8967,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8911,6 +8976,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -8941,13 +9023,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9003,7 +9078,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -9100,7 +9175,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9618,13 +9693,24 @@ function markUpdate(workInProgress) { function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4)) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -9649,14 +9735,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$143 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$143 = lastTailNode), + for (var lastTailNode$136 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$136 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$143 + null === lastTailNode$136 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$143.sibling = null); + : (lastTailNode$136.sibling = null); } } function bubbleProperties(completedWork) { @@ -9666,19 +9752,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags & 31457280), - (subtreeFlags |= child$144.flags & 31457280), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (var child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags & 31457280), + (subtreeFlags |= child$137.flags & 31457280), + (child$137.return = completedWork), + (child$137 = child$137.sibling); else - for (child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags), - (subtreeFlags |= child$144.flags), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags), + (subtreeFlags |= child$137.flags), + (child$137.return = completedWork), + (child$137 = child$137.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -9955,11 +10041,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$149 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$149 = newProps.memoizedState.cachePool.pool); + cache$149 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -9984,8 +10070,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$149 = type.rendering; + if (null === cache$149) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -9993,11 +10079,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$149 = findFirstSuspended(current); + if (null !== cache$149) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$149.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10022,7 +10108,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$149)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10032,7 +10118,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$149.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10045,13 +10131,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$149.sibling = workInProgress.child), + (workInProgress.child = cache$149)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$149) + : (workInProgress.child = cache$149), + (type.last = cache$149)); } if (null !== type.tail) return ( @@ -10224,6 +10310,8 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10274,7 +10362,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10285,7 +10374,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10307,7 +10397,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10339,7 +10435,12 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -10355,7 +10456,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10377,7 +10479,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10389,7 +10492,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10402,7 +10506,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10454,7 +10559,8 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10473,7 +10579,7 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10521,25 +10627,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -10566,13 +10675,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10625,6 +10739,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & lanes); workInProgressRootDidAttachPingListener = !1; workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -10643,9 +10761,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10657,12 +10775,7 @@ function handleThrow(root, thrownValue) { ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 2 - : 3)) + (workInProgressSuspendedReason = 3)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = 4)) @@ -10682,21 +10795,6 @@ function handleThrow(root, thrownValue) { createCapturedValueAtFiber(thrownValue, root.current) )); } -function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; -} function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -10715,7 +10813,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -10754,8 +10853,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$171) { - handleThrow(root, thrownValue$171); + } catch (thrownValue$164) { + handleThrow(root, thrownValue$164); } while (1); lanes && root.shellSuspendCounter++; @@ -10864,8 +10963,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$173) { - handleThrow(root, thrownValue$173); + } catch (thrownValue$166) { + handleThrow(root, thrownValue$166); } while (1); resetContextDependencies(); @@ -10957,31 +11056,25 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || 1 === workInProgressSuspendedReason + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -11001,6 +11094,29 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, @@ -11123,7 +11239,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$177 = rootWithPendingPassiveEffects, + var root$170 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11162,7 +11278,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$177, remainingLanes); + releaseRootPooledCache(root$170, remainingLanes); } } return !1; @@ -11233,6 +11349,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11318,14 +11435,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$179 = firstScheduledRoot; null !== root$179; ) { + for (var root$172 = firstScheduledRoot; null !== root$172; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$179.pendingLanes; + var pendingLanes = root$172.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$179.suspendedLanes, - pingedLanes = root$179.pingedLanes; + var suspendedLanes = root$172.suspendedLanes, + pingedLanes = root$172.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11339,17 +11456,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$172, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$179, - root$179 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$172, + root$172 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$179, JSCompiler_inline_result)); - root$179 = root$179.next; + performSyncWorkOnRoot(root$172, JSCompiler_inline_result)); + root$172 = root$172.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11390,12 +11507,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11559,20 +11676,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1388 = 0; - i$jscomp$inline_1388 < simpleEventPluginEvents.length; - i$jscomp$inline_1388++ + var i$jscomp$inline_1403 = 0; + i$jscomp$inline_1403 < simpleEventPluginEvents.length; + i$jscomp$inline_1403++ ) { - var eventName$jscomp$inline_1389 = - simpleEventPluginEvents[i$jscomp$inline_1388], - domEventName$jscomp$inline_1390 = - eventName$jscomp$inline_1389.toLowerCase(), - capitalizedEvent$jscomp$inline_1391 = - eventName$jscomp$inline_1389[0].toUpperCase() + - eventName$jscomp$inline_1389.slice(1); + var eventName$jscomp$inline_1404 = + simpleEventPluginEvents[i$jscomp$inline_1403], + domEventName$jscomp$inline_1405 = + eventName$jscomp$inline_1404.toLowerCase(), + capitalizedEvent$jscomp$inline_1406 = + eventName$jscomp$inline_1404[0].toUpperCase() + + eventName$jscomp$inline_1404.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1390, - "on" + capitalizedEvent$jscomp$inline_1391 + domEventName$jscomp$inline_1405, + "on" + capitalizedEvent$jscomp$inline_1406 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -12755,34 +12872,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$193 = props[hasSrc]; - if (null != propValue$193) + var propValue$186 = props[hasSrc]; + if (null != propValue$186) switch (hasSrc) { case "name": - hasSrcSet = propValue$193; + hasSrcSet = propValue$186; break; case "type": - propValue = propValue$193; + propValue = propValue$186; break; case "checked": - checked = propValue$193; + checked = propValue$186; break; case "defaultChecked": - defaultChecked = propValue$193; + defaultChecked = propValue$186; break; case "value": - propKey = propValue$193; + propKey = propValue$186; break; case "defaultValue": - defaultValue = propValue$193; + defaultValue = propValue$186; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$193) + if (null != propValue$186) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$193, props, null); + setProp(domElement, tag, hasSrc, propValue$186, props, null); } } initInput( @@ -12919,14 +13036,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$193 in props) - props.hasOwnProperty(propValue$193) && - ((hasSrc = props[propValue$193]), + for (propValue$186 in props) + props.hasOwnProperty(propValue$186) && + ((hasSrc = props[propValue$186]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$193, + propValue$186, hasSrc, props, void 0 @@ -12974,14 +13091,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$210 in nextProps) { - var propKey = nextProps[propKey$210]; - lastProp = lastProps[propKey$210]; + for (var propKey$203 in nextProps) { + var propKey = nextProps[propKey$203]; + lastProp = lastProps[propKey$203]; if ( - nextProps.hasOwnProperty(propKey$210) && + nextProps.hasOwnProperty(propKey$203) && (null != propKey || null != lastProp) ) - switch (propKey$210) { + switch (propKey$203) { case "type": type = propKey; break; @@ -13010,7 +13127,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$210, + propKey$203, propKey, nextProps, lastProp @@ -13029,7 +13146,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$210 = null; + propKey = value = defaultValue = propKey$203 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13060,7 +13177,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$210 = type; + propKey$203 = type; break; case "defaultValue": defaultValue = type; @@ -13081,15 +13198,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$210 - ? updateOptions(domElement, !!lastProps, propKey$210, !1) + null != propKey$203 + ? updateOptions(domElement, !!lastProps, propKey$203, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$210 = null; + propKey = propKey$203 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13113,7 +13230,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$210 = name; + propKey$203 = name; break; case "defaultValue": propKey = name; @@ -13127,17 +13244,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$210, propKey); + updateTextarea(domElement, propKey$203, propKey); return; case "option": - for (var propKey$226 in lastProps) + for (var propKey$219 in lastProps) if ( - ((propKey$210 = lastProps[propKey$226]), - lastProps.hasOwnProperty(propKey$226) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$226)) + ((propKey$203 = lastProps[propKey$219]), + lastProps.hasOwnProperty(propKey$219) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$219)) ) - switch (propKey$226) { + switch (propKey$219) { case "selected": domElement.selected = !1; break; @@ -13145,33 +13262,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$226, + propKey$219, null, nextProps, - propKey$210 + propKey$203 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$210 = nextProps[lastDefaultValue]), + ((propKey$203 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$203 !== propKey && + (null != propKey$203 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$210 && - "function" !== typeof propKey$210 && - "symbol" !== typeof propKey$210; + propKey$203 && + "function" !== typeof propKey$203 && + "symbol" !== typeof propKey$203; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$210, + propKey$203, nextProps, propKey ); @@ -13192,24 +13309,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$231 in lastProps) - (propKey$210 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$231) && - setProp(domElement, tag, propKey$231, null, nextProps, propKey$210); + for (var propKey$224 in lastProps) + (propKey$203 = lastProps[propKey$224]), + lastProps.hasOwnProperty(propKey$224) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$224) && + setProp(domElement, tag, propKey$224, null, nextProps, propKey$203); for (checked in nextProps) if ( - ((propKey$210 = nextProps[checked]), + ((propKey$203 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$210 !== propKey && - (null != propKey$210 || null != propKey)) + propKey$203 !== propKey && + (null != propKey$203 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$210) + if (null != propKey$203) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13217,7 +13334,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$210, + propKey$203, nextProps, propKey ); @@ -13225,49 +13342,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$236 in lastProps) - (propKey$210 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - void 0 !== propKey$210 && - !nextProps.hasOwnProperty(propKey$236) && + for (var propKey$229 in lastProps) + (propKey$203 = lastProps[propKey$229]), + lastProps.hasOwnProperty(propKey$229) && + void 0 !== propKey$203 && + !nextProps.hasOwnProperty(propKey$229) && setPropOnCustomElement( domElement, tag, - propKey$236, + propKey$229, void 0, nextProps, - propKey$210 + propKey$203 ); for (defaultChecked in nextProps) - (propKey$210 = nextProps[defaultChecked]), + (propKey$203 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$210 === propKey || - (void 0 === propKey$210 && void 0 === propKey) || + propKey$203 === propKey || + (void 0 === propKey$203 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$210, + propKey$203, nextProps, propKey ); return; } } - for (var propKey$241 in lastProps) - (propKey$210 = lastProps[propKey$241]), - lastProps.hasOwnProperty(propKey$241) && - null != propKey$210 && - !nextProps.hasOwnProperty(propKey$241) && - setProp(domElement, tag, propKey$241, null, nextProps, propKey$210); + for (var propKey$234 in lastProps) + (propKey$203 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && + null != propKey$203 && + !nextProps.hasOwnProperty(propKey$234) && + setProp(domElement, tag, propKey$234, null, nextProps, propKey$203); for (lastProp in nextProps) - (propKey$210 = nextProps[lastProp]), + (propKey$203 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$210 === propKey || - (null == propKey$210 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$210, nextProps, propKey); + propKey$203 === propKey || + (null == propKey$203 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$203, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -13812,26 +13929,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$249 = getResourcesFromRoot( + var styles$242 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$250 = styles$249.get(type); - resource$250 || + resource$243 = styles$242.get(type); + resource$243 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$250 = { + (resource$243 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$249.set(type, resource$250), - (styles$249 = JSCompiler_inline_result.querySelector( + styles$242.set(type, resource$243), + (styles$242 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$249._p && - ((resource$250.instance = styles$249), - (resource$250.state.loading = 5)), + !styles$242._p && + ((resource$243.instance = styles$242), + (resource$243.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -13844,16 +13961,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$249 || + styles$242 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$250.state + resource$243.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$250; + return resource$243; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -13950,37 +14067,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$255 = hoistableRoot.querySelector( + var instance$248 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$255) + if (instance$248) return ( (resource.state.loading |= 4), - (resource.instance = instance$255), - markNodeAsHoistable(instance$255), - instance$255 + (resource.instance = instance$248), + markNodeAsHoistable(instance$248), + instance$248 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$255 = ( + instance$248 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$255); - var linkInstance = instance$255; + markNodeAsHoistable(instance$248); + var linkInstance = instance$248; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$255, "link", instance); + setInitialProperties(instance$248, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$255, props.precedence, hoistableRoot); - return (resource.instance = instance$255); + insertStylesheet(instance$248, props.precedence, hoistableRoot); + return (resource.instance = instance$248); case "script": - instance$255 = getScriptKey(props.src); + instance$248 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$255) + getScriptSelectorFromKey(instance$248) )) ) return ( @@ -13989,7 +14106,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$255))) + if ((styleProps = preloadPropsMap.get(instance$248))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14312,6 +14429,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15012,16 +15130,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1635 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1650 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1635 + "19.0.0-experimental-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1650 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1635, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1650, + "19.0.0-experimental-a03254bc-20240905" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15041,25 +15159,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2043 = { +var internals$jscomp$inline_2091 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2044 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2092 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2044.isDisabled && - hook$jscomp$inline_2044.supportsFiber + !hook$jscomp$inline_2092.isDisabled && + hook$jscomp$inline_2092.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2044.inject( - internals$jscomp$inline_2043 + (rendererID = hook$jscomp$inline_2092.inject( + internals$jscomp$inline_2091 )), - (injectedHook = hook$jscomp$inline_2044); + (injectedHook = hook$jscomp$inline_2092); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15151,4 +15269,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index f51edc5ffb27b..61f05afa82f52 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -1102,28 +1102,37 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -1202,6 +1211,7 @@ root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -4006,6 +4016,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5863,6 +5928,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -7341,60 +7414,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8036,8 +8177,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8266,8 +8407,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8703,33 +8844,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2311; - var JSCompiler_object_inline_stack_2310 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2297; + var JSCompiler_object_inline_stack_2296 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2308 = !1; + var JSCompiler_object_inline_message_2294 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2311 = didSuspend) || - (JSCompiler_object_inline_componentStack_2311 = + (JSCompiler_object_inline_componentStack_2297 = didSuspend) || + (JSCompiler_object_inline_componentStack_2297 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2311 && - ((JSCompiler_object_inline_message_2308 = !0), + JSCompiler_object_inline_componentStack_2297 && + ((JSCompiler_object_inline_message_2294 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2311 = + JSCompiler_object_inline_componentStack_2297 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2308 + JSCompiler_object_inline_message_2294 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2309 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2295 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2309)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2295)) { c: { - var instance = JSCompiler_object_inline_digest_2309; + var instance = JSCompiler_object_inline_digest_2295; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8770,19 +8911,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2295 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2309 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2295 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2309 && - ((JSCompiler_object_inline_digest_2309 = - JSCompiler_object_inline_digest_2309.dehydrated), - null !== JSCompiler_object_inline_digest_2309) + null !== JSCompiler_object_inline_digest_2295 && + ((JSCompiler_object_inline_digest_2295 = + JSCompiler_object_inline_digest_2295.dehydrated), + null !== JSCompiler_object_inline_digest_2295) ) return ( - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2295.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8790,68 +8931,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2309 = - JSCompiler_object_inline_stack_2310.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2310.fallback; - if (JSCompiler_object_inline_message_2308) + JSCompiler_object_inline_digest_2295 = + JSCompiler_object_inline_stack_2296.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2296.fallback; + if (JSCompiler_object_inline_message_2294) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_stack_2296 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_digest_2295, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_message_2308.memoizedState = + (JSCompiler_object_inline_message_2294 = workInProgress.child), + (JSCompiler_object_inline_message_2294.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2294.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2297, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2296 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2310.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2296.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_stack_2296 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_digest_2295, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_message_2308.memoizedState = + (JSCompiler_object_inline_message_2294 = workInProgress.child), + (JSCompiler_object_inline_message_2294.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2294.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2297, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2296 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2295 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2309 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2309) + ((JSCompiler_object_inline_digest_2295 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2295) ) { if (didSuspend) workInProgress.flags & 256 @@ -8868,94 +9009,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_stack_2310.fallback), - (JSCompiler_object_inline_digest_2309 = workInProgress.mode), - (JSCompiler_object_inline_stack_2310 = + (JSCompiler_object_inline_message_2294 = + JSCompiler_object_inline_stack_2296.fallback), + (JSCompiler_object_inline_digest_2295 = workInProgress.mode), + (JSCompiler_object_inline_stack_2296 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2296.children }, - JSCompiler_object_inline_digest_2309 + JSCompiler_object_inline_digest_2295 )), - (JSCompiler_object_inline_message_2308 = + (JSCompiler_object_inline_message_2294 = createFiberFromFragment( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_digest_2309, + JSCompiler_object_inline_message_2294, + JSCompiler_object_inline_digest_2295, renderLanes, null )), - (JSCompiler_object_inline_message_2308.flags |= 2), - (JSCompiler_object_inline_stack_2310.return = workInProgress), - (JSCompiler_object_inline_message_2308.return = workInProgress), - (JSCompiler_object_inline_stack_2310.sibling = - JSCompiler_object_inline_message_2308), - (workInProgress.child = JSCompiler_object_inline_stack_2310), + (JSCompiler_object_inline_message_2294.flags |= 2), + (JSCompiler_object_inline_stack_2296.return = workInProgress), + (JSCompiler_object_inline_message_2294.return = workInProgress), + (JSCompiler_object_inline_stack_2296.sibling = + JSCompiler_object_inline_message_2294), + (workInProgress.child = JSCompiler_object_inline_stack_2296), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2310 = workInProgress.child), - (JSCompiler_object_inline_stack_2310.memoizedState = + (JSCompiler_object_inline_stack_2296 = workInProgress.child), + (JSCompiler_object_inline_stack_2296.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2310.childLanes = + (JSCompiler_object_inline_stack_2296.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2297, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2308)); + (workInProgress = JSCompiler_object_inline_message_2294)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2295.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2311 = - JSCompiler_object_inline_digest_2309.nextSibling && - JSCompiler_object_inline_digest_2309.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2311) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2311.dgst; - var message = JSCompiler_object_inline_componentStack_2311.msg; - instance = JSCompiler_object_inline_componentStack_2311.stck; + JSCompiler_object_inline_componentStack_2297 = + JSCompiler_object_inline_digest_2295.nextSibling && + JSCompiler_object_inline_digest_2295.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2297) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2297.dgst; + var message = JSCompiler_object_inline_componentStack_2297.msg; + instance = JSCompiler_object_inline_componentStack_2297.stck; var componentStack = - JSCompiler_object_inline_componentStack_2311.cstck; + JSCompiler_object_inline_componentStack_2297.cstck; } - JSCompiler_object_inline_message_2308 = message; - JSCompiler_object_inline_digest_2309 = JSCompiler_temp; - JSCompiler_object_inline_stack_2310 = instance; - JSCompiler_object_inline_componentStack_2311 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2309 && - ((JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_message_2308 - ? Error(JSCompiler_object_inline_message_2308) + JSCompiler_object_inline_message_2294 = message; + JSCompiler_object_inline_digest_2295 = JSCompiler_temp; + JSCompiler_object_inline_stack_2296 = instance; + JSCompiler_object_inline_componentStack_2297 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2295 && + ((JSCompiler_object_inline_message_2294 = + JSCompiler_object_inline_message_2294 + ? Error(JSCompiler_object_inline_message_2294) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2308.stack = - JSCompiler_object_inline_stack_2310 || ""), - (JSCompiler_object_inline_message_2308.digest = - JSCompiler_object_inline_digest_2309), - (JSCompiler_object_inline_componentStack_2311 = - void 0 === JSCompiler_object_inline_componentStack_2311 + (JSCompiler_object_inline_message_2294.stack = + JSCompiler_object_inline_stack_2296 || ""), + (JSCompiler_object_inline_message_2294.digest = + JSCompiler_object_inline_digest_2295), + (JSCompiler_object_inline_componentStack_2297 = + void 0 === JSCompiler_object_inline_componentStack_2297 ? null - : JSCompiler_object_inline_componentStack_2311), - "string" === typeof JSCompiler_object_inline_componentStack_2311 && + : JSCompiler_object_inline_componentStack_2297), + "string" === typeof JSCompiler_object_inline_componentStack_2297 && CapturedStacks.set( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_componentStack_2311 + JSCompiler_object_inline_message_2294, + JSCompiler_object_inline_componentStack_2297 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2308, + value: JSCompiler_object_inline_message_2294, source: null, - stack: JSCompiler_object_inline_componentStack_2311 + stack: JSCompiler_object_inline_componentStack_2297 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8970,25 +9111,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2311 = + (JSCompiler_object_inline_componentStack_2297 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2311) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2297) ) { - JSCompiler_object_inline_componentStack_2311 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2311) { - JSCompiler_object_inline_stack_2310 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2310 & 42)) - JSCompiler_object_inline_stack_2310 = 1; + JSCompiler_object_inline_componentStack_2297 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2297) { + JSCompiler_object_inline_stack_2296 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2296 & 42)) + JSCompiler_object_inline_stack_2296 = 1; else - switch (JSCompiler_object_inline_stack_2310) { + switch (JSCompiler_object_inline_stack_2296) { case 2: - JSCompiler_object_inline_stack_2310 = 1; + JSCompiler_object_inline_stack_2296 = 1; break; case 8: - JSCompiler_object_inline_stack_2310 = 4; + JSCompiler_object_inline_stack_2296 = 4; break; case 32: - JSCompiler_object_inline_stack_2310 = 16; + JSCompiler_object_inline_stack_2296 = 16; break; case 128: case 256: @@ -9009,40 +9150,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2310 = 64; + JSCompiler_object_inline_stack_2296 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2310 = 134217728; + JSCompiler_object_inline_stack_2296 = 134217728; break; default: - JSCompiler_object_inline_stack_2310 = 0; + JSCompiler_object_inline_stack_2296 = 0; } - JSCompiler_object_inline_stack_2310 = + JSCompiler_object_inline_stack_2296 = 0 !== - (JSCompiler_object_inline_stack_2310 & - (JSCompiler_object_inline_componentStack_2311.suspendedLanes | + (JSCompiler_object_inline_stack_2296 & + (JSCompiler_object_inline_componentStack_2297.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2310; + : JSCompiler_object_inline_stack_2296; if ( - 0 !== JSCompiler_object_inline_stack_2310 && - JSCompiler_object_inline_stack_2310 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2296 && + JSCompiler_object_inline_stack_2296 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2310), + ((prevState.retryLane = JSCompiler_object_inline_stack_2296), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2296 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2297, current, - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2296 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2295.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9050,7 +9191,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2309.data === + JSCompiler_object_inline_digest_2295.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9058,12 +9199,12 @@ null, current )), - (JSCompiler_object_inline_digest_2309._reactRetry = + (JSCompiler_object_inline_digest_2295._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2309.nextSibling + JSCompiler_object_inline_digest_2295.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9081,54 +9222,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2310.children + JSCompiler_object_inline_stack_2296.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2308) + if (JSCompiler_object_inline_message_2294) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2308 = - JSCompiler_object_inline_stack_2310.fallback), - (JSCompiler_object_inline_digest_2309 = workInProgress.mode), + (JSCompiler_object_inline_message_2294 = + JSCompiler_object_inline_stack_2296.fallback), + (JSCompiler_object_inline_digest_2295 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2310 = createWorkInProgress( + (JSCompiler_object_inline_stack_2296 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2296.children } )), - (JSCompiler_object_inline_stack_2310.subtreeFlags = + (JSCompiler_object_inline_stack_2296.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2308 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2294 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2308 + JSCompiler_object_inline_message_2294 )) - : ((JSCompiler_object_inline_message_2308 = createFiberFromFragment( - JSCompiler_object_inline_message_2308, - JSCompiler_object_inline_digest_2309, + : ((JSCompiler_object_inline_message_2294 = createFiberFromFragment( + JSCompiler_object_inline_message_2294, + JSCompiler_object_inline_digest_2295, renderLanes, null )), - (JSCompiler_object_inline_message_2308.flags |= 2)), - (JSCompiler_object_inline_message_2308.return = workInProgress), - (JSCompiler_object_inline_stack_2310.return = workInProgress), - (JSCompiler_object_inline_stack_2310.sibling = - JSCompiler_object_inline_message_2308), - (workInProgress.child = JSCompiler_object_inline_stack_2310), - (JSCompiler_object_inline_stack_2310 = - JSCompiler_object_inline_message_2308), - (JSCompiler_object_inline_message_2308 = workInProgress.child), - (JSCompiler_object_inline_digest_2309 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2309 - ? (JSCompiler_object_inline_digest_2309 = + (JSCompiler_object_inline_message_2294.flags |= 2)), + (JSCompiler_object_inline_message_2294.return = workInProgress), + (JSCompiler_object_inline_stack_2296.return = workInProgress), + (JSCompiler_object_inline_stack_2296.sibling = + JSCompiler_object_inline_message_2294), + (workInProgress.child = JSCompiler_object_inline_stack_2296), + (JSCompiler_object_inline_stack_2296 = + JSCompiler_object_inline_message_2294), + (JSCompiler_object_inline_message_2294 = workInProgress.child), + (JSCompiler_object_inline_digest_2295 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2295 + ? (JSCompiler_object_inline_digest_2295 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2309.cachePool), + JSCompiler_object_inline_digest_2295.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9136,38 +9277,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2309 = { + (JSCompiler_object_inline_digest_2295 = { baseLanes: - JSCompiler_object_inline_digest_2309.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2295.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2308.memoizedState = - JSCompiler_object_inline_digest_2309), - (JSCompiler_object_inline_message_2308.childLanes = + (JSCompiler_object_inline_message_2294.memoizedState = + JSCompiler_object_inline_digest_2295), + (JSCompiler_object_inline_message_2294.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2311, + JSCompiler_object_inline_componentStack_2297, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2310 + JSCompiler_object_inline_stack_2296 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2310.children + children: JSCompiler_object_inline_stack_2296.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2311 = + ((JSCompiler_object_inline_componentStack_2297 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2311 + null === JSCompiler_object_inline_componentStack_2297 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2311.push(current)); + : JSCompiler_object_inline_componentStack_2297.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10452,7 +10593,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10741,6 +10886,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10751,128 +10906,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10880,101 +11449,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11048,351 +11522,98 @@ selectionRange: JSCompiler_temp }; _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((firstChild = nextEffect), + (root = firstChild.child), + 0 !== (firstChild.subtreeFlags & 1028) && null !== root) + ) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11408,17 +11629,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11432,21 +11663,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11454,11 +11689,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11474,59 +11705,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11534,11 +11770,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11548,11 +11780,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11575,78 +11803,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11726,14 +11882,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11779,7 +11958,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11789,14 +11970,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11864,7 +12049,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11913,74 +12102,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -11988,53 +12156,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$10 - ); - } - } + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, + finishedWork, + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12051,116 +12197,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12169,9 +12317,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12186,117 +12334,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12305,23 +12421,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12329,7 +12448,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12338,13 +12457,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12354,12 +12473,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12375,15 +12494,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12391,13 +12510,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12406,47 +12525,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12477,7 +12595,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12488,7 +12606,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12496,52 +12614,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12561,27 +12634,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12664,24 +12723,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12698,7 +12761,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12707,9 +12770,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12746,9 +12833,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12756,22 +12841,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12802,9 +12871,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12851,9 +12918,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12862,18 +12929,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12917,9 +12982,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12952,9 +13015,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12964,11 +13027,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13006,62 +13067,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13122,25 +13166,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13157,11 +13182,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13205,7 +13226,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13235,22 +13256,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13263,31 +13299,6 @@ } } } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -13367,7 +13378,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13420,7 +13432,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13642,13 +13655,26 @@ (resource.state.loading & Inserted) !== NotLoaded ) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if ( + ((workInProgress.flags |= 16777216), !preloadResource(resource)) + ) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -14453,7 +14479,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14495,7 +14522,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14520,7 +14548,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14552,7 +14585,12 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -14568,7 +14606,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14602,7 +14641,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14614,7 +14654,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14627,7 +14668,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14682,7 +14724,8 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14705,7 +14748,7 @@ didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14753,26 +14796,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14802,13 +14850,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14861,6 +14914,12 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressDeferredLane = @@ -14897,12 +14956,7 @@ current = null; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? SuspendedOnData - : SuspendedOnImmediate)) + (workInProgressSuspendedReason = SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = SuspendedOnInstance)) @@ -14953,21 +15007,6 @@ ); } } - function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; - } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -14986,7 +15025,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15041,8 +15081,8 @@ } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15182,8 +15222,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15308,43 +15348,25 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || workInProgressSuspendedReason === SuspendedOnError + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15378,6 +15400,38 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, @@ -15581,55 +15635,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15775,6 +15814,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -19233,6 +19273,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19256,6 +19328,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19456,6 +19549,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19494,6 +19593,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20210,6 +20340,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22299,6 +22430,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23881,84 +24019,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -24026,6 +24094,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24045,7 +24176,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24096,6 +24227,8 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24672,11 +24805,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24713,11 +24846,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25191,7 +25324,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index 54ef1f04a431f..ca85d43db83ef 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -678,28 +678,37 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -770,6 +779,7 @@ function markRootFinished(root, remainingLanes, spawnedLane) { root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -781,18 +791,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -812,19 +822,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - root[index$9].add(fiber); + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + root[index$10].add(fiber); lanes &= ~lane; } } @@ -836,16 +846,16 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$10 = 31 - clz32(lanes); - root = 1 << index$10; - index$10 = pendingUpdatersLaneMap[index$10]; - 0 < index$10.size && - (index$10.forEach(function (fiber) { + var index$11 = 31 - clz32(lanes); + root = 1 << index$11; + index$11 = pendingUpdatersLaneMap[index$11]; + 0 < index$11.size && + (index$11.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$10.clear()); + index$11.clear()); lanes &= ~root; } } @@ -995,8 +1005,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$11 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$11 && "aria-" !== prefix$11) { + var prefix$12 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$12 && "aria-" !== prefix$12) { node.removeAttribute(name); return; } @@ -1329,15 +1339,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$17 in styles) - (styleName = styles[styleName$17]), - styles.hasOwnProperty(styleName$17) && - prevStyles[styleName$17] !== styleName && - setValueForStyle(node, styleName$17, styleName); - } else for (var styleName$18 in styles) - styles.hasOwnProperty(styleName$18) && - setValueForStyle(node, styleName$18, styles[styleName$18]); + (styleName = styles[styleName$18]), + styles.hasOwnProperty(styleName$18) && + prevStyles[styleName$18] !== styleName && + setValueForStyle(node, styleName$18, styleName); + } else + for (var styleName$19 in styles) + styles.hasOwnProperty(styleName$19) && + setValueForStyle(node, styleName$19, styles[styleName$19]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2066,19 +2076,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$311; + var JSCompiler_inline_result$jscomp$299; if (canUseDOM) { - var isSupported$jscomp$inline_447 = "oninput" in document; - if (!isSupported$jscomp$inline_447) { - var element$jscomp$inline_448 = document.createElement("div"); - element$jscomp$inline_448.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_447 = - "function" === typeof element$jscomp$inline_448.oninput; + var isSupported$jscomp$inline_435 = "oninput" in document; + if (!isSupported$jscomp$inline_435) { + var element$jscomp$inline_436 = document.createElement("div"); + element$jscomp$inline_436.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_435 = + "function" === typeof element$jscomp$inline_436.oninput; } - JSCompiler_inline_result$jscomp$311 = isSupported$jscomp$inline_447; - } else JSCompiler_inline_result$jscomp$311 = !1; + JSCompiler_inline_result$jscomp$299 = isSupported$jscomp$inline_435; + } else JSCompiler_inline_result$jscomp$299 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$311 && + JSCompiler_inline_result$jscomp$299 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2494,7 +2504,69 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +} +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } +} +function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } +} +function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } +} +function startLayoutEffectTimer() { + layoutEffectStartTime = now(); +} +function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); +} +var CapturedStacks = new WeakMap(); function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -4012,7 +4084,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$56 = !1; + didReadFromEntangledAsyncAction$59 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4033,11 +4105,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$59 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$59 = !0); continue; } else (updateLane = { @@ -4083,7 +4155,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$56 && + didReadFromEntangledAsyncAction$59 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4281,8 +4353,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$62) { - onActionError(actionQueue, node, error$62); + } catch (error$65) { + onActionError(actionQueue, node, error$65); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4720,14 +4792,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$65 = enqueueUpdate(provider, fiber, lane); - null !== root$65 && - (scheduleUpdateOnFiber(root$65, provider, lane), - entangleTransitions(root$65, provider, lane)); + var root$68 = enqueueUpdate(provider, fiber, lane); + null !== root$68 && + (scheduleUpdateOnFiber(root$68, provider, lane), + entangleTransitions(root$68, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$65 && + null !== root$68 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5157,67 +5229,112 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; - } - } +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - } - fiber = fiber.return; - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } -} -function startLayoutEffectTimer() { - layoutEffectStartTime = now(); -} -function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$72 in Component) + void 0 === newProps[propName$72] && + (newProps[propName$72] = Component[propName$72]); + } + return newProps; } var reportGlobalError = "function" === typeof reportError @@ -5261,9 +5378,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$71) { + } catch (e$73) { setTimeout(function () { - throw e$71; + throw e$73; }); } } @@ -5274,9 +5391,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$72) { + } catch (e$74) { setTimeout(function () { - throw e$72; + throw e$74; }); } } @@ -7638,122 +7755,139 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +function shouldProfile$1(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext +} +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + markComponentLayoutEffectUnmountStarted(finishedWork), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$117 in Component) - void 0 === newProps[propName$117] && - (newProps[propName$117] = Component[propName$117]); +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; -} -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; -function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } function safelyCallComponentWillUnmount( current, @@ -7765,7 +7899,7 @@ function safelyCallComponentWillUnmount( current.memoizedProps ); instance.state = current.memoizedState; - if (shouldProfile(current)) { + if (shouldProfile$1(current)) { startLayoutEffectTimer(); try { instance.componentWillUnmount(); @@ -7776,8 +7910,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$118) { - captureCommitPhaseError(current, nearestMountedAncestor, error$118); + } catch (error$122) { + captureCommitPhaseError(current, nearestMountedAncestor, error$122); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -7795,7 +7929,7 @@ function safelyAttachRef(current, nearestMountedAncestor) { instanceToUse = instance; } if ("function" === typeof ref) - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { @@ -7814,7 +7948,7 @@ function safelyDetachRef(current, nearestMountedAncestor) { if (null !== ref) if ("function" === typeof refCleanup) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), refCleanup(); } finally { @@ -7830,15 +7964,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else if ("function" === typeof ref) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), ref(null); } finally { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$119) { - captureCommitPhaseError(current, nearestMountedAncestor, error$119); + } catch (error$123) { + captureCommitPhaseError(current, nearestMountedAncestor, error$123); } else ref.current = null; } @@ -7849,6 +7983,148 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } +function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration +) { + if (executionContext & 4) + try { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null; +function shouldProfile(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); +} var shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; @@ -7874,7 +8150,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$21) { + } catch (e$22) { JSCompiler_temp = null; break a; } @@ -7930,69 +8206,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -8002,176 +8291,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8186,7 +8308,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidMount(); @@ -8197,11 +8319,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$124) { + } catch (error$119) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$124 + error$119 ); } else { @@ -8210,7 +8332,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current.memoizedProps ); current = current.memoizedState; - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidUpdate( @@ -8218,11 +8340,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$125) { + } catch (error$120) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$125 + error$120 ); } recordLayoutEffectDuration(finishedWork); @@ -8233,11 +8355,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$126) { + } catch (error$121) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$126 + error$121 ); } } @@ -8271,12 +8393,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8288,116 +8428,47 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { if (!prevProps) { current = (null !== current && null !== current.memoizedState) || - offscreenSubtreeWasHidden; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevProps; - (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden - ? recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - 0 !== (finishedWork.subtreeFlags & 8772) - ) - : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - } - flags & 512 && - ("manual" === finishedWork.memoizedProps.mode - ? safelyAttachRef(finishedWork, finishedWork.return) - : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - } -} -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - 5 === fiber.tag && - ((alternate = fiber.stateNode), - null !== alternate && detachDeletedInstance(alternate)); - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; -} -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); + offscreenSubtreeWasHidden; + var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, + prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = prevProps; + (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden + ? recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + 0 !== (finishedWork.subtreeFlags & 8772) + ) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; + } + flags & 512 && + ("manual" === finishedWork.memoizedProps.mode + ? safelyAttachRef(finishedWork, finishedWork.return) + : safelyDetachRef(finishedWork, finishedWork.return)); + break; + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + } } -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + 5 === fiber.tag && + ((alternate = fiber.stateNode), + null !== alternate && detachDeletedInstance(alternate)); + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } var hostParent = null, hostParentIsContainer = !1; @@ -8446,8 +8517,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8456,35 +8531,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$133 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$133; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8513,18 +8608,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$133 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$133 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$133 & 4) && (markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), @@ -8653,39 +8748,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8703,36 +8794,14 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$140) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$140 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$141) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$141 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8757,56 +8826,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8814,36 +8882,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8851,16 +8919,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8875,64 +8943,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$142) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$142 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8941,24 +9008,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$143) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$143); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$145) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$145); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8967,12 +9031,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$146) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$146); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8986,8 +9050,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$147) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$147); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9018,15 +9082,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9034,13 +9098,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9049,45 +9113,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$130) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$130 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -9137,11 +9200,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -9154,21 +9217,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$131 = JSCompiler_inline_result.stateNode; + var parent$124 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$131, ""), + (setTextContent(parent$124, ""), (JSCompiler_inline_result.flags &= -33)); - var before$132 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$132, parent$131); + var before$125 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$125, parent$124); break; case 3: case 4: - var parent$133 = JSCompiler_inline_result.stateNode.containerInfo, - before$134 = getHostSibling(finishedWork); + var parent$126 = JSCompiler_inline_result.stateNode.containerInfo, + before$127 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$134, - parent$133 + before$127, + parent$126 ); break; default: @@ -9278,23 +9341,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9312,7 +9382,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9321,9 +9391,25 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9354,22 +9440,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$152) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$152); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9667,25 +9737,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -10071,13 +10122,24 @@ function markUpdate(workInProgress) { function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4)) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -10102,14 +10164,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$158 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$158 = lastTailNode), + for (var lastTailNode$146 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$146 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$158 + null === lastTailNode$146 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$158.sibling = null); + : (lastTailNode$146.sibling = null); } } function bubbleProperties(completedWork) { @@ -10121,53 +10183,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$160 = completedWork.selfBaseDuration, - child$161 = completedWork.child; - null !== child$161; + var treeBaseDuration$148 = completedWork.selfBaseDuration, + child$149 = completedWork.child; + null !== child$149; ) - (newChildLanes |= child$161.lanes | child$161.childLanes), - (subtreeFlags |= child$161.subtreeFlags & 31457280), - (subtreeFlags |= child$161.flags & 31457280), - (treeBaseDuration$160 += child$161.treeBaseDuration), - (child$161 = child$161.sibling); - completedWork.treeBaseDuration = treeBaseDuration$160; + (newChildLanes |= child$149.lanes | child$149.childLanes), + (subtreeFlags |= child$149.subtreeFlags & 31457280), + (subtreeFlags |= child$149.flags & 31457280), + (treeBaseDuration$148 += child$149.treeBaseDuration), + (child$149 = child$149.sibling); + completedWork.treeBaseDuration = treeBaseDuration$148; } else for ( - treeBaseDuration$160 = completedWork.child; - null !== treeBaseDuration$160; + treeBaseDuration$148 = completedWork.child; + null !== treeBaseDuration$148; ) (newChildLanes |= - treeBaseDuration$160.lanes | treeBaseDuration$160.childLanes), - (subtreeFlags |= treeBaseDuration$160.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$160.flags & 31457280), - (treeBaseDuration$160.return = completedWork), - (treeBaseDuration$160 = treeBaseDuration$160.sibling); + treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), + (subtreeFlags |= treeBaseDuration$148.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$148.flags & 31457280), + (treeBaseDuration$148.return = completedWork), + (treeBaseDuration$148 = treeBaseDuration$148.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$160 = completedWork.actualDuration; - child$161 = completedWork.selfBaseDuration; + treeBaseDuration$148 = completedWork.actualDuration; + child$149 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$160 += child.actualDuration), - (child$161 += child.treeBaseDuration), + (treeBaseDuration$148 += child.actualDuration), + (child$149 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$160; - completedWork.treeBaseDuration = child$161; + completedWork.actualDuration = treeBaseDuration$148; + completedWork.treeBaseDuration = child$149; } else for ( - treeBaseDuration$160 = completedWork.child; - null !== treeBaseDuration$160; + treeBaseDuration$148 = completedWork.child; + null !== treeBaseDuration$148; ) (newChildLanes |= - treeBaseDuration$160.lanes | treeBaseDuration$160.childLanes), - (subtreeFlags |= treeBaseDuration$160.subtreeFlags), - (subtreeFlags |= treeBaseDuration$160.flags), - (treeBaseDuration$160.return = completedWork), - (treeBaseDuration$160 = treeBaseDuration$160.sibling); + treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), + (subtreeFlags |= treeBaseDuration$148.subtreeFlags), + (subtreeFlags |= treeBaseDuration$148.flags), + (treeBaseDuration$148.return = completedWork), + (treeBaseDuration$148 = treeBaseDuration$148.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10460,11 +10522,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$176 = null; + var cache$164 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$176 = newProps.memoizedState.cachePool.pool); - cache$176 !== type && (newProps.flags |= 2048); + (cache$164 = newProps.memoizedState.cachePool.pool); + cache$164 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10494,8 +10556,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$176 = type.rendering; - if (null === cache$176) + cache$164 = type.rendering; + if (null === cache$164) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10503,11 +10565,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$176 = findFirstSuspended(current); - if (null !== cache$176) { + cache$164 = findFirstSuspended(current); + if (null !== cache$164) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$176.updateQueue; + current = cache$164.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10532,7 +10594,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$176)), null !== current)) { + if (((current = findFirstSuspended(cache$164)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10542,7 +10604,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$176.alternate && + !cache$164.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10555,13 +10617,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$176.sibling = workInProgress.child), - (workInProgress.child = cache$176)) + ? ((cache$164.sibling = workInProgress.child), + (workInProgress.child = cache$164)) : ((current = type.last), null !== current - ? (current.sibling = cache$176) - : (workInProgress.child = cache$176), - (type.last = cache$176)); + ? (current.sibling = cache$164) + : (workInProgress.child = cache$164), + (type.last = cache$164)); } if (null !== type.tail) return ( @@ -10743,6 +10805,8 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10794,7 +10858,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10806,7 +10871,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10829,7 +10895,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10861,7 +10933,12 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -10877,7 +10954,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10899,7 +10977,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10911,7 +10990,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10924,7 +11004,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10976,7 +11057,8 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10995,7 +11077,7 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -11043,25 +11125,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -11090,13 +11175,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -11149,6 +11239,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & lanes); workInProgressRootDidAttachPingListener = !1; workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -11167,9 +11261,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11181,12 +11275,7 @@ function handleThrow(root, thrownValue) { ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 2 - : 3)) + (workInProgressSuspendedReason = 3)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = 4)) @@ -11235,21 +11324,6 @@ function handleThrow(root, thrownValue) { ); } } -function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; -} function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -11268,7 +11342,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -11317,8 +11392,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$191) { - handleThrow(root, thrownValue$191); + } catch (thrownValue$179) { + handleThrow(root, thrownValue$179); } while (1); lanes && root.shellSuspendCounter++; @@ -11438,8 +11513,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$193) { - handleThrow(root, thrownValue$193); + } catch (thrownValue$181) { + handleThrow(root, thrownValue$181); } while (1); resetContextDependencies(); @@ -11549,39 +11624,25 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || 1 === workInProgressSuspendedReason + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) @@ -11602,6 +11663,36 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, @@ -11737,7 +11828,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, + var root$185 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11782,7 +11873,7 @@ function flushPassiveEffects() { _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit, - commitTime$121 = commitTime, + commitTime$129 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && @@ -11790,7 +11881,7 @@ function flushPassiveEffects() { id, phase, passiveEffectDuration, - commitTime$121 + commitTime$129 ); var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { @@ -11830,7 +11921,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); + releaseRootPooledCache(root$185, remainingLanes); } } return !1; @@ -11911,6 +12002,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -12002,14 +12094,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$199 = firstScheduledRoot; null !== root$199; ) { + for (var root$187 = firstScheduledRoot; null !== root$187; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$199.pendingLanes; + var pendingLanes = root$187.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$199.suspendedLanes, - pingedLanes = root$199.pingedLanes; + var suspendedLanes = root$187.suspendedLanes, + pingedLanes = root$187.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12023,17 +12115,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$187, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$199, - root$199 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$187, + root$187 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$199, JSCompiler_inline_result)); - root$199 = root$199.next; + performSyncWorkOnRoot(root$187, JSCompiler_inline_result)); + root$187 = root$187.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12074,12 +12166,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -12243,20 +12335,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1475 = 0; - i$jscomp$inline_1475 < simpleEventPluginEvents.length; - i$jscomp$inline_1475++ + var i$jscomp$inline_1492 = 0; + i$jscomp$inline_1492 < simpleEventPluginEvents.length; + i$jscomp$inline_1492++ ) { - var eventName$jscomp$inline_1476 = - simpleEventPluginEvents[i$jscomp$inline_1475], - domEventName$jscomp$inline_1477 = - eventName$jscomp$inline_1476.toLowerCase(), - capitalizedEvent$jscomp$inline_1478 = - eventName$jscomp$inline_1476[0].toUpperCase() + - eventName$jscomp$inline_1476.slice(1); + var eventName$jscomp$inline_1493 = + simpleEventPluginEvents[i$jscomp$inline_1492], + domEventName$jscomp$inline_1494 = + eventName$jscomp$inline_1493.toLowerCase(), + capitalizedEvent$jscomp$inline_1495 = + eventName$jscomp$inline_1493[0].toUpperCase() + + eventName$jscomp$inline_1493.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1477, - "on" + capitalizedEvent$jscomp$inline_1478 + domEventName$jscomp$inline_1494, + "on" + capitalizedEvent$jscomp$inline_1495 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13439,34 +13531,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$213 = props[hasSrc]; - if (null != propValue$213) + var propValue$201 = props[hasSrc]; + if (null != propValue$201) switch (hasSrc) { case "name": - hasSrcSet = propValue$213; + hasSrcSet = propValue$201; break; case "type": - propValue = propValue$213; + propValue = propValue$201; break; case "checked": - checked = propValue$213; + checked = propValue$201; break; case "defaultChecked": - defaultChecked = propValue$213; + defaultChecked = propValue$201; break; case "value": - propKey = propValue$213; + propKey = propValue$201; break; case "defaultValue": - defaultValue = propValue$213; + defaultValue = propValue$201; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$213) + if (null != propValue$201) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$213, props, null); + setProp(domElement, tag, hasSrc, propValue$201, props, null); } } initInput( @@ -13603,14 +13695,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$213 in props) - props.hasOwnProperty(propValue$213) && - ((hasSrc = props[propValue$213]), + for (propValue$201 in props) + props.hasOwnProperty(propValue$201) && + ((hasSrc = props[propValue$201]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$213, + propValue$201, hasSrc, props, void 0 @@ -13658,14 +13750,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$230 in nextProps) { - var propKey = nextProps[propKey$230]; - lastProp = lastProps[propKey$230]; + for (var propKey$218 in nextProps) { + var propKey = nextProps[propKey$218]; + lastProp = lastProps[propKey$218]; if ( - nextProps.hasOwnProperty(propKey$230) && + nextProps.hasOwnProperty(propKey$218) && (null != propKey || null != lastProp) ) - switch (propKey$230) { + switch (propKey$218) { case "type": type = propKey; break; @@ -13694,7 +13786,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$230, + propKey$218, propKey, nextProps, lastProp @@ -13713,7 +13805,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$230 = null; + propKey = value = defaultValue = propKey$218 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13744,7 +13836,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$230 = type; + propKey$218 = type; break; case "defaultValue": defaultValue = type; @@ -13765,15 +13857,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$230 - ? updateOptions(domElement, !!lastProps, propKey$230, !1) + null != propKey$218 + ? updateOptions(domElement, !!lastProps, propKey$218, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$230 = null; + propKey = propKey$218 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13797,7 +13889,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$230 = name; + propKey$218 = name; break; case "defaultValue": propKey = name; @@ -13811,17 +13903,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$230, propKey); + updateTextarea(domElement, propKey$218, propKey); return; case "option": - for (var propKey$246 in lastProps) + for (var propKey$234 in lastProps) if ( - ((propKey$230 = lastProps[propKey$246]), - lastProps.hasOwnProperty(propKey$246) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$246)) + ((propKey$218 = lastProps[propKey$234]), + lastProps.hasOwnProperty(propKey$234) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$234)) ) - switch (propKey$246) { + switch (propKey$234) { case "selected": domElement.selected = !1; break; @@ -13829,33 +13921,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$246, + propKey$234, null, nextProps, - propKey$230 + propKey$218 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$230 = nextProps[lastDefaultValue]), + ((propKey$218 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$218 !== propKey && + (null != propKey$218 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$230 && - "function" !== typeof propKey$230 && - "symbol" !== typeof propKey$230; + propKey$218 && + "function" !== typeof propKey$218 && + "symbol" !== typeof propKey$218; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$230, + propKey$218, nextProps, propKey ); @@ -13876,24 +13968,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$251 in lastProps) - (propKey$230 = lastProps[propKey$251]), - lastProps.hasOwnProperty(propKey$251) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$251) && - setProp(domElement, tag, propKey$251, null, nextProps, propKey$230); + for (var propKey$239 in lastProps) + (propKey$218 = lastProps[propKey$239]), + lastProps.hasOwnProperty(propKey$239) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$239) && + setProp(domElement, tag, propKey$239, null, nextProps, propKey$218); for (checked in nextProps) if ( - ((propKey$230 = nextProps[checked]), + ((propKey$218 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$230 !== propKey && - (null != propKey$230 || null != propKey)) + propKey$218 !== propKey && + (null != propKey$218 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$230) + if (null != propKey$218) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13901,7 +13993,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$230, + propKey$218, nextProps, propKey ); @@ -13909,49 +14001,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$256 in lastProps) - (propKey$230 = lastProps[propKey$256]), - lastProps.hasOwnProperty(propKey$256) && - void 0 !== propKey$230 && - !nextProps.hasOwnProperty(propKey$256) && + for (var propKey$244 in lastProps) + (propKey$218 = lastProps[propKey$244]), + lastProps.hasOwnProperty(propKey$244) && + void 0 !== propKey$218 && + !nextProps.hasOwnProperty(propKey$244) && setPropOnCustomElement( domElement, tag, - propKey$256, + propKey$244, void 0, nextProps, - propKey$230 + propKey$218 ); for (defaultChecked in nextProps) - (propKey$230 = nextProps[defaultChecked]), + (propKey$218 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$230 === propKey || - (void 0 === propKey$230 && void 0 === propKey) || + propKey$218 === propKey || + (void 0 === propKey$218 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$230, + propKey$218, nextProps, propKey ); return; } } - for (var propKey$261 in lastProps) - (propKey$230 = lastProps[propKey$261]), - lastProps.hasOwnProperty(propKey$261) && - null != propKey$230 && - !nextProps.hasOwnProperty(propKey$261) && - setProp(domElement, tag, propKey$261, null, nextProps, propKey$230); + for (var propKey$249 in lastProps) + (propKey$218 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && + null != propKey$218 && + !nextProps.hasOwnProperty(propKey$249) && + setProp(domElement, tag, propKey$249, null, nextProps, propKey$218); for (lastProp in nextProps) - (propKey$230 = nextProps[lastProp]), + (propKey$218 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$230 === propKey || - (null == propKey$230 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$230, nextProps, propKey); + propKey$218 === propKey || + (null == propKey$218 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$218, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14496,26 +14588,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$269 = getResourcesFromRoot( + var styles$257 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$270 = styles$269.get(type); - resource$270 || + resource$258 = styles$257.get(type); + resource$258 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$270 = { + (resource$258 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$269.set(type, resource$270), - (styles$269 = JSCompiler_inline_result.querySelector( + styles$257.set(type, resource$258), + (styles$257 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$269._p && - ((resource$270.instance = styles$269), - (resource$270.state.loading = 5)), + !styles$257._p && + ((resource$258.instance = styles$257), + (resource$258.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14528,16 +14620,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$269 || + styles$257 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$270.state + resource$258.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$270; + return resource$258; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14634,37 +14726,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$275 = hoistableRoot.querySelector( + var instance$263 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$275) + if (instance$263) return ( (resource.state.loading |= 4), - (resource.instance = instance$275), - markNodeAsHoistable(instance$275), - instance$275 + (resource.instance = instance$263), + markNodeAsHoistable(instance$263), + instance$263 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$275 = ( + instance$263 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$275); - var linkInstance = instance$275; + markNodeAsHoistable(instance$263); + var linkInstance = instance$263; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$275, "link", instance); + setInitialProperties(instance$263, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$275, props.precedence, hoistableRoot); - return (resource.instance = instance$275); + insertStylesheet(instance$263, props.precedence, hoistableRoot); + return (resource.instance = instance$263); case "script": - instance$275 = getScriptKey(props.src); + instance$263 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$275) + getScriptSelectorFromKey(instance$263) )) ) return ( @@ -14673,7 +14765,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$275))) + if ((styleProps = preloadPropsMap.get(instance$263))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14996,6 +15088,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15715,16 +15808,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1741 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1724 + "19.0.0-experimental-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1741 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1724, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1741, + "19.0.0-experimental-a03254bc-20240905" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15744,18 +15837,18 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1731 = { +var internals$jscomp$inline_1748 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827", + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$292 = 0; - 31 > index$292; - index$292++ + var map = new Map(), lane = 1, index$280 = 0; + 31 > index$280; + index$280++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -15768,16 +15861,16 @@ var internals$jscomp$inline_1731 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2134 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2170 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2134.isDisabled && - hook$jscomp$inline_2134.supportsFiber + !hook$jscomp$inline_2170.isDisabled && + hook$jscomp$inline_2170.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2134.inject( - internals$jscomp$inline_1731 + (rendererID = hook$jscomp$inline_2170.inject( + internals$jscomp$inline_1748 )), - (injectedHook = hook$jscomp$inline_2134); + (injectedHook = hook$jscomp$inline_2170); } catch (err) {} } function noop() {} @@ -16030,7 +16123,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index 9452c5647daaa..590d2b0fdea38 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -9291,5 +9291,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index c64e10d12e082..82e08e12aa17d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -6055,4 +6055,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js index 833ba505cf282..7d28e81fb0b61 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js @@ -9291,5 +9291,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js index 5018579879318..3ee87ac0159df 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js @@ -6147,4 +6147,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js index 52c68dfb5f0a4..ca2fbe07024c6 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js @@ -8177,11 +8177,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9911,5 +9911,5 @@ startWork(request); }); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js index 61dc6978be305..52f5673275fd1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js @@ -6572,12 +6572,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.0.0-experimental-7771d3a7-20240827" + "19.0.0-experimental-a03254bc-20240905" ) ); } @@ -6782,4 +6782,4 @@ exports.resume = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js index 5bb3c96ecf27d..572b9983867cd 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js @@ -6068,13 +6068,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_783 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== + "19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_783 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_783 + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6162,4 +6162,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js index 726fd2f3c6d57..ba195f871b838 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js @@ -8200,11 +8200,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9941,5 +9941,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js index 5035b4f547a6b..80f85620ade0c 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js @@ -6680,11 +6680,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6899,4 +6899,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js index eeee07bf4a2f7..cfa631cec3c25 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js @@ -7928,11 +7928,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -9740,5 +9740,5 @@ } }; }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js index a47861424a372..9cc6894d13c81 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js @@ -6427,11 +6427,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6716,4 +6716,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js index 4e35441166319..fbf8579111065 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js @@ -1094,28 +1094,37 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -1194,6 +1203,7 @@ root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -4039,6 +4049,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5896,6 +5961,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -7374,60 +7447,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error) { reportGlobalError(error); @@ -8069,8 +8210,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8299,8 +8440,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8736,33 +8877,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2340; - var JSCompiler_object_inline_stack_2339 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2326; + var JSCompiler_object_inline_stack_2325 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2337 = !1; + var JSCompiler_object_inline_message_2323 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2340 = didSuspend) || - (JSCompiler_object_inline_componentStack_2340 = + (JSCompiler_object_inline_componentStack_2326 = didSuspend) || + (JSCompiler_object_inline_componentStack_2326 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2340 && - ((JSCompiler_object_inline_message_2337 = !0), + JSCompiler_object_inline_componentStack_2326 && + ((JSCompiler_object_inline_message_2323 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2340 = + JSCompiler_object_inline_componentStack_2326 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2337 + JSCompiler_object_inline_message_2323 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2338 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2324 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2338)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2324)) { c: { - var instance = JSCompiler_object_inline_digest_2338; + var instance = JSCompiler_object_inline_digest_2324; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8803,19 +8944,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2324 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2338 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2324 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2338 && - ((JSCompiler_object_inline_digest_2338 = - JSCompiler_object_inline_digest_2338.dehydrated), - null !== JSCompiler_object_inline_digest_2338) + null !== JSCompiler_object_inline_digest_2324 && + ((JSCompiler_object_inline_digest_2324 = + JSCompiler_object_inline_digest_2324.dehydrated), + null !== JSCompiler_object_inline_digest_2324) ) return ( - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2324.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8823,68 +8964,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2338 = - JSCompiler_object_inline_stack_2339.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2339.fallback; - if (JSCompiler_object_inline_message_2337) + JSCompiler_object_inline_digest_2324 = + JSCompiler_object_inline_stack_2325.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2325.fallback; + if (JSCompiler_object_inline_message_2323) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_stack_2325 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_digest_2324, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_message_2337.memoizedState = + (JSCompiler_object_inline_message_2323 = workInProgress.child), + (JSCompiler_object_inline_message_2323.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2323.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2326, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2325 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2339.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2325.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_stack_2325 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_digest_2324, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_message_2337.memoizedState = + (JSCompiler_object_inline_message_2323 = workInProgress.child), + (JSCompiler_object_inline_message_2323.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2323.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2326, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2325 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2324 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2338 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2338) + ((JSCompiler_object_inline_digest_2324 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2324) ) { if (didSuspend) workInProgress.flags & 256 @@ -8901,94 +9042,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_stack_2339.fallback), - (JSCompiler_object_inline_digest_2338 = workInProgress.mode), - (JSCompiler_object_inline_stack_2339 = + (JSCompiler_object_inline_message_2323 = + JSCompiler_object_inline_stack_2325.fallback), + (JSCompiler_object_inline_digest_2324 = workInProgress.mode), + (JSCompiler_object_inline_stack_2325 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2325.children }, - JSCompiler_object_inline_digest_2338 + JSCompiler_object_inline_digest_2324 )), - (JSCompiler_object_inline_message_2337 = + (JSCompiler_object_inline_message_2323 = createFiberFromFragment( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_digest_2338, + JSCompiler_object_inline_message_2323, + JSCompiler_object_inline_digest_2324, renderLanes, null )), - (JSCompiler_object_inline_message_2337.flags |= 2), - (JSCompiler_object_inline_stack_2339.return = workInProgress), - (JSCompiler_object_inline_message_2337.return = workInProgress), - (JSCompiler_object_inline_stack_2339.sibling = - JSCompiler_object_inline_message_2337), - (workInProgress.child = JSCompiler_object_inline_stack_2339), + (JSCompiler_object_inline_message_2323.flags |= 2), + (JSCompiler_object_inline_stack_2325.return = workInProgress), + (JSCompiler_object_inline_message_2323.return = workInProgress), + (JSCompiler_object_inline_stack_2325.sibling = + JSCompiler_object_inline_message_2323), + (workInProgress.child = JSCompiler_object_inline_stack_2325), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2339 = workInProgress.child), - (JSCompiler_object_inline_stack_2339.memoizedState = + (JSCompiler_object_inline_stack_2325 = workInProgress.child), + (JSCompiler_object_inline_stack_2325.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2339.childLanes = + (JSCompiler_object_inline_stack_2325.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2326, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2337)); + (workInProgress = JSCompiler_object_inline_message_2323)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2324.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2340 = - JSCompiler_object_inline_digest_2338.nextSibling && - JSCompiler_object_inline_digest_2338.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2340) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2340.dgst; - var message = JSCompiler_object_inline_componentStack_2340.msg; - instance = JSCompiler_object_inline_componentStack_2340.stck; + JSCompiler_object_inline_componentStack_2326 = + JSCompiler_object_inline_digest_2324.nextSibling && + JSCompiler_object_inline_digest_2324.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2326) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2326.dgst; + var message = JSCompiler_object_inline_componentStack_2326.msg; + instance = JSCompiler_object_inline_componentStack_2326.stck; var componentStack = - JSCompiler_object_inline_componentStack_2340.cstck; + JSCompiler_object_inline_componentStack_2326.cstck; } - JSCompiler_object_inline_message_2337 = message; - JSCompiler_object_inline_digest_2338 = JSCompiler_temp; - JSCompiler_object_inline_stack_2339 = instance; - JSCompiler_object_inline_componentStack_2340 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2338 && - ((JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_message_2337 - ? Error(JSCompiler_object_inline_message_2337) + JSCompiler_object_inline_message_2323 = message; + JSCompiler_object_inline_digest_2324 = JSCompiler_temp; + JSCompiler_object_inline_stack_2325 = instance; + JSCompiler_object_inline_componentStack_2326 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2324 && + ((JSCompiler_object_inline_message_2323 = + JSCompiler_object_inline_message_2323 + ? Error(JSCompiler_object_inline_message_2323) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2337.stack = - JSCompiler_object_inline_stack_2339 || ""), - (JSCompiler_object_inline_message_2337.digest = - JSCompiler_object_inline_digest_2338), - (JSCompiler_object_inline_componentStack_2340 = - void 0 === JSCompiler_object_inline_componentStack_2340 + (JSCompiler_object_inline_message_2323.stack = + JSCompiler_object_inline_stack_2325 || ""), + (JSCompiler_object_inline_message_2323.digest = + JSCompiler_object_inline_digest_2324), + (JSCompiler_object_inline_componentStack_2326 = + void 0 === JSCompiler_object_inline_componentStack_2326 ? null - : JSCompiler_object_inline_componentStack_2340), - "string" === typeof JSCompiler_object_inline_componentStack_2340 && + : JSCompiler_object_inline_componentStack_2326), + "string" === typeof JSCompiler_object_inline_componentStack_2326 && CapturedStacks.set( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_componentStack_2340 + JSCompiler_object_inline_message_2323, + JSCompiler_object_inline_componentStack_2326 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2337, + value: JSCompiler_object_inline_message_2323, source: null, - stack: JSCompiler_object_inline_componentStack_2340 + stack: JSCompiler_object_inline_componentStack_2326 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9003,25 +9144,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2340 = + (JSCompiler_object_inline_componentStack_2326 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2340) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2326) ) { - JSCompiler_object_inline_componentStack_2340 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2340) { - JSCompiler_object_inline_stack_2339 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2339 & 42)) - JSCompiler_object_inline_stack_2339 = 1; + JSCompiler_object_inline_componentStack_2326 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2326) { + JSCompiler_object_inline_stack_2325 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2325 & 42)) + JSCompiler_object_inline_stack_2325 = 1; else - switch (JSCompiler_object_inline_stack_2339) { + switch (JSCompiler_object_inline_stack_2325) { case 2: - JSCompiler_object_inline_stack_2339 = 1; + JSCompiler_object_inline_stack_2325 = 1; break; case 8: - JSCompiler_object_inline_stack_2339 = 4; + JSCompiler_object_inline_stack_2325 = 4; break; case 32: - JSCompiler_object_inline_stack_2339 = 16; + JSCompiler_object_inline_stack_2325 = 16; break; case 128: case 256: @@ -9042,40 +9183,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2339 = 64; + JSCompiler_object_inline_stack_2325 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2339 = 134217728; + JSCompiler_object_inline_stack_2325 = 134217728; break; default: - JSCompiler_object_inline_stack_2339 = 0; + JSCompiler_object_inline_stack_2325 = 0; } - JSCompiler_object_inline_stack_2339 = + JSCompiler_object_inline_stack_2325 = 0 !== - (JSCompiler_object_inline_stack_2339 & - (JSCompiler_object_inline_componentStack_2340.suspendedLanes | + (JSCompiler_object_inline_stack_2325 & + (JSCompiler_object_inline_componentStack_2326.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2339; + : JSCompiler_object_inline_stack_2325; if ( - 0 !== JSCompiler_object_inline_stack_2339 && - JSCompiler_object_inline_stack_2339 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2325 && + JSCompiler_object_inline_stack_2325 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2339), + ((prevState.retryLane = JSCompiler_object_inline_stack_2325), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2325 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2326, current, - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2325 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2324.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9083,7 +9224,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2338.data === + JSCompiler_object_inline_digest_2324.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9091,12 +9232,12 @@ null, current )), - (JSCompiler_object_inline_digest_2338._reactRetry = + (JSCompiler_object_inline_digest_2324._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2338.nextSibling + JSCompiler_object_inline_digest_2324.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9114,54 +9255,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2339.children + JSCompiler_object_inline_stack_2325.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2337) + if (JSCompiler_object_inline_message_2323) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2337 = - JSCompiler_object_inline_stack_2339.fallback), - (JSCompiler_object_inline_digest_2338 = workInProgress.mode), + (JSCompiler_object_inline_message_2323 = + JSCompiler_object_inline_stack_2325.fallback), + (JSCompiler_object_inline_digest_2324 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2339 = createWorkInProgress( + (JSCompiler_object_inline_stack_2325 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2325.children } )), - (JSCompiler_object_inline_stack_2339.subtreeFlags = + (JSCompiler_object_inline_stack_2325.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2337 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2323 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2337 + JSCompiler_object_inline_message_2323 )) - : ((JSCompiler_object_inline_message_2337 = createFiberFromFragment( - JSCompiler_object_inline_message_2337, - JSCompiler_object_inline_digest_2338, + : ((JSCompiler_object_inline_message_2323 = createFiberFromFragment( + JSCompiler_object_inline_message_2323, + JSCompiler_object_inline_digest_2324, renderLanes, null )), - (JSCompiler_object_inline_message_2337.flags |= 2)), - (JSCompiler_object_inline_message_2337.return = workInProgress), - (JSCompiler_object_inline_stack_2339.return = workInProgress), - (JSCompiler_object_inline_stack_2339.sibling = - JSCompiler_object_inline_message_2337), - (workInProgress.child = JSCompiler_object_inline_stack_2339), - (JSCompiler_object_inline_stack_2339 = - JSCompiler_object_inline_message_2337), - (JSCompiler_object_inline_message_2337 = workInProgress.child), - (JSCompiler_object_inline_digest_2338 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2338 - ? (JSCompiler_object_inline_digest_2338 = + (JSCompiler_object_inline_message_2323.flags |= 2)), + (JSCompiler_object_inline_message_2323.return = workInProgress), + (JSCompiler_object_inline_stack_2325.return = workInProgress), + (JSCompiler_object_inline_stack_2325.sibling = + JSCompiler_object_inline_message_2323), + (workInProgress.child = JSCompiler_object_inline_stack_2325), + (JSCompiler_object_inline_stack_2325 = + JSCompiler_object_inline_message_2323), + (JSCompiler_object_inline_message_2323 = workInProgress.child), + (JSCompiler_object_inline_digest_2324 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2324 + ? (JSCompiler_object_inline_digest_2324 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2338.cachePool), + JSCompiler_object_inline_digest_2324.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9169,38 +9310,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2338 = { + (JSCompiler_object_inline_digest_2324 = { baseLanes: - JSCompiler_object_inline_digest_2338.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2324.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2337.memoizedState = - JSCompiler_object_inline_digest_2338), - (JSCompiler_object_inline_message_2337.childLanes = + (JSCompiler_object_inline_message_2323.memoizedState = + JSCompiler_object_inline_digest_2324), + (JSCompiler_object_inline_message_2323.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2340, + JSCompiler_object_inline_componentStack_2326, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2339 + JSCompiler_object_inline_stack_2325 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2339.children + children: JSCompiler_object_inline_stack_2325.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2340 = + ((JSCompiler_object_inline_componentStack_2326 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2340 + null === JSCompiler_object_inline_componentStack_2326 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2340.push(current)); + : JSCompiler_object_inline_componentStack_2326.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10485,7 +10626,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10774,6 +10919,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10784,128 +10939,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10913,101 +11482,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -11081,351 +11555,98 @@ selectionRange: JSCompiler_temp }; _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - if ( - 0 !== (flags & 4) && - ((finishedWork = finishedWork.updateQueue), - (finishedWork = null !== finishedWork ? finishedWork.events : null), - null !== finishedWork) - ) - for (current = 0; current < finishedWork.length; current++) - (flags = finishedWork[current]), - (flags.ref.impl = flags.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((firstChild = nextEffect), + (root = firstChild.child), + 0 !== (firstChild.subtreeFlags & 1028) && null !== root) + ) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + if ( + 0 !== (anchorOffset & 4) && + ((root = root.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11441,17 +11662,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11465,21 +11696,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11487,11 +11722,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11507,59 +11738,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11567,11 +11803,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11581,11 +11813,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11608,78 +11836,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11759,14 +11915,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11812,7 +11991,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11822,14 +12003,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11897,7 +12082,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11946,74 +12135,53 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { + function commitMutationEffectsOnFiber(finishedWork, root) { var current = finishedWork.alternate, flags = finishedWork.flags; switch (finishedWork.tag) { @@ -12021,53 +12189,31 @@ case 11: case 14: case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$10 - ); - } - } + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, + finishedWork, + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -12084,116 +12230,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -12202,9 +12350,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -12219,117 +12367,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -12338,23 +12454,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -12362,7 +12481,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -12371,13 +12490,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -12387,12 +12506,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12408,15 +12527,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12424,13 +12543,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12439,47 +12558,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12510,7 +12628,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12521,7 +12639,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12529,52 +12647,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12594,27 +12667,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12697,24 +12756,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12731,7 +12794,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12740,9 +12803,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12779,9 +12866,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12789,22 +12874,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12835,9 +12904,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12884,9 +12951,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12895,18 +12962,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12950,9 +13015,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12985,9 +13048,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12997,11 +13060,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -13039,62 +13100,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -13155,25 +13199,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -13190,11 +13215,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -13238,7 +13259,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -13268,22 +13289,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -13296,31 +13332,6 @@ } } } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -13400,7 +13411,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13453,7 +13465,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13675,13 +13688,26 @@ (resource.state.loading & Inserted) !== NotLoaded ) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if ( + ((workInProgress.flags |= 16777216), !preloadResource(resource)) + ) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -14668,7 +14694,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14710,7 +14737,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14735,7 +14763,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14767,7 +14800,12 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -14783,7 +14821,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14817,7 +14856,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14829,7 +14869,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14842,7 +14883,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14897,7 +14939,8 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14916,7 +14959,7 @@ didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14964,26 +15007,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -15013,13 +15061,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -15072,6 +15125,12 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressDeferredLane = @@ -15108,12 +15167,7 @@ current = null; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? SuspendedOnData - : SuspendedOnImmediate)) + (workInProgressSuspendedReason = SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = SuspendedOnInstance)) @@ -15164,21 +15218,6 @@ ); } } - function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; - } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -15197,7 +15236,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -15252,8 +15292,8 @@ } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -15393,8 +15433,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -15519,43 +15559,25 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || workInProgressSuspendedReason === SuspendedOnError + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15589,6 +15611,38 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, @@ -15792,55 +15846,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15986,6 +16025,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -19444,6 +19484,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -19467,6 +19539,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19667,6 +19760,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function getBoundingRect(node) { node = node.getBoundingClientRect(); return { @@ -19770,6 +19869,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -20486,6 +20616,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -22571,6 +22702,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -24153,84 +24291,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -24298,6 +24366,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24317,7 +24448,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -24373,6 +24504,8 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24949,11 +25082,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24990,11 +25123,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25304,5 +25437,5 @@ } }; }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js index f126ef43e4d07..bc9e62799dd62 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js @@ -597,28 +597,37 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -689,6 +698,7 @@ function markRootFinished(root, remainingLanes, spawnedLane) { root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -700,18 +710,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -731,10 +741,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -970,8 +980,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$9 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$9 && "aria-" !== prefix$9) { + var prefix$10 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$10 && "aria-" !== prefix$10) { node.removeAttribute(name); return; } @@ -1304,15 +1314,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$15 in styles) - (styleName = styles[styleName$15]), - styles.hasOwnProperty(styleName$15) && - prevStyles[styleName$15] !== styleName && - setValueForStyle(node, styleName$15, styleName); - } else for (var styleName$16 in styles) - styles.hasOwnProperty(styleName$16) && - setValueForStyle(node, styleName$16, styles[styleName$16]); + (styleName = styles[styleName$16]), + styles.hasOwnProperty(styleName$16) && + prevStyles[styleName$16] !== styleName && + setValueForStyle(node, styleName$16, styleName); + } else + for (var styleName$17 in styles) + styles.hasOwnProperty(styleName$17) && + setValueForStyle(node, styleName$17, styles[styleName$17]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2041,19 +2051,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$291; + var JSCompiler_inline_result$jscomp$284; if (canUseDOM) { - var isSupported$jscomp$inline_430 = "oninput" in document; - if (!isSupported$jscomp$inline_430) { - var element$jscomp$inline_431 = document.createElement("div"); - element$jscomp$inline_431.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_430 = - "function" === typeof element$jscomp$inline_431.oninput; + var isSupported$jscomp$inline_423 = "oninput" in document; + if (!isSupported$jscomp$inline_423) { + var element$jscomp$inline_424 = document.createElement("div"); + element$jscomp$inline_424.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_423 = + "function" === typeof element$jscomp$inline_424.oninput; } - JSCompiler_inline_result$jscomp$291 = isSupported$jscomp$inline_430; - } else JSCompiler_inline_result$jscomp$291 = !1; + JSCompiler_inline_result$jscomp$284 = isSupported$jscomp$inline_423; + } else JSCompiler_inline_result$jscomp$284 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$291 && + JSCompiler_inline_result$jscomp$284 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3987,7 +3997,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$54 = !1; + didReadFromEntangledAsyncAction$55 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4008,11 +4018,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$55 = !0); continue; } else (updateLane = { @@ -4058,7 +4068,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4256,8 +4266,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$60) { - onActionError(actionQueue, node, error$60); + } catch (error$61) { + onActionError(actionQueue, node, error$61); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4695,14 +4705,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$63 = enqueueUpdate(provider, fiber, lane); - null !== root$63 && - (scheduleUpdateOnFiber(root$63, provider, lane), - entangleTransitions(root$63, provider, lane)); + var root$64 = enqueueUpdate(provider, fiber, lane); + null !== root$64 && + (scheduleUpdateOnFiber(root$64, provider, lane), + entangleTransitions(root$64, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$63 && + null !== root$64 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5129,6 +5139,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5171,9 +5283,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -5184,9 +5296,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$68) { + } catch (e$70) { setTimeout(function () { - throw e$68; + throw e$70; }); } } @@ -7526,113 +7638,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$112 in Component) - void 0 === newProps[propName$112] && - (newProps[propName$112] = Component[propName$112]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7688,8 +7752,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$113) { - captureCommitPhaseError(current, nearestMountedAncestor, error$113); + } catch (error$115) { + captureCommitPhaseError(current, nearestMountedAncestor, error$115); } else ref.current = null; } @@ -7700,32 +7764,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode; + selection = selection.focusOffset; + try { + JSCompiler_temp.nodeType, focusNode.nodeType; + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7781,69 +7949,82 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + if ( + 0 !== (root & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7853,85 +8034,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7940,7 +8045,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7963,11 +8068,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } } @@ -8001,11 +8106,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8059,75 +8181,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -8175,8 +8228,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8185,35 +8242,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$123 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$123; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8242,18 +8319,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$123 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$123 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$123 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8359,39 +8436,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8409,19 +8482,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8446,56 +8510,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8503,36 +8566,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8540,16 +8603,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8564,64 +8627,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$128) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$128 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8630,24 +8692,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$131) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$131); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8656,12 +8715,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8675,8 +8734,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$133) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$133); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8707,15 +8766,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8723,13 +8782,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8738,45 +8797,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$117) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$117 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8826,11 +8884,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8843,21 +8901,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$118 = JSCompiler_inline_result.stateNode; + var parent$116 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$118, ""), + (setTextContent(parent$116, ""), (JSCompiler_inline_result.flags &= -33)); - var before$119 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$119, parent$118); + var before$117 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$117, parent$116); break; case 3: case 4: - var parent$120 = JSCompiler_inline_result.stateNode.containerInfo, - before$121 = getHostSibling(finishedWork); + var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, + before$119 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$121, - parent$120 + before$119, + parent$118 ); break; default: @@ -8946,7 +9004,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8954,23 +9012,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8988,7 +9053,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8997,6 +9062,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9027,13 +9109,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9089,7 +9164,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -9186,7 +9261,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9704,13 +9779,24 @@ function markUpdate(workInProgress) { function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4)) workInProgress.flags &= -16777217; - else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) - if (shouldRemainOnPreviousScreen()) workInProgress.flags |= 8192; - else + else if (((workInProgress.flags |= 16777216), !preloadResource(resource))) { + resource = suspenseHandlerStackCursor.current; + if ( + null !== resource && + ((workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null !== shellBoundary + : ((workInProgressRootRenderLanes & 62914560) !== + workInProgressRootRenderLanes && + 0 === (workInProgressRootRenderLanes & 536870912)) || + resource !== shellBoundary) + ) throw ( ((suspendedThenable = noopSuspenseyCommitThenable), SuspenseyCommitException) ); + workInProgress.flags |= 8192; + } } function scheduleRetryEffect(workInProgress, retryQueue) { null !== retryQueue @@ -9735,14 +9821,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$143 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$143 = lastTailNode), + for (var lastTailNode$136 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$136 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$143 + null === lastTailNode$136 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$143.sibling = null); + : (lastTailNode$136.sibling = null); } } function bubbleProperties(completedWork) { @@ -9752,19 +9838,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags & 31457280), - (subtreeFlags |= child$144.flags & 31457280), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (var child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags & 31457280), + (subtreeFlags |= child$137.flags & 31457280), + (child$137.return = completedWork), + (child$137 = child$137.sibling); else - for (child$144 = completedWork.child; null !== child$144; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags), - (subtreeFlags |= child$144.flags), - (child$144.return = completedWork), - (child$144 = child$144.sibling); + for (child$137 = completedWork.child; null !== child$137; ) + (newChildLanes |= child$137.lanes | child$137.childLanes), + (subtreeFlags |= child$137.subtreeFlags), + (subtreeFlags |= child$137.flags), + (child$137.return = completedWork), + (child$137 = child$137.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10041,11 +10127,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$156 = null; + var cache$149 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$156 = newProps.memoizedState.cachePool.pool); - cache$156 !== type && (newProps.flags |= 2048); + (cache$149 = newProps.memoizedState.cachePool.pool); + cache$149 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10070,8 +10156,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$156 = type.rendering; - if (null === cache$156) + cache$149 = type.rendering; + if (null === cache$149) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10079,11 +10165,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$156 = findFirstSuspended(current); - if (null !== cache$156) { + cache$149 = findFirstSuspended(current); + if (null !== cache$149) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$156.updateQueue; + current = cache$149.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10108,7 +10194,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$156)), null !== current)) { + if (((current = findFirstSuspended(cache$149)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10118,7 +10204,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$156.alternate && + !cache$149.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10131,13 +10217,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$156.sibling = workInProgress.child), - (workInProgress.child = cache$156)) + ? ((cache$149.sibling = workInProgress.child), + (workInProgress.child = cache$149)) : ((current = type.last), null !== current - ? (current.sibling = cache$156) - : (workInProgress.child = cache$156), - (type.last = cache$156)); + ? (current.sibling = cache$149) + : (workInProgress.child = cache$149), + (type.last = cache$149)); } if (null !== type.tail) return ( @@ -10496,6 +10582,8 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10546,7 +10634,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10557,7 +10646,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10579,7 +10669,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10611,7 +10707,12 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -10627,7 +10728,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10649,7 +10751,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10661,7 +10764,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10674,7 +10778,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10726,7 +10831,8 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10745,7 +10851,7 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10793,25 +10899,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -10838,13 +10947,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10897,6 +11011,10 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & lanes); workInProgressRootDidAttachPingListener = !1; workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -10915,9 +11033,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10929,12 +11047,7 @@ function handleThrow(root, thrownValue) { ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = - shouldRemainOnPreviousScreen() && - 0 === (workInProgressRootSkippedLanes & 134217727) && - 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 2 - : 3)) + (workInProgressSuspendedReason = 3)) : thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = 4)) @@ -10954,21 +11067,6 @@ function handleThrow(root, thrownValue) { createCapturedValueAtFiber(thrownValue, root.current) )); } -function shouldRemainOnPreviousScreen() { - var handler = suspenseHandlerStackCursor.current; - return null === handler - ? !0 - : (workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & 62914560) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & 536870912) - ? handler === shellBoundary - : !1; -} function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = ContextOnlyDispatcher; @@ -10987,7 +11085,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function queueConcurrentError(error) { @@ -11026,8 +11125,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$172) { - handleThrow(root, thrownValue$172); + } catch (thrownValue$165) { + handleThrow(root, thrownValue$165); } while (1); lanes && root.shellSuspendCounter++; @@ -11136,8 +11235,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$174) { - handleThrow(root, thrownValue$174); + } catch (thrownValue$167) { + handleThrow(root, thrownValue$167); } while (1); resetContextDependencies(); @@ -11229,31 +11328,25 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? (isHydrating || 1 === workInProgressSuspendedReason + ? (root = !0) + : workInProgressRootIsPrerendering + ? (root = !1) + : (workInProgressRootDidSkipSuspendedSiblings = root = !0), + unwindUnitOfWork(unitOfWork, root)) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -11273,6 +11366,29 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, @@ -11395,7 +11511,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$178 = rootWithPendingPassiveEffects, + var root$171 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11434,7 +11550,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$178, remainingLanes); + releaseRootPooledCache(root$171, remainingLanes); } } return !1; @@ -11505,6 +11621,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11590,14 +11707,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$180 = firstScheduledRoot; null !== root$180; ) { + for (var root$173 = firstScheduledRoot; null !== root$173; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$180.pendingLanes; + var pendingLanes = root$173.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$180.suspendedLanes, - pingedLanes = root$180.pingedLanes; + var suspendedLanes = root$173.suspendedLanes, + pingedLanes = root$173.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11611,17 +11728,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$173, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$180, - root$180 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$173, + root$173 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$180, JSCompiler_inline_result)); - root$180 = root$180.next; + performSyncWorkOnRoot(root$173, JSCompiler_inline_result)); + root$173 = root$173.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11662,12 +11779,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11831,20 +11948,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1417 = 0; - i$jscomp$inline_1417 < simpleEventPluginEvents.length; - i$jscomp$inline_1417++ + var i$jscomp$inline_1432 = 0; + i$jscomp$inline_1432 < simpleEventPluginEvents.length; + i$jscomp$inline_1432++ ) { - var eventName$jscomp$inline_1418 = - simpleEventPluginEvents[i$jscomp$inline_1417], - domEventName$jscomp$inline_1419 = - eventName$jscomp$inline_1418.toLowerCase(), - capitalizedEvent$jscomp$inline_1420 = - eventName$jscomp$inline_1418[0].toUpperCase() + - eventName$jscomp$inline_1418.slice(1); + var eventName$jscomp$inline_1433 = + simpleEventPluginEvents[i$jscomp$inline_1432], + domEventName$jscomp$inline_1434 = + eventName$jscomp$inline_1433.toLowerCase(), + capitalizedEvent$jscomp$inline_1435 = + eventName$jscomp$inline_1433[0].toUpperCase() + + eventName$jscomp$inline_1433.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1419, - "on" + capitalizedEvent$jscomp$inline_1420 + domEventName$jscomp$inline_1434, + "on" + capitalizedEvent$jscomp$inline_1435 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13027,34 +13144,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$194 = props[hasSrc]; - if (null != propValue$194) + var propValue$187 = props[hasSrc]; + if (null != propValue$187) switch (hasSrc) { case "name": - hasSrcSet = propValue$194; + hasSrcSet = propValue$187; break; case "type": - propValue = propValue$194; + propValue = propValue$187; break; case "checked": - checked = propValue$194; + checked = propValue$187; break; case "defaultChecked": - defaultChecked = propValue$194; + defaultChecked = propValue$187; break; case "value": - propKey = propValue$194; + propKey = propValue$187; break; case "defaultValue": - defaultValue = propValue$194; + defaultValue = propValue$187; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$194) + if (null != propValue$187) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$194, props, null); + setProp(domElement, tag, hasSrc, propValue$187, props, null); } } initInput( @@ -13191,14 +13308,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$194 in props) - props.hasOwnProperty(propValue$194) && - ((hasSrc = props[propValue$194]), + for (propValue$187 in props) + props.hasOwnProperty(propValue$187) && + ((hasSrc = props[propValue$187]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$194, + propValue$187, hasSrc, props, void 0 @@ -13246,14 +13363,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$211 in nextProps) { - var propKey = nextProps[propKey$211]; - lastProp = lastProps[propKey$211]; + for (var propKey$204 in nextProps) { + var propKey = nextProps[propKey$204]; + lastProp = lastProps[propKey$204]; if ( - nextProps.hasOwnProperty(propKey$211) && + nextProps.hasOwnProperty(propKey$204) && (null != propKey || null != lastProp) ) - switch (propKey$211) { + switch (propKey$204) { case "type": type = propKey; break; @@ -13282,7 +13399,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$211, + propKey$204, propKey, nextProps, lastProp @@ -13301,7 +13418,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$211 = null; + propKey = value = defaultValue = propKey$204 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13332,7 +13449,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$211 = type; + propKey$204 = type; break; case "defaultValue": defaultValue = type; @@ -13353,15 +13470,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$211 - ? updateOptions(domElement, !!lastProps, propKey$211, !1) + null != propKey$204 + ? updateOptions(domElement, !!lastProps, propKey$204, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$211 = null; + propKey = propKey$204 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13385,7 +13502,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$211 = name; + propKey$204 = name; break; case "defaultValue": propKey = name; @@ -13399,17 +13516,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$211, propKey); + updateTextarea(domElement, propKey$204, propKey); return; case "option": - for (var propKey$227 in lastProps) + for (var propKey$220 in lastProps) if ( - ((propKey$211 = lastProps[propKey$227]), - lastProps.hasOwnProperty(propKey$227) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$227)) + ((propKey$204 = lastProps[propKey$220]), + lastProps.hasOwnProperty(propKey$220) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$220)) ) - switch (propKey$227) { + switch (propKey$220) { case "selected": domElement.selected = !1; break; @@ -13417,33 +13534,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$227, + propKey$220, null, nextProps, - propKey$211 + propKey$204 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$211 = nextProps[lastDefaultValue]), + ((propKey$204 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$211 !== propKey && - (null != propKey$211 || null != propKey)) + propKey$204 !== propKey && + (null != propKey$204 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$211 && - "function" !== typeof propKey$211 && - "symbol" !== typeof propKey$211; + propKey$204 && + "function" !== typeof propKey$204 && + "symbol" !== typeof propKey$204; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$211, + propKey$204, nextProps, propKey ); @@ -13464,24 +13581,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$232 in lastProps) - (propKey$211 = lastProps[propKey$232]), - lastProps.hasOwnProperty(propKey$232) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$232) && - setProp(domElement, tag, propKey$232, null, nextProps, propKey$211); + for (var propKey$225 in lastProps) + (propKey$204 = lastProps[propKey$225]), + lastProps.hasOwnProperty(propKey$225) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$225) && + setProp(domElement, tag, propKey$225, null, nextProps, propKey$204); for (checked in nextProps) if ( - ((propKey$211 = nextProps[checked]), + ((propKey$204 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$211 !== propKey && - (null != propKey$211 || null != propKey)) + propKey$204 !== propKey && + (null != propKey$204 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$211) + if (null != propKey$204) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13489,7 +13606,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$211, + propKey$204, nextProps, propKey ); @@ -13497,49 +13614,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$237 in lastProps) - (propKey$211 = lastProps[propKey$237]), - lastProps.hasOwnProperty(propKey$237) && - void 0 !== propKey$211 && - !nextProps.hasOwnProperty(propKey$237) && + for (var propKey$230 in lastProps) + (propKey$204 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + void 0 !== propKey$204 && + !nextProps.hasOwnProperty(propKey$230) && setPropOnCustomElement( domElement, tag, - propKey$237, + propKey$230, void 0, nextProps, - propKey$211 + propKey$204 ); for (defaultChecked in nextProps) - (propKey$211 = nextProps[defaultChecked]), + (propKey$204 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$211 === propKey || - (void 0 === propKey$211 && void 0 === propKey) || + propKey$204 === propKey || + (void 0 === propKey$204 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$211, + propKey$204, nextProps, propKey ); return; } } - for (var propKey$242 in lastProps) - (propKey$211 = lastProps[propKey$242]), - lastProps.hasOwnProperty(propKey$242) && - null != propKey$211 && - !nextProps.hasOwnProperty(propKey$242) && - setProp(domElement, tag, propKey$242, null, nextProps, propKey$211); + for (var propKey$235 in lastProps) + (propKey$204 = lastProps[propKey$235]), + lastProps.hasOwnProperty(propKey$235) && + null != propKey$204 && + !nextProps.hasOwnProperty(propKey$235) && + setProp(domElement, tag, propKey$235, null, nextProps, propKey$204); for (lastProp in nextProps) - (propKey$211 = nextProps[lastProp]), + (propKey$204 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$211 === propKey || - (null == propKey$211 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$211, nextProps, propKey); + propKey$204 === propKey || + (null == propKey$204 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$204, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14141,26 +14258,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$250 = getResourcesFromRoot( + var styles$243 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$251 = styles$250.get(type); - resource$251 || + resource$244 = styles$243.get(type); + resource$244 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$251 = { + (resource$244 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$250.set(type, resource$251), - (styles$250 = JSCompiler_inline_result.querySelector( + styles$243.set(type, resource$244), + (styles$243 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$250._p && - ((resource$251.instance = styles$250), - (resource$251.state.loading = 5)), + !styles$243._p && + ((resource$244.instance = styles$243), + (resource$244.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14173,16 +14290,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$250 || + styles$243 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$251.state + resource$244.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$251; + return resource$244; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14279,37 +14396,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$256 = hoistableRoot.querySelector( + var instance$249 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$256) + if (instance$249) return ( (resource.state.loading |= 4), - (resource.instance = instance$256), - markNodeAsHoistable(instance$256), - instance$256 + (resource.instance = instance$249), + markNodeAsHoistable(instance$249), + instance$249 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$256 = ( + instance$249 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$256); - var linkInstance = instance$256; + markNodeAsHoistable(instance$249); + var linkInstance = instance$249; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$256, "link", instance); + setInitialProperties(instance$249, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$256, props.precedence, hoistableRoot); - return (resource.instance = instance$256); + insertStylesheet(instance$249, props.precedence, hoistableRoot); + return (resource.instance = instance$249); case "script": - instance$256 = getScriptKey(props.src); + instance$249 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$256) + getScriptSelectorFromKey(instance$249) )) ) return ( @@ -14318,7 +14435,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$256))) + if ((styleProps = preloadPropsMap.get(instance$249))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14641,6 +14758,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15341,16 +15459,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1664 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1679 = React.version; if ( - "19.0.0-experimental-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1664 + "19.0.0-experimental-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1679 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1664, - "19.0.0-experimental-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1679, + "19.0.0-experimental-a03254bc-20240905" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15370,25 +15488,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2077 = { +var internals$jscomp$inline_2125 = { bundleType: 0, - version: "19.0.0-experimental-7771d3a7-20240827", + version: "19.0.0-experimental-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-7771d3a7-20240827" + reconcilerVersion: "19.0.0-experimental-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2078 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2126 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2078.isDisabled && - hook$jscomp$inline_2078.supportsFiber + !hook$jscomp$inline_2126.isDisabled && + hook$jscomp$inline_2126.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2078.inject( - internals$jscomp$inline_2077 + (rendererID = hook$jscomp$inline_2126.inject( + internals$jscomp$inline_2125 )), - (injectedHook = hook$jscomp$inline_2078); + (injectedHook = hook$jscomp$inline_2126); } catch (err) {} } exports.createComponentSelector = function (component) { @@ -15631,4 +15749,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js index b45f16a4441fa..f751f337b2990 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js index 8c5bd8d2651e9..5834b54db6c1e 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js index d57323bc53c71..178d66fb0f637 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js index 5c57438156f5f..d3fdc9dfc4c8a 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index 05d7b4f62c03a..d2d08dcd38386 100644 --- a/packages/next/src/compiled/react-dom-experimental/package.json +++ b/packages/next/src/compiled/react-dom-experimental/package.json @@ -72,10 +72,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.0.0-experimental-7771d3a7-20240827" + "scheduler": "0.0.0-experimental-a03254bc-20240905" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827" + "react": "0.0.0-experimental-a03254bc-20240905" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js index 17b494b4e35fc..ecc8e4ff8ce75 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js @@ -1010,28 +1010,37 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -1110,6 +1119,7 @@ root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -3901,6 +3911,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5695,6 +5760,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -7132,60 +7205,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error, errorInfo) { reportGlobalError(error); @@ -7787,8 +7928,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8017,8 +8158,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8447,32 +8588,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2299; - var JSCompiler_object_inline_stack_2300 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2273; + var JSCompiler_object_inline_stack_2274 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2301 = !1; + var JSCompiler_object_inline_componentStack_2275 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2299 = didSuspend) || - (JSCompiler_object_inline_digest_2299 = + (JSCompiler_object_inline_digest_2273 = didSuspend) || + (JSCompiler_object_inline_digest_2273 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2299 && - ((JSCompiler_object_inline_componentStack_2301 = !0), + JSCompiler_object_inline_digest_2273 && + ((JSCompiler_object_inline_componentStack_2275 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2299 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2273 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2275 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2298 = nextHydratableInstance; + var JSCompiler_object_inline_message_2272 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2298)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2272)) { c: { - var instance = JSCompiler_object_inline_message_2298; + var instance = JSCompiler_object_inline_message_2272; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8513,19 +8654,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2272 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2298 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2272 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2298 && - ((JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_message_2298.dehydrated), - null !== JSCompiler_object_inline_message_2298) + null !== JSCompiler_object_inline_message_2272 && + ((JSCompiler_object_inline_message_2272 = + JSCompiler_object_inline_message_2272.dehydrated), + null !== JSCompiler_object_inline_message_2272) ) return ( - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2272.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8533,58 +8674,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_stack_2300.children; - JSCompiler_object_inline_stack_2300 = - JSCompiler_object_inline_stack_2300.fallback; - if (JSCompiler_object_inline_componentStack_2301) + JSCompiler_object_inline_message_2272 = + JSCompiler_object_inline_stack_2274.children; + JSCompiler_object_inline_stack_2274 = + JSCompiler_object_inline_stack_2274.fallback; + if (JSCompiler_object_inline_componentStack_2275) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_componentStack_2275 = workInProgress.mode), - (JSCompiler_object_inline_message_2298 = + (JSCompiler_object_inline_message_2272 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2298 + children: JSCompiler_object_inline_message_2272 }, - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2275 )), - (JSCompiler_object_inline_stack_2300 = createFiberFromFragment( - JSCompiler_object_inline_stack_2300, - JSCompiler_object_inline_componentStack_2301, + (JSCompiler_object_inline_stack_2274 = createFiberFromFragment( + JSCompiler_object_inline_stack_2274, + JSCompiler_object_inline_componentStack_2275, renderLanes, null )), - (JSCompiler_object_inline_message_2298.return = workInProgress), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_message_2298.sibling = - JSCompiler_object_inline_stack_2300), - (workInProgress.child = JSCompiler_object_inline_message_2298), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_message_2272.return = workInProgress), + (JSCompiler_object_inline_stack_2274.return = workInProgress), + (JSCompiler_object_inline_message_2272.sibling = + JSCompiler_object_inline_stack_2274), + (workInProgress.child = JSCompiler_object_inline_message_2272), + (JSCompiler_object_inline_componentStack_2275 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2301.memoizedState = + (JSCompiler_object_inline_componentStack_2275.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2301.childLanes = + (JSCompiler_object_inline_componentStack_2275.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2273, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2274 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2272 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2298 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2298) + ((JSCompiler_object_inline_message_2272 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2272) ) { if (didSuspend) workInProgress.flags & 256 @@ -8601,94 +8742,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = - JSCompiler_object_inline_stack_2300.fallback), - (JSCompiler_object_inline_message_2298 = workInProgress.mode), - (JSCompiler_object_inline_stack_2300 = + (JSCompiler_object_inline_componentStack_2275 = + JSCompiler_object_inline_stack_2274.fallback), + (JSCompiler_object_inline_message_2272 = workInProgress.mode), + (JSCompiler_object_inline_stack_2274 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2274.children }, - JSCompiler_object_inline_message_2298 + JSCompiler_object_inline_message_2272 )), - (JSCompiler_object_inline_componentStack_2301 = + (JSCompiler_object_inline_componentStack_2275 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2301, - JSCompiler_object_inline_message_2298, + JSCompiler_object_inline_componentStack_2275, + JSCompiler_object_inline_message_2272, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2301.flags |= 2), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_componentStack_2301.return = + (JSCompiler_object_inline_componentStack_2275.flags |= 2), + (JSCompiler_object_inline_stack_2274.return = workInProgress), + (JSCompiler_object_inline_componentStack_2275.return = workInProgress), - (JSCompiler_object_inline_stack_2300.sibling = - JSCompiler_object_inline_componentStack_2301), - (workInProgress.child = JSCompiler_object_inline_stack_2300), + (JSCompiler_object_inline_stack_2274.sibling = + JSCompiler_object_inline_componentStack_2275), + (workInProgress.child = JSCompiler_object_inline_stack_2274), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2300 = workInProgress.child), - (JSCompiler_object_inline_stack_2300.memoizedState = + (JSCompiler_object_inline_stack_2274 = workInProgress.child), + (JSCompiler_object_inline_stack_2274.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2300.childLanes = + (JSCompiler_object_inline_stack_2274.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2273, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2301)); + JSCompiler_object_inline_componentStack_2275)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2272.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2299 = - JSCompiler_object_inline_message_2298.nextSibling && - JSCompiler_object_inline_message_2298.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2299) { - JSCompiler_temp = JSCompiler_object_inline_digest_2299.dgst; - var message = JSCompiler_object_inline_digest_2299.msg; - instance = JSCompiler_object_inline_digest_2299.stck; - var componentStack = JSCompiler_object_inline_digest_2299.cstck; + JSCompiler_object_inline_digest_2273 = + JSCompiler_object_inline_message_2272.nextSibling && + JSCompiler_object_inline_message_2272.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2273) { + JSCompiler_temp = JSCompiler_object_inline_digest_2273.dgst; + var message = JSCompiler_object_inline_digest_2273.msg; + instance = JSCompiler_object_inline_digest_2273.stck; + var componentStack = JSCompiler_object_inline_digest_2273.cstck; } - JSCompiler_object_inline_message_2298 = message; - JSCompiler_object_inline_digest_2299 = JSCompiler_temp; - JSCompiler_object_inline_stack_2300 = instance; - JSCompiler_object_inline_componentStack_2301 = componentStack; - JSCompiler_object_inline_message_2298 = - JSCompiler_object_inline_message_2298 - ? Error(JSCompiler_object_inline_message_2298) + JSCompiler_object_inline_message_2272 = message; + JSCompiler_object_inline_digest_2273 = JSCompiler_temp; + JSCompiler_object_inline_stack_2274 = instance; + JSCompiler_object_inline_componentStack_2275 = componentStack; + JSCompiler_object_inline_message_2272 = + JSCompiler_object_inline_message_2272 + ? Error(JSCompiler_object_inline_message_2272) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2298.stack = - JSCompiler_object_inline_stack_2300 || ""; - JSCompiler_object_inline_message_2298.digest = - JSCompiler_object_inline_digest_2299; - JSCompiler_object_inline_digest_2299 = - void 0 === JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_message_2272.stack = + JSCompiler_object_inline_stack_2274 || ""; + JSCompiler_object_inline_message_2272.digest = + JSCompiler_object_inline_digest_2273; + JSCompiler_object_inline_digest_2273 = + void 0 === JSCompiler_object_inline_componentStack_2275 ? null - : JSCompiler_object_inline_componentStack_2301; - "string" === typeof JSCompiler_object_inline_digest_2299 && + : JSCompiler_object_inline_componentStack_2275; + "string" === typeof JSCompiler_object_inline_digest_2273 && CapturedStacks.set( - JSCompiler_object_inline_message_2298, - JSCompiler_object_inline_digest_2299 + JSCompiler_object_inline_message_2272, + JSCompiler_object_inline_digest_2273 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2298, + value: JSCompiler_object_inline_message_2272, source: null, - stack: JSCompiler_object_inline_digest_2299 + stack: JSCompiler_object_inline_digest_2273 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8696,25 +8837,25 @@ renderLanes ); } else if ( - ((JSCompiler_object_inline_digest_2299 = + ((JSCompiler_object_inline_digest_2273 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2299) + didReceiveUpdate || JSCompiler_object_inline_digest_2273) ) { - JSCompiler_object_inline_digest_2299 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2299) { - JSCompiler_object_inline_stack_2300 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2300 & 42)) - JSCompiler_object_inline_stack_2300 = 1; + JSCompiler_object_inline_digest_2273 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2273) { + JSCompiler_object_inline_stack_2274 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2274 & 42)) + JSCompiler_object_inline_stack_2274 = 1; else - switch (JSCompiler_object_inline_stack_2300) { + switch (JSCompiler_object_inline_stack_2274) { case 2: - JSCompiler_object_inline_stack_2300 = 1; + JSCompiler_object_inline_stack_2274 = 1; break; case 8: - JSCompiler_object_inline_stack_2300 = 4; + JSCompiler_object_inline_stack_2274 = 4; break; case 32: - JSCompiler_object_inline_stack_2300 = 16; + JSCompiler_object_inline_stack_2274 = 16; break; case 128: case 256: @@ -8735,40 +8876,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2300 = 64; + JSCompiler_object_inline_stack_2274 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2300 = 134217728; + JSCompiler_object_inline_stack_2274 = 134217728; break; default: - JSCompiler_object_inline_stack_2300 = 0; + JSCompiler_object_inline_stack_2274 = 0; } - JSCompiler_object_inline_stack_2300 = + JSCompiler_object_inline_stack_2274 = 0 !== - (JSCompiler_object_inline_stack_2300 & - (JSCompiler_object_inline_digest_2299.suspendedLanes | + (JSCompiler_object_inline_stack_2274 & + (JSCompiler_object_inline_digest_2273.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2300; + : JSCompiler_object_inline_stack_2274; if ( - 0 !== JSCompiler_object_inline_stack_2300 && - JSCompiler_object_inline_stack_2300 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2274 && + JSCompiler_object_inline_stack_2274 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2300), + ((prevState.retryLane = JSCompiler_object_inline_stack_2274), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2274 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2273, current, - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2274 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2272.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8776,7 +8917,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2298.data === + JSCompiler_object_inline_message_2272.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8784,12 +8925,12 @@ null, current )), - (JSCompiler_object_inline_message_2298._reactRetry = + (JSCompiler_object_inline_message_2272._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2298.nextSibling + JSCompiler_object_inline_message_2272.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -8807,57 +8948,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2300.children + JSCompiler_object_inline_stack_2274.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2301) + if (JSCompiler_object_inline_componentStack_2275) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2301 = - JSCompiler_object_inline_stack_2300.fallback), - (JSCompiler_object_inline_message_2298 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2275 = + JSCompiler_object_inline_stack_2274.fallback), + (JSCompiler_object_inline_message_2272 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2300 = createWorkInProgress( + (JSCompiler_object_inline_stack_2274 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2274.children } )), - (JSCompiler_object_inline_stack_2300.subtreeFlags = + (JSCompiler_object_inline_stack_2274.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2301 = + ? (JSCompiler_object_inline_componentStack_2275 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2301 + JSCompiler_object_inline_componentStack_2275 )) - : ((JSCompiler_object_inline_componentStack_2301 = + : ((JSCompiler_object_inline_componentStack_2275 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2301, - JSCompiler_object_inline_message_2298, + JSCompiler_object_inline_componentStack_2275, + JSCompiler_object_inline_message_2272, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2301.flags |= 2)), - (JSCompiler_object_inline_componentStack_2301.return = + (JSCompiler_object_inline_componentStack_2275.flags |= 2)), + (JSCompiler_object_inline_componentStack_2275.return = workInProgress), - (JSCompiler_object_inline_stack_2300.return = workInProgress), - (JSCompiler_object_inline_stack_2300.sibling = - JSCompiler_object_inline_componentStack_2301), - (workInProgress.child = JSCompiler_object_inline_stack_2300), - (JSCompiler_object_inline_stack_2300 = - JSCompiler_object_inline_componentStack_2301), - (JSCompiler_object_inline_componentStack_2301 = workInProgress.child), - (JSCompiler_object_inline_message_2298 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2298 - ? (JSCompiler_object_inline_message_2298 = + (JSCompiler_object_inline_stack_2274.return = workInProgress), + (JSCompiler_object_inline_stack_2274.sibling = + JSCompiler_object_inline_componentStack_2275), + (workInProgress.child = JSCompiler_object_inline_stack_2274), + (JSCompiler_object_inline_stack_2274 = + JSCompiler_object_inline_componentStack_2275), + (JSCompiler_object_inline_componentStack_2275 = workInProgress.child), + (JSCompiler_object_inline_message_2272 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2272 + ? (JSCompiler_object_inline_message_2272 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2298.cachePool), + JSCompiler_object_inline_message_2272.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -8865,37 +9006,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2298 = { + (JSCompiler_object_inline_message_2272 = { baseLanes: - JSCompiler_object_inline_message_2298.baseLanes | renderLanes, + JSCompiler_object_inline_message_2272.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2301.memoizedState = - JSCompiler_object_inline_message_2298), - (JSCompiler_object_inline_componentStack_2301.childLanes = + (JSCompiler_object_inline_componentStack_2275.memoizedState = + JSCompiler_object_inline_message_2272), + (JSCompiler_object_inline_componentStack_2275.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2299, + JSCompiler_object_inline_digest_2273, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2300 + JSCompiler_object_inline_stack_2274 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2300.children + children: JSCompiler_object_inline_stack_2274.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2299 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2299 + ((JSCompiler_object_inline_digest_2273 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2273 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2299.push(current)); + : JSCompiler_object_inline_digest_2273.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10095,7 +10236,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -10383,6 +10528,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10393,128 +10548,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10522,101 +11091,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -10688,344 +11162,87 @@ selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + }; + _enabled = !1; + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((firstChild = nextEffect), + (root = firstChild.child), + 0 !== (firstChild.subtreeFlags & 1028) && null !== root) + ) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11041,17 +11258,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11065,21 +11292,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11087,11 +11318,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11107,59 +11334,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11167,11 +11399,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11181,11 +11409,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11208,78 +11432,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11359,14 +11511,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11412,7 +11587,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11422,14 +11599,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11497,7 +11678,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11546,128 +11731,85 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); - } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + } + function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11684,116 +11826,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -11802,9 +11946,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -11819,117 +11963,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -11938,23 +12050,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -11962,7 +12077,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -11971,13 +12086,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -11987,12 +12102,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12008,15 +12123,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12024,13 +12139,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12039,47 +12154,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12110,7 +12224,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12121,7 +12235,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12129,52 +12243,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12194,27 +12263,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12297,24 +12352,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12331,7 +12390,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12340,9 +12399,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12379,9 +12462,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12389,22 +12470,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12435,9 +12500,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12484,9 +12547,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12495,18 +12558,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12550,9 +12611,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12585,9 +12644,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12597,11 +12656,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12639,62 +12696,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -12755,25 +12795,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -12790,11 +12811,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12838,7 +12855,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12868,22 +12885,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -12896,31 +12928,6 @@ } } } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -12994,7 +13001,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13047,7 +13055,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -14078,7 +14087,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14120,7 +14130,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14145,7 +14156,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14177,7 +14193,12 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -14193,7 +14214,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14227,7 +14249,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14239,7 +14262,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14252,7 +14276,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14307,7 +14332,8 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14326,7 +14352,7 @@ didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14374,26 +14400,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14423,13 +14454,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14482,7 +14518,8 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -14607,7 +14644,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -14657,8 +14695,8 @@ } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -14798,8 +14836,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -14924,43 +14962,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -14994,6 +15009,38 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, @@ -15197,55 +15244,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15391,6 +15423,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -18838,6 +18871,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -18861,6 +18926,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19061,6 +19147,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19099,6 +19191,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -19847,6 +19970,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -21889,6 +22013,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23430,84 +23561,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23575,6 +23636,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23594,7 +23718,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -23645,6 +23769,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24221,11 +24346,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24262,11 +24387,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24410,7 +24535,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js index 1adfa7be203f6..333193fd7dc9c 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js @@ -595,28 +595,37 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -687,6 +696,7 @@ function markRootFinished(root, remainingLanes, spawnedLane) { root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -698,18 +708,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -729,10 +739,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -882,8 +892,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$9 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$9 && "aria-" !== prefix$9) { + var prefix$10 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$10 && "aria-" !== prefix$10) { node.removeAttribute(name); return; } @@ -1216,15 +1226,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$15 in styles) - (styleName = styles[styleName$15]), - styles.hasOwnProperty(styleName$15) && - prevStyles[styleName$15] !== styleName && - setValueForStyle(node, styleName$15, styleName); - } else for (var styleName$16 in styles) - styles.hasOwnProperty(styleName$16) && - setValueForStyle(node, styleName$16, styles[styleName$16]); + (styleName = styles[styleName$16]), + styles.hasOwnProperty(styleName$16) && + prevStyles[styleName$16] !== styleName && + setValueForStyle(node, styleName$16, styleName); + } else + for (var styleName$17 in styles) + styles.hasOwnProperty(styleName$17) && + setValueForStyle(node, styleName$17, styles[styleName$17]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1953,19 +1963,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$286; + var JSCompiler_inline_result$jscomp$279; if (canUseDOM) { - var isSupported$jscomp$inline_422 = "oninput" in document; - if (!isSupported$jscomp$inline_422) { - var element$jscomp$inline_423 = document.createElement("div"); - element$jscomp$inline_423.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_422 = - "function" === typeof element$jscomp$inline_423.oninput; + var isSupported$jscomp$inline_415 = "oninput" in document; + if (!isSupported$jscomp$inline_415) { + var element$jscomp$inline_416 = document.createElement("div"); + element$jscomp$inline_416.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_415 = + "function" === typeof element$jscomp$inline_416.oninput; } - JSCompiler_inline_result$jscomp$286 = isSupported$jscomp$inline_422; - } else JSCompiler_inline_result$jscomp$286 = !1; + JSCompiler_inline_result$jscomp$279 = isSupported$jscomp$inline_415; + } else JSCompiler_inline_result$jscomp$279 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$286 && + JSCompiler_inline_result$jscomp$279 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -3855,7 +3865,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$53 = !1; + didReadFromEntangledAsyncAction$54 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3876,11 +3886,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$53 = !0); + (didReadFromEntangledAsyncAction$54 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$53 = !0); + (didReadFromEntangledAsyncAction$54 = !0); continue; } else (updateLane = { @@ -3926,7 +3936,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$53 && + didReadFromEntangledAsyncAction$54 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4124,8 +4134,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$59) { - onActionError(actionQueue, node, error$59); + } catch (error$60) { + onActionError(actionQueue, node, error$60); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4541,10 +4551,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$62 = enqueueUpdate(provider, fiber, lane); - null !== root$62 && - (scheduleUpdateOnFiber(root$62, provider, lane), - entangleTransitions(root$62, provider, lane)); + var root$63 = enqueueUpdate(provider, fiber, lane); + null !== root$63 && + (scheduleUpdateOnFiber(root$63, provider, lane), + entangleTransitions(root$63, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -4959,6 +4969,108 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; +} +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$67 in Component) + void 0 === newProps[propName$67] && + (newProps[propName$67] = Component[propName$67]); + } + return newProps; +} var reportGlobalError = "function" === typeof reportError ? reportError @@ -5001,9 +5113,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$66) { + } catch (e$68) { setTimeout(function () { - throw e$66; + throw e$68; }); } } @@ -5014,9 +5126,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$67) { + } catch (e$69) { setTimeout(function () { - throw e$67; + throw e$69; }); } } @@ -7202,113 +7314,65 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$108 in Component) - void 0 === newProps[propName$108] && - (newProps[propName$108] = Component[propName$108]); +} +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; function safelyCallComponentWillUnmount( current, nearestMountedAncestor, @@ -7364,8 +7428,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$109) { - captureCommitPhaseError(current, nearestMountedAncestor, error$109); + } catch (error$111) { + captureCommitPhaseError(current, nearestMountedAncestor, error$111); } else ref.current = null; } @@ -7376,32 +7440,136 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } -var shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$19) { +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + eventsEnabled = _enabled; + root = getActiveElementDeep(); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode; + selection = selection.focusOffset; + try { + JSCompiler_temp.nodeType, focusNode.nodeType; + } catch (e$20) { JSCompiler_temp = null; break a; } @@ -7457,59 +7625,69 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7519,85 +7697,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy)); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - finishedWork = finishedWork.updateQueue; - finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; - if (null !== finishedWork) { - var effect = (finishedWork = finishedWork.next); - do { - if ((effect.tag & flags) === flags) { - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7606,7 +7708,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 11: case 15: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitHookLayoutEffects(finishedWork, 5); + flags & 4 && commitHookEffectListMount(5, finishedWork); break; case 1: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7629,11 +7731,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$111) { + } catch (error$110) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$111 + error$110 ); } } @@ -7667,11 +7769,28 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -7725,75 +7844,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -7841,8 +7891,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -7851,35 +7905,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$119 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$119; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -7908,18 +7982,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$119 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$119 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$119 & 4) && ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, @@ -8025,39 +8099,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8075,19 +8145,10 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$123) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$123); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8112,56 +8173,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8169,36 +8229,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8206,16 +8266,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8230,64 +8290,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$124) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$124 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8296,24 +8355,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$125) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$125); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8322,12 +8378,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$128) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$128); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8341,8 +8397,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$129) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$129); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8373,15 +8429,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8389,13 +8445,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8404,45 +8460,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$113) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$113 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8492,11 +8547,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8509,21 +8564,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$114 = JSCompiler_inline_result.stateNode; + var parent$112 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$114, ""), + (setTextContent(parent$112, ""), (JSCompiler_inline_result.flags &= -33)); - var before$115 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$115, parent$114); + var before$113 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$113, parent$112); break; case 3: case 4: - var parent$116 = JSCompiler_inline_result.stateNode.containerInfo, - before$117 = getHostSibling(finishedWork); + var parent$114 = JSCompiler_inline_result.stateNode.containerInfo, + before$115 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$117, - parent$116 + before$115, + parent$114 ); break; default: @@ -8612,7 +8667,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8620,23 +8675,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -8654,7 +8716,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8663,6 +8725,23 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -8693,13 +8772,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -8755,7 +8827,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -8852,7 +8924,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: break; @@ -9401,14 +9473,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$139 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$139 = lastTailNode), + for (var lastTailNode$132 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$132 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$139 + null === lastTailNode$132 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$139.sibling = null); + : (lastTailNode$132.sibling = null); } } function bubbleProperties(completedWork) { @@ -9418,19 +9490,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$140 = completedWork.child; null !== child$140; ) - (newChildLanes |= child$140.lanes | child$140.childLanes), - (subtreeFlags |= child$140.subtreeFlags & 31457280), - (subtreeFlags |= child$140.flags & 31457280), - (child$140.return = completedWork), - (child$140 = child$140.sibling); + for (var child$133 = completedWork.child; null !== child$133; ) + (newChildLanes |= child$133.lanes | child$133.childLanes), + (subtreeFlags |= child$133.subtreeFlags & 31457280), + (subtreeFlags |= child$133.flags & 31457280), + (child$133.return = completedWork), + (child$133 = child$133.sibling); else - for (child$140 = completedWork.child; null !== child$140; ) - (newChildLanes |= child$140.lanes | child$140.childLanes), - (subtreeFlags |= child$140.subtreeFlags), - (subtreeFlags |= child$140.flags), - (child$140.return = completedWork), - (child$140 = child$140.sibling); + for (child$133 = completedWork.child; null !== child$133; ) + (newChildLanes |= child$133.lanes | child$133.childLanes), + (subtreeFlags |= child$133.subtreeFlags), + (subtreeFlags |= child$133.flags), + (child$133.return = completedWork), + (child$133 = child$133.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -9707,11 +9779,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$152 = null; + var cache$145 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$152 = newProps.memoizedState.cachePool.pool); - cache$152 !== type && (newProps.flags |= 2048); + (cache$145 = newProps.memoizedState.cachePool.pool); + cache$145 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -9736,8 +9808,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$152 = type.rendering; - if (null === cache$152) + cache$145 = type.rendering; + if (null === cache$145) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -9745,11 +9817,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$152 = findFirstSuspended(current); - if (null !== cache$152) { + cache$145 = findFirstSuspended(current); + if (null !== cache$145) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$152.updateQueue; + current = cache$145.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -9774,7 +9846,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$152)), null !== current)) { + if (((current = findFirstSuspended(cache$145)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -9784,7 +9856,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$152.alternate && + !cache$145.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -9797,13 +9869,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$152.sibling = workInProgress.child), - (workInProgress.child = cache$152)) + ? ((cache$145.sibling = workInProgress.child), + (workInProgress.child = cache$145)) : ((current = type.last), null !== current - ? (current.sibling = cache$152) - : (workInProgress.child = cache$152), - (type.last = cache$152)); + ? (current.sibling = cache$145) + : (workInProgress.child = cache$145), + (type.last = cache$145)); } if (null !== type.tail) return ( @@ -9976,6 +10048,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10026,7 +10099,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10037,7 +10111,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10059,7 +10134,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10091,7 +10172,12 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -10107,7 +10193,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10129,7 +10216,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10141,7 +10229,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10154,7 +10243,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10206,7 +10296,8 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10225,7 +10316,7 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10273,25 +10364,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -10318,13 +10412,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10377,7 +10476,8 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = @@ -10395,9 +10495,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10467,7 +10567,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -10501,8 +10602,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$167) { - handleThrow(root, thrownValue$167); + } catch (thrownValue$160) { + handleThrow(root, thrownValue$160); } while (1); lanes && root.shellSuspendCounter++; @@ -10611,8 +10712,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$169) { - handleThrow(root, thrownValue$169); + } catch (thrownValue$162) { + handleThrow(root, thrownValue$162); } while (1); resetContextDependencies(); @@ -10704,31 +10805,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } unitOfWork = completedWork.return; var next = completeWork( completedWork.alternate, @@ -10748,6 +10838,29 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, @@ -10870,7 +10983,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$173 = rootWithPendingPassiveEffects, + var root$166 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -10909,7 +11022,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$173, remainingLanes); + releaseRootPooledCache(root$166, remainingLanes); } } return !1; @@ -10980,6 +11093,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11065,14 +11179,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$175 = firstScheduledRoot; null !== root$175; ) { + for (var root$168 = firstScheduledRoot; null !== root$168; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$175.pendingLanes; + var pendingLanes = root$168.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$175.suspendedLanes, - pingedLanes = root$175.pingedLanes; + var suspendedLanes = root$168.suspendedLanes, + pingedLanes = root$168.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11086,17 +11200,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$168, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$175, - root$175 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$168, + root$168 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); - root$175 = root$175.next; + performSyncWorkOnRoot(root$168, JSCompiler_inline_result)); + root$168 = root$168.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11137,12 +11251,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11306,20 +11420,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1417 = 0; - i$jscomp$inline_1417 < simpleEventPluginEvents.length; - i$jscomp$inline_1417++ + var i$jscomp$inline_1419 = 0; + i$jscomp$inline_1419 < simpleEventPluginEvents.length; + i$jscomp$inline_1419++ ) { - var eventName$jscomp$inline_1418 = - simpleEventPluginEvents[i$jscomp$inline_1417], - domEventName$jscomp$inline_1419 = - eventName$jscomp$inline_1418.toLowerCase(), - capitalizedEvent$jscomp$inline_1420 = - eventName$jscomp$inline_1418[0].toUpperCase() + - eventName$jscomp$inline_1418.slice(1); + var eventName$jscomp$inline_1420 = + simpleEventPluginEvents[i$jscomp$inline_1419], + domEventName$jscomp$inline_1421 = + eventName$jscomp$inline_1420.toLowerCase(), + capitalizedEvent$jscomp$inline_1422 = + eventName$jscomp$inline_1420[0].toUpperCase() + + eventName$jscomp$inline_1420.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1419, - "on" + capitalizedEvent$jscomp$inline_1420 + domEventName$jscomp$inline_1421, + "on" + capitalizedEvent$jscomp$inline_1422 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -12502,34 +12616,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$189 = props[hasSrc]; - if (null != propValue$189) + var propValue$182 = props[hasSrc]; + if (null != propValue$182) switch (hasSrc) { case "name": - hasSrcSet = propValue$189; + hasSrcSet = propValue$182; break; case "type": - propValue = propValue$189; + propValue = propValue$182; break; case "checked": - checked = propValue$189; + checked = propValue$182; break; case "defaultChecked": - defaultChecked = propValue$189; + defaultChecked = propValue$182; break; case "value": - propKey = propValue$189; + propKey = propValue$182; break; case "defaultValue": - defaultValue = propValue$189; + defaultValue = propValue$182; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$189) + if (null != propValue$182) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$189, props, null); + setProp(domElement, tag, hasSrc, propValue$182, props, null); } } initInput( @@ -12666,14 +12780,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$189 in props) - props.hasOwnProperty(propValue$189) && - ((hasSrc = props[propValue$189]), + for (propValue$182 in props) + props.hasOwnProperty(propValue$182) && + ((hasSrc = props[propValue$182]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$189, + propValue$182, hasSrc, props, void 0 @@ -12721,14 +12835,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$206 in nextProps) { - var propKey = nextProps[propKey$206]; - lastProp = lastProps[propKey$206]; + for (var propKey$199 in nextProps) { + var propKey = nextProps[propKey$199]; + lastProp = lastProps[propKey$199]; if ( - nextProps.hasOwnProperty(propKey$206) && + nextProps.hasOwnProperty(propKey$199) && (null != propKey || null != lastProp) ) - switch (propKey$206) { + switch (propKey$199) { case "type": type = propKey; break; @@ -12757,7 +12871,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$206, + propKey$199, propKey, nextProps, lastProp @@ -12776,7 +12890,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$206 = null; + propKey = value = defaultValue = propKey$199 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -12807,7 +12921,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$206 = type; + propKey$199 = type; break; case "defaultValue": defaultValue = type; @@ -12828,15 +12942,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$206 - ? updateOptions(domElement, !!lastProps, propKey$206, !1) + null != propKey$199 + ? updateOptions(domElement, !!lastProps, propKey$199, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$206 = null; + propKey = propKey$199 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -12860,7 +12974,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$206 = name; + propKey$199 = name; break; case "defaultValue": propKey = name; @@ -12874,17 +12988,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$206, propKey); + updateTextarea(domElement, propKey$199, propKey); return; case "option": - for (var propKey$222 in lastProps) + for (var propKey$215 in lastProps) if ( - ((propKey$206 = lastProps[propKey$222]), - lastProps.hasOwnProperty(propKey$222) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$222)) + ((propKey$199 = lastProps[propKey$215]), + lastProps.hasOwnProperty(propKey$215) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$215)) ) - switch (propKey$222) { + switch (propKey$215) { case "selected": domElement.selected = !1; break; @@ -12892,33 +13006,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$222, + propKey$215, null, nextProps, - propKey$206 + propKey$199 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$206 = nextProps[lastDefaultValue]), + ((propKey$199 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$206 !== propKey && - (null != propKey$206 || null != propKey)) + propKey$199 !== propKey && + (null != propKey$199 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$206 && - "function" !== typeof propKey$206 && - "symbol" !== typeof propKey$206; + propKey$199 && + "function" !== typeof propKey$199 && + "symbol" !== typeof propKey$199; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$206, + propKey$199, nextProps, propKey ); @@ -12939,24 +13053,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$227 in lastProps) - (propKey$206 = lastProps[propKey$227]), - lastProps.hasOwnProperty(propKey$227) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$227) && - setProp(domElement, tag, propKey$227, null, nextProps, propKey$206); + for (var propKey$220 in lastProps) + (propKey$199 = lastProps[propKey$220]), + lastProps.hasOwnProperty(propKey$220) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$220) && + setProp(domElement, tag, propKey$220, null, nextProps, propKey$199); for (checked in nextProps) if ( - ((propKey$206 = nextProps[checked]), + ((propKey$199 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$206 !== propKey && - (null != propKey$206 || null != propKey)) + propKey$199 !== propKey && + (null != propKey$199 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$206) + if (null != propKey$199) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -12964,7 +13078,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$206, + propKey$199, nextProps, propKey ); @@ -12972,49 +13086,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$232 in lastProps) - (propKey$206 = lastProps[propKey$232]), - lastProps.hasOwnProperty(propKey$232) && - void 0 !== propKey$206 && - !nextProps.hasOwnProperty(propKey$232) && + for (var propKey$225 in lastProps) + (propKey$199 = lastProps[propKey$225]), + lastProps.hasOwnProperty(propKey$225) && + void 0 !== propKey$199 && + !nextProps.hasOwnProperty(propKey$225) && setPropOnCustomElement( domElement, tag, - propKey$232, + propKey$225, void 0, nextProps, - propKey$206 + propKey$199 ); for (defaultChecked in nextProps) - (propKey$206 = nextProps[defaultChecked]), + (propKey$199 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$206 === propKey || - (void 0 === propKey$206 && void 0 === propKey) || + propKey$199 === propKey || + (void 0 === propKey$199 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$206, + propKey$199, nextProps, propKey ); return; } } - for (var propKey$237 in lastProps) - (propKey$206 = lastProps[propKey$237]), - lastProps.hasOwnProperty(propKey$237) && - null != propKey$206 && - !nextProps.hasOwnProperty(propKey$237) && - setProp(domElement, tag, propKey$237, null, nextProps, propKey$206); + for (var propKey$230 in lastProps) + (propKey$199 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + null != propKey$199 && + !nextProps.hasOwnProperty(propKey$230) && + setProp(domElement, tag, propKey$230, null, nextProps, propKey$199); for (lastProp in nextProps) - (propKey$206 = nextProps[lastProp]), + (propKey$199 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$206 === propKey || - (null == propKey$206 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$206, nextProps, propKey); + propKey$199 === propKey || + (null == propKey$199 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$199, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -13559,26 +13673,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$245 = getResourcesFromRoot( + var styles$238 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$246 = styles$245.get(type); - resource$246 || + resource$239 = styles$238.get(type); + resource$239 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$246 = { + (resource$239 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$245.set(type, resource$246), - (styles$245 = JSCompiler_inline_result.querySelector( + styles$238.set(type, resource$239), + (styles$238 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$245._p && - ((resource$246.instance = styles$245), - (resource$246.state.loading = 5)), + !styles$238._p && + ((resource$239.instance = styles$238), + (resource$239.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -13591,16 +13705,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$245 || + styles$238 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$246.state + resource$239.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$246; + return resource$239; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -13697,37 +13811,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$251 = hoistableRoot.querySelector( + var instance$244 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$251) + if (instance$244) return ( (resource.state.loading |= 4), - (resource.instance = instance$251), - markNodeAsHoistable(instance$251), - instance$251 + (resource.instance = instance$244), + markNodeAsHoistable(instance$244), + instance$244 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$251 = ( + instance$244 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$251); - var linkInstance = instance$251; + markNodeAsHoistable(instance$244); + var linkInstance = instance$244; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$251, "link", instance); + setInitialProperties(instance$244, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$251, props.precedence, hoistableRoot); - return (resource.instance = instance$251); + insertStylesheet(instance$244, props.precedence, hoistableRoot); + return (resource.instance = instance$244); case "script": - instance$251 = getScriptKey(props.src); + instance$244 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$251) + getScriptSelectorFromKey(instance$244) )) ) return ( @@ -13736,7 +13850,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$251))) + if ((styleProps = preloadPropsMap.get(instance$244))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14059,6 +14173,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -14759,16 +14874,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1664 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1666 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1664 + "19.0.0-rc-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1666 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1664, - "19.0.0-rc-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1666, + "19.0.0-rc-a03254bc-20240905" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -14788,25 +14903,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2049 = { +var internals$jscomp$inline_2077 = { bundleType: 0, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-a03254bc-20240905" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2050 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2078 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2050.isDisabled && - hook$jscomp$inline_2050.supportsFiber + !hook$jscomp$inline_2078.isDisabled && + hook$jscomp$inline_2078.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2050.inject( - internals$jscomp$inline_2049 + (rendererID = hook$jscomp$inline_2078.inject( + internals$jscomp$inline_2077 )), - (injectedHook = hook$jscomp$inline_2050); + (injectedHook = hook$jscomp$inline_2078); } catch (err) {} } exports.createRoot = function (container, options) { @@ -14898,4 +15013,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js index 65dbcede073bf..5b04966e67d2f 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js @@ -1018,28 +1018,37 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -1118,6 +1127,7 @@ root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -3909,6 +3919,61 @@ staleFamilies ); } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); + } + function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } + } + function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } + } + function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } + } + function startLayoutEffectTimer() { + layoutEffectStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -5703,6 +5768,14 @@ } function finishRenderingHooks(current, workInProgress) { workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState + }) + : (workInProgress.dependencies._debugThenableState = thenableState); ReactSharedInternals.H = ContextOnlyDispatcher; var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; @@ -7140,60 +7213,128 @@ markRootEntangled(root, lane); } } - function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); - } - function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } } - function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); } } + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), + console.error( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + } finally { + setIsStrictModeForDevtools(!1); } - fiber = fiber.return; } + void 0 === oldProps && + console.error( + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" + ); + return oldProps; } + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function startLayoutEffectTimer() { - layoutEffectStartTime = now(); + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); + } + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); + } + return newProps; } function defaultOnUncaughtError(error, errorInfo) { reportGlobalError(error); @@ -7795,8 +7936,8 @@ (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes$1[componentName] || - ((didWarnAboutContextTypes$1[componentName] = !0), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", componentName @@ -8025,8 +8166,8 @@ state )); Component.contextTypes && - !didWarnAboutContextTypes.has(Component) && - (didWarnAboutContextTypes.add(Component), + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), console.error( "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", state @@ -8455,32 +8596,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2304; - var JSCompiler_object_inline_stack_2305 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2278; + var JSCompiler_object_inline_stack_2279 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2306 = !1; + var JSCompiler_object_inline_componentStack_2280 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2304 = didSuspend) || - (JSCompiler_object_inline_digest_2304 = + (JSCompiler_object_inline_digest_2278 = didSuspend) || + (JSCompiler_object_inline_digest_2278 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2304 && - ((JSCompiler_object_inline_componentStack_2306 = !0), + JSCompiler_object_inline_digest_2278 && + ((JSCompiler_object_inline_componentStack_2280 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2304 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2278 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2280 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2303 = nextHydratableInstance; + var JSCompiler_object_inline_message_2277 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2303)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2277)) { c: { - var instance = JSCompiler_object_inline_message_2303; + var instance = JSCompiler_object_inline_message_2277; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8521,19 +8662,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2277 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2303 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2277 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2303 && - ((JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303.dehydrated), - null !== JSCompiler_object_inline_message_2303) + null !== JSCompiler_object_inline_message_2277 && + ((JSCompiler_object_inline_message_2277 = + JSCompiler_object_inline_message_2277.dehydrated), + null !== JSCompiler_object_inline_message_2277) ) return ( - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2277.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8541,58 +8682,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_stack_2305.children; - JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_stack_2305.fallback; - if (JSCompiler_object_inline_componentStack_2306) + JSCompiler_object_inline_message_2277 = + JSCompiler_object_inline_stack_2279.children; + JSCompiler_object_inline_stack_2279 = + JSCompiler_object_inline_stack_2279.fallback; + if (JSCompiler_object_inline_componentStack_2280) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2280 = workInProgress.mode), - (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_message_2277 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2303 + children: JSCompiler_object_inline_message_2277 }, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2280 )), - (JSCompiler_object_inline_stack_2305 = createFiberFromFragment( - JSCompiler_object_inline_stack_2305, - JSCompiler_object_inline_componentStack_2306, + (JSCompiler_object_inline_stack_2279 = createFiberFromFragment( + JSCompiler_object_inline_stack_2279, + JSCompiler_object_inline_componentStack_2280, renderLanes, null )), - (JSCompiler_object_inline_message_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_message_2303.sibling = - JSCompiler_object_inline_stack_2305), - (workInProgress.child = JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_message_2277.return = workInProgress), + (JSCompiler_object_inline_stack_2279.return = workInProgress), + (JSCompiler_object_inline_message_2277.sibling = + JSCompiler_object_inline_stack_2279), + (workInProgress.child = JSCompiler_object_inline_message_2277), + (JSCompiler_object_inline_componentStack_2280 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2306.memoizedState = + (JSCompiler_object_inline_componentStack_2280.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2306.childLanes = + (JSCompiler_object_inline_componentStack_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2278, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2279 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2277 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2303 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2303) + ((JSCompiler_object_inline_message_2277 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2277) ) { if (didSuspend) workInProgress.flags & 256 @@ -8609,94 +8750,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_message_2303 = workInProgress.mode), - (JSCompiler_object_inline_stack_2305 = + (JSCompiler_object_inline_componentStack_2280 = + JSCompiler_object_inline_stack_2279.fallback), + (JSCompiler_object_inline_message_2277 = workInProgress.mode), + (JSCompiler_object_inline_stack_2279 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2279.children }, - JSCompiler_object_inline_message_2303 + JSCompiler_object_inline_message_2277 )), - (JSCompiler_object_inline_componentStack_2306 = + (JSCompiler_object_inline_componentStack_2280 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2306, - JSCompiler_object_inline_message_2303, + JSCompiler_object_inline_componentStack_2280, + JSCompiler_object_inline_message_2277, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2306.flags |= 2), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_componentStack_2306.return = + (JSCompiler_object_inline_componentStack_2280.flags |= 2), + (JSCompiler_object_inline_stack_2279.return = workInProgress), + (JSCompiler_object_inline_componentStack_2280.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_componentStack_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2305), + (JSCompiler_object_inline_stack_2279.sibling = + JSCompiler_object_inline_componentStack_2280), + (workInProgress.child = JSCompiler_object_inline_stack_2279), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2305 = workInProgress.child), - (JSCompiler_object_inline_stack_2305.memoizedState = + (JSCompiler_object_inline_stack_2279 = workInProgress.child), + (JSCompiler_object_inline_stack_2279.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2305.childLanes = + (JSCompiler_object_inline_stack_2279.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2278, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2306)); + JSCompiler_object_inline_componentStack_2280)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2277.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2304 = - JSCompiler_object_inline_message_2303.nextSibling && - JSCompiler_object_inline_message_2303.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2304) { - JSCompiler_temp = JSCompiler_object_inline_digest_2304.dgst; - var message = JSCompiler_object_inline_digest_2304.msg; - instance = JSCompiler_object_inline_digest_2304.stck; - var componentStack = JSCompiler_object_inline_digest_2304.cstck; + JSCompiler_object_inline_digest_2278 = + JSCompiler_object_inline_message_2277.nextSibling && + JSCompiler_object_inline_message_2277.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2278) { + JSCompiler_temp = JSCompiler_object_inline_digest_2278.dgst; + var message = JSCompiler_object_inline_digest_2278.msg; + instance = JSCompiler_object_inline_digest_2278.stck; + var componentStack = JSCompiler_object_inline_digest_2278.cstck; } - JSCompiler_object_inline_message_2303 = message; - JSCompiler_object_inline_digest_2304 = JSCompiler_temp; - JSCompiler_object_inline_stack_2305 = instance; - JSCompiler_object_inline_componentStack_2306 = componentStack; - JSCompiler_object_inline_message_2303 = - JSCompiler_object_inline_message_2303 - ? Error(JSCompiler_object_inline_message_2303) + JSCompiler_object_inline_message_2277 = message; + JSCompiler_object_inline_digest_2278 = JSCompiler_temp; + JSCompiler_object_inline_stack_2279 = instance; + JSCompiler_object_inline_componentStack_2280 = componentStack; + JSCompiler_object_inline_message_2277 = + JSCompiler_object_inline_message_2277 + ? Error(JSCompiler_object_inline_message_2277) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2303.stack = - JSCompiler_object_inline_stack_2305 || ""; - JSCompiler_object_inline_message_2303.digest = - JSCompiler_object_inline_digest_2304; - JSCompiler_object_inline_digest_2304 = - void 0 === JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_message_2277.stack = + JSCompiler_object_inline_stack_2279 || ""; + JSCompiler_object_inline_message_2277.digest = + JSCompiler_object_inline_digest_2278; + JSCompiler_object_inline_digest_2278 = + void 0 === JSCompiler_object_inline_componentStack_2280 ? null - : JSCompiler_object_inline_componentStack_2306; - "string" === typeof JSCompiler_object_inline_digest_2304 && + : JSCompiler_object_inline_componentStack_2280; + "string" === typeof JSCompiler_object_inline_digest_2278 && CapturedStacks.set( - JSCompiler_object_inline_message_2303, - JSCompiler_object_inline_digest_2304 + JSCompiler_object_inline_message_2277, + JSCompiler_object_inline_digest_2278 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2303, + value: JSCompiler_object_inline_message_2277, source: null, - stack: JSCompiler_object_inline_digest_2304 + stack: JSCompiler_object_inline_digest_2278 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8704,25 +8845,25 @@ renderLanes ); } else if ( - ((JSCompiler_object_inline_digest_2304 = + ((JSCompiler_object_inline_digest_2278 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2304) + didReceiveUpdate || JSCompiler_object_inline_digest_2278) ) { - JSCompiler_object_inline_digest_2304 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2304) { - JSCompiler_object_inline_stack_2305 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2305 & 42)) - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_digest_2278 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2278) { + JSCompiler_object_inline_stack_2279 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2279 & 42)) + JSCompiler_object_inline_stack_2279 = 1; else - switch (JSCompiler_object_inline_stack_2305) { + switch (JSCompiler_object_inline_stack_2279) { case 2: - JSCompiler_object_inline_stack_2305 = 1; + JSCompiler_object_inline_stack_2279 = 1; break; case 8: - JSCompiler_object_inline_stack_2305 = 4; + JSCompiler_object_inline_stack_2279 = 4; break; case 32: - JSCompiler_object_inline_stack_2305 = 16; + JSCompiler_object_inline_stack_2279 = 16; break; case 128: case 256: @@ -8743,40 +8884,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2305 = 64; + JSCompiler_object_inline_stack_2279 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2305 = 134217728; + JSCompiler_object_inline_stack_2279 = 134217728; break; default: - JSCompiler_object_inline_stack_2305 = 0; + JSCompiler_object_inline_stack_2279 = 0; } - JSCompiler_object_inline_stack_2305 = + JSCompiler_object_inline_stack_2279 = 0 !== - (JSCompiler_object_inline_stack_2305 & - (JSCompiler_object_inline_digest_2304.suspendedLanes | + (JSCompiler_object_inline_stack_2279 & + (JSCompiler_object_inline_digest_2278.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2305; + : JSCompiler_object_inline_stack_2279; if ( - 0 !== JSCompiler_object_inline_stack_2305 && - JSCompiler_object_inline_stack_2305 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2279 && + JSCompiler_object_inline_stack_2279 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2305), + ((prevState.retryLane = JSCompiler_object_inline_stack_2279), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2279 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2278, current, - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2279 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2277.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8784,7 +8925,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2303.data === + JSCompiler_object_inline_message_2277.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8792,12 +8933,12 @@ null, current )), - (JSCompiler_object_inline_message_2303._reactRetry = + (JSCompiler_object_inline_message_2277._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2303.nextSibling + JSCompiler_object_inline_message_2277.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -8815,57 +8956,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2305.children + JSCompiler_object_inline_stack_2279.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2306) + if (JSCompiler_object_inline_componentStack_2280) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2306 = - JSCompiler_object_inline_stack_2305.fallback), - (JSCompiler_object_inline_message_2303 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2280 = + JSCompiler_object_inline_stack_2279.fallback), + (JSCompiler_object_inline_message_2277 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2305 = createWorkInProgress( + (JSCompiler_object_inline_stack_2279 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2279.children } )), - (JSCompiler_object_inline_stack_2305.subtreeFlags = + (JSCompiler_object_inline_stack_2279.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2306 = + ? (JSCompiler_object_inline_componentStack_2280 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2306 + JSCompiler_object_inline_componentStack_2280 )) - : ((JSCompiler_object_inline_componentStack_2306 = + : ((JSCompiler_object_inline_componentStack_2280 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2306, - JSCompiler_object_inline_message_2303, + JSCompiler_object_inline_componentStack_2280, + JSCompiler_object_inline_message_2277, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2306.flags |= 2)), - (JSCompiler_object_inline_componentStack_2306.return = + (JSCompiler_object_inline_componentStack_2280.flags |= 2)), + (JSCompiler_object_inline_componentStack_2280.return = workInProgress), - (JSCompiler_object_inline_stack_2305.return = workInProgress), - (JSCompiler_object_inline_stack_2305.sibling = - JSCompiler_object_inline_componentStack_2306), - (workInProgress.child = JSCompiler_object_inline_stack_2305), - (JSCompiler_object_inline_stack_2305 = - JSCompiler_object_inline_componentStack_2306), - (JSCompiler_object_inline_componentStack_2306 = workInProgress.child), - (JSCompiler_object_inline_message_2303 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2303 - ? (JSCompiler_object_inline_message_2303 = + (JSCompiler_object_inline_stack_2279.return = workInProgress), + (JSCompiler_object_inline_stack_2279.sibling = + JSCompiler_object_inline_componentStack_2280), + (workInProgress.child = JSCompiler_object_inline_stack_2279), + (JSCompiler_object_inline_stack_2279 = + JSCompiler_object_inline_componentStack_2280), + (JSCompiler_object_inline_componentStack_2280 = workInProgress.child), + (JSCompiler_object_inline_message_2277 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2277 + ? (JSCompiler_object_inline_message_2277 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2303.cachePool), + JSCompiler_object_inline_message_2277.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -8873,37 +9014,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2303 = { + (JSCompiler_object_inline_message_2277 = { baseLanes: - JSCompiler_object_inline_message_2303.baseLanes | renderLanes, + JSCompiler_object_inline_message_2277.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2306.memoizedState = - JSCompiler_object_inline_message_2303), - (JSCompiler_object_inline_componentStack_2306.childLanes = + (JSCompiler_object_inline_componentStack_2280.memoizedState = + JSCompiler_object_inline_message_2277), + (JSCompiler_object_inline_componentStack_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2304, + JSCompiler_object_inline_digest_2278, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2305 + JSCompiler_object_inline_stack_2279 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2305.children + children: JSCompiler_object_inline_stack_2279.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2304 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2304 + ((JSCompiler_object_inline_digest_2278 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2278 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2304.push(current)); + : JSCompiler_object_inline_digest_2278.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -10103,7 +10244,11 @@ "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -10391,6 +10536,16 @@ ); callback.call(context); } + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); + } function commitCallbacks(updateQueue, context) { var callbacks = updateQueue.callbacks; if (null !== callbacks) @@ -10401,128 +10556,542 @@ ) callCallback(callbacks[updateQueue], context); } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function shouldProfile$1(current) { + return ( + (current.mode & ProfileMode) !== NoMode && + (executionContext & CommitContext) !== NoContext + ); } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); - } - } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext + function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ( + (updateQueue.tag & flags) === flags && + ((flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ), + (lastEffect = void 0), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + (lastEffect = runWithFiberInDEV( + finishedWork, + callCreateInDEV, + updateQueue + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(), + void 0 !== lastEffect && "function" !== typeof lastEffect) + ) { + var hookName = void 0; + hookName = + 0 !== (updateQueue.tag & Layout) + ? "useLayoutEffect" + : 0 !== (updateQueue.tag & Insertion) + ? "useInsertionEffect" + : "useEffect"; + var addendum = void 0; + addendum = + null === lastEffect + ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." + : "function" === typeof lastEffect.then + ? "\n\nIt looks like you wrote " + + hookName + + "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + + hookName + + "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" + : " You returned: " + lastEffect; + runWithFiberInDEV( + finishedWork, + function (n, a) { + console.error( + "%s must not return anything besides a function, which is used for clean-up.%s", + n, + a + ); + }, + hookName, + addendum + ); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); - } finally { - setIsStrictModeForDevtools(!1); - } + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStarted(finishedWork), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + (flags & Passive) !== NoFlags + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); } - void 0 === oldProps && + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (instance.props !== finishedWork.memoizedProps && + console.error( + "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + instance.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + updateQueue, + instance + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + } + function callGetSnapshotBeforeUpdates(instance, prevProps, prevState) { + return instance.getSnapshotBeforeUpdate(prevProps, prevState); + } + function commitClassSnapshot(finishedWork, current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState; + current = finishedWork.stateNode; + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (current.props !== finishedWork.memoizedProps && console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + ), + current.state !== finishedWork.memoizedState && + console.error( + "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", + getComponentNameFromFiber(finishedWork) || "instance" + )); + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork.type, + prevProps, + finishedWork.elementType === finishedWork.type + ); + var snapshot = runWithFiberInDEV( + finishedWork, + callGetSnapshotBeforeUpdates, + current, + resolvedPrevProps, + prevState + ); + prevProps = didWarnAboutUndefinedSnapshotBeforeUpdate; + void 0 !== snapshot || + prevProps.has(finishedWork.type) || + (prevProps.add(finishedWork.type), + runWithFiberInDEV(finishedWork, function () { + console.error( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps + ); + instance.state = current.memoizedState; + shouldProfile$1(current) + ? (startLayoutEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordLayoutEffectDuration(current)) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance ); - return oldProps; + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + if ("function" === typeof ref) + if (shouldProfile$1(finishedWork)) + try { + startLayoutEffectTimer(), + (finishedWork.refCleanup = ref(instance)); + } finally { + recordLayoutEffectDuration(finishedWork); + } + else finishedWork.refCleanup = ref(instance); + else + "string" === typeof ref + ? console.error("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + console.error( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instance); } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), + runWithFiberInDEV(current, refCleanup); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); + } + else if ("function" === typeof ref) + try { + if (shouldProfile$1(current)) + try { + startLayoutEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordLayoutEffectDuration(current); + } + else runWithFiberInDEV(current, ref, null); + } catch (error$6) { + captureCommitPhaseError(current, nearestMountedAncestor, error$6); + } + else ref.current = null; + } + function commitProfiler(finishedWork, current, commitTime, effectDuration) { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } + function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( + if (executionContext & CommitContext) + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitTime, + effectDuration + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, instance, - instance.state, - null - )); + type, + props, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); + } + function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); + } + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } + } + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), + before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); + } + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), + (node = node.sibling); + } + function commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); + } } - return newProps; } function shouldProfile(current) { return ( @@ -10530,101 +11099,6 @@ (executionContext & CommitContext) !== NoContext ); } - function safelyCallComponentWillUnmount( - current, - nearestMountedAncestor, - instance - ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, nearestMountedAncestor) { - try { - var ref = current.ref; - if (null !== ref) { - var instance = current.stateNode; - switch (current.tag) { - case 26: - case 27: - case 5: - var instanceToUse = instance; - break; - default: - instanceToUse = instance; - } - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - "string" === typeof ref - ? console.error("String refs are no longer supported.") - : ref.hasOwnProperty("current") || - console.error( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); - } - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; - if (null !== ref) - if ("function" === typeof refCleanup) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), refCleanup(); - } finally { - recordLayoutEffectDuration(current); - } - else refCleanup(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } finally { - (current.refCleanup = null), - (current = current.alternate), - null != current && (current.refCleanup = null); - } - else if ("function" === typeof ref) - try { - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), ref(null); - } finally { - recordLayoutEffectDuration(current); - } - else ref(null); - } catch (error$6) { - captureCommitPhaseError(current, nearestMountedAncestor, error$6); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; root = getActiveElementDeep(); @@ -10696,344 +11170,87 @@ selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - flags = current.memoizedProps; - var prevState = current.memoizedState; - current = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - current.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - flags = current.getSnapshotBeforeUpdate( - resolveClassComponentProps(finishedWork.type, flags), - prevState - ); - prevState = didWarnAboutUndefinedSnapshotBeforeUpdate; - void 0 !== flags || - prevState.has(finishedWork.type) || - (prevState.add(finishedWork.type), - console.error( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )); - current.__reactInternalSnapshotBeforeUpdate = flags; - } - break; - case 3: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - 9 === current) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - (flags & Passive) !== NoFlags - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"; - console.error( - "%s must not return anything besides a function, which is used for clean-up.%s", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$7) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$7); - } - } - function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (instance.props !== finishedWork.memoizedProps && - console.error( - "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - ), - instance.state !== finishedWork.memoizedState && - console.error( - "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", - getComponentNameFromFiber(finishedWork) || "instance" - )); - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } - function commitProfilerUpdate(finishedWork, current) { - if (executionContext & CommitContext) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + }; + _enabled = !1; + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((firstChild = nextEffect), + (root = firstChild.child), + 0 !== (firstChild.subtreeFlags & 1028) && null !== root) + ) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + switch (root.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (anchorOffset & 1024) && + null !== JSCompiler_temp && + commitClassSnapshot(root, JSCompiler_temp); + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -11049,17 +11266,27 @@ "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )), - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -11073,21 +11300,25 @@ "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", getComponentNameFromFiber(finishedWork) || "instance" )); - shouldProfile(finishedWork) + shouldProfile$1(finishedWork) ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -11095,11 +11326,7 @@ flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) @@ -11115,59 +11342,64 @@ finishedRoot = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 26: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - null === current && - flags & 4 && - commitHostComponentMount(finishedWork); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); - flags & 4 && commitProfilerUpdate(finishedWork, current); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - prevState = + prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden; - if (!prevState) { + if (!prevProps) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -11175,11 +11407,7 @@ finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -11189,11 +11417,7 @@ : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function detachFiberAfterEffects(fiber) { @@ -11216,78 +11440,6 @@ fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); - } - function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } - } - function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), - before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); - } - function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), - (node = node.sibling); - } function recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -11367,14 +11519,37 @@ ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && @@ -11420,7 +11595,9 @@ void 0 !== destroy && ((tag & Insertion) !== NoFlags ? ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11430,14 +11607,18 @@ shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), (inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy ), recordLayoutEffectDuration(deletedFiber)) : ((inst.destroy = void 0), - callDestroyInDEV( + runWithFiberInDEV( + deletedFiber, + callDestroyInDEV, deletedFiber, nearestMountedAncestor, destroy @@ -11505,7 +11686,11 @@ ((finishedRoot = finishedRoot.dehydrated), null !== finishedRoot))) ) try { - retryIfBlockedOn(finishedRoot); + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -11554,128 +11739,85 @@ function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + commitMutationEffectsOnFiber(finishedWork, root); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseMutationEffects( - root$jscomp$0, - parentFiber, - lanes - ) { + function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - deletedFiber = childToDelete, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var root = root$jscomp$0, + returnFiber = parentFiber, + deletedFiber = deletions[i], + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); - hostParent = null; - hostParentIsContainer = !1; - root = deletedFiber; - var alternate = root.alternate; - null !== alternate && (alternate.return = null); - root.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); + hostParent = null; + hostParentIsContainer = !1; + root = deletedFiber; + returnFiber = root.alternate; + null !== returnFiber && (returnFiber.return = null); + root.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), (parentFiber = parentFiber.sibling); - } - function commitMutationEffectsOnFiber(finishedWork, root, lanes) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - switch (finishedWork.tag) { - case 0: - case 11: - case 14: - case 15: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount( - Insertion | HasEffect, - finishedWork, - finishedWork.return - ), - commitHookEffectListMount(Insertion | HasEffect, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$9) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$9 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { + } + function commitMutationEffectsOnFiber(finishedWork, root) { + var current = finishedWork.alternate, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), commitHookEffectListUnmount( Layout | HasEffect, finishedWork, finishedWork.return - ); - } catch (error$10) { - captureCommitPhaseError( + ), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + Layout | HasEffect, finishedWork, - finishedWork.return, - error$10 - ); - } - } + finishedWork.return + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11692,116 +11834,118 @@ break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = + null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = + hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || + currentResource.namespaceURI === SVG_NAMESPACE || + currentResource.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), - root.head.insertBefore( - lanes, - root.querySelector("head > title") + (currentResource = + hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || ""))) ) - for (var i = 0; i < hoistableRoot.length; i++) + for (var i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((currentResource = root[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (root = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < root.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((currentResource = root[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + root.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error( @@ -11810,9 +11954,9 @@ '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -11827,117 +11971,85 @@ flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$11) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$11 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - i = finishedWork.memoizedProps; - for (var node = hoistableRoot.firstChild; node; ) { - var nextNode = node.nextSibling, - nodeName = node.nodeName; - node[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && - "stylesheet" === node.rel.toLowerCase()) || - hoistableRoot.removeChild(node); - node = nextNode; - } - node = finishedWork.type; - getInstanceFromNode(hoistableRoot) && - ((nextNode = hoistableRoot.tagName.toLowerCase()), - console.error( - "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", - nextNode, - nextNode, - nextNode - )); - switch (node) { - case "html": - case "head": - case "body": - break; - default: - console.error( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + currentResource = finishedWork.memoizedProps; + try { + for (i = hoistableRoot.firstChild; i; ) { + var nextNode = i.nextSibling, + nodeName = i.nodeName; + i[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === i.rel.toLowerCase()) || + hoistableRoot.removeChild(i); + i = nextNode; + } + runWithFiberInDEV( + finishedWork, + acquireSingletonInstance, + finishedWork.type, + currentResource, + hoistableRoot, + finishedWork + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, node, i); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = i; } case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$12) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$12 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$13) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$13 - ); + runWithFiberInDEV(finishedWork, resetTextContent, hoistableRoot); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -11946,23 +12058,26 @@ )); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & 4) { if (null === finishedWork.stateNode) throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + hoistableRoot = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$14) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$14 + commitTextUpdate, + hoistableRoot, + current, + flags ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -11970,7 +12085,7 @@ tagCaches = null; hoistableRoot = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); currentHoistableRoot = hoistableRoot; commitReconciliationEffects(finishedWork); if ( @@ -11979,13 +12094,13 @@ current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$15) { - captureCommitPhaseError( + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$15 + commitHydratedContainer, + root.containerInfo ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -11995,12 +12110,12 @@ currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && (null !== finishedWork.memoizedState) !== @@ -12016,15 +12131,15 @@ flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -12032,13 +12147,13 @@ root._visibility |= root._pendingVisibility & OffscreenDetached; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & ~OffscreenVisible : root._visibility | OffscreenVisible), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -12047,47 +12162,46 @@ a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((i = hoistableRoot.style), - "function" === typeof i.setProperty - ? i.setProperty("display", "none", "important") - : (i.display = "none")) - : ((node = root.stateNode), - (nextNode = root.memoizedProps[STYLE]), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (node.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$8) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$8 - ); + (currentResource = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + currentResource + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + currentResource, + nextNode.memoizedProps + ); + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -12118,7 +12232,7 @@ attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -12129,7 +12243,7 @@ case 21: break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -12137,52 +12251,7 @@ var flags = finishedWork.flags; if (flags & 2) { try { - if (27 !== finishedWork.tag) { - b: { - for (var parent = finishedWork.return; null !== parent; ) { - if (isHostParent(parent)) { - var parentFiber = parent; - break b; - } - parent = parent.return; - } - throw Error( - "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." - ); - } - switch (parentFiber.tag) { - case 27: - var parent$jscomp$0 = parentFiber.stateNode, - before = getHostSibling(finishedWork); - insertOrAppendPlacementNode( - finishedWork, - before, - parent$jscomp$0 - ); - break; - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && - (setTextContent(_parent, ""), (parentFiber.flags &= -33)); - var _before = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, _before, _parent); - break; - case 3: - case 4: - var _parent2 = parentFiber.stateNode.containerInfo, - _before2 = getHostSibling(finishedWork); - insertOrAppendPlacementNodeIntoContainer( - finishedWork, - _before2, - _parent2 - ); - break; - default: - throw Error( - "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." - ); - } - } + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } @@ -12202,27 +12271,13 @@ function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitLayoutEffectOnFiber, - root, - finishedWork.alternate, - finishedWork, - committedLanes - ); + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); inProgressRoot = inProgressLanes = null; } - function recursivelyTraverseLayoutEffects(root, parentFiber, lanes) { + function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitLayoutEffectOnFiber, - root, - parentFiber.alternate, - parentFiber, - lanes - ), + commitLayoutEffectOnFiber(root, parentFiber.alternate, parentFiber), (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { @@ -12305,24 +12360,28 @@ finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + current = finishedWork.stateNode; + "function" === typeof current.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + current + ); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - var updateQueue = finishedWork.updateQueue; - if ( - null !== updateQueue && - ((current = updateQueue.shared.hiddenCallbacks), null !== current) - ) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < current.length; - updateQueue++ - ) - callCallback(current[updateQueue], finishedRoot); + } includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork); @@ -12339,7 +12398,7 @@ includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -12348,9 +12407,33 @@ finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + includeWorkInProgressEffects = + finishedWork.stateNode.effectDuration, + commitProfilerUpdate( + finishedWork, + current, + commitTime, + includeWorkInProgressEffects + ), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + case 12: + finishedWork.stateNode.effectDuration += + includeWorkInProgressEffects; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -12387,9 +12470,7 @@ includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -12397,22 +12478,6 @@ ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -12443,9 +12508,7 @@ ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -12492,9 +12555,9 @@ case 23: break; case 22: - var _instance3 = finishedWork.stateNode; + var _instance = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance3._visibility & OffscreenPassiveEffectsConnected + ? _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -12503,18 +12566,16 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : _instance3._visibility & OffscreenPassiveEffectsConnected + : _instance._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((_instance3._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12558,9 +12619,7 @@ includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -12593,9 +12652,9 @@ case 23: break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & OffscreenPassiveEffectsConnected + ? _instance2._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12605,11 +12664,9 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= OffscreenPassiveEffectsConnected), + : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -12647,62 +12704,45 @@ } } function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions + finishedRoot$jscomp$0, + parentFiber ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitAtomicPassiveEffects, - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ), - (parentFiber = parentFiber.sibling); - } - function commitAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) { - var flags = finishedWork.flags; - switch (finishedWork.tag) { - case 22: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var finishedRoot = finishedRoot$jscomp$0, + finishedWork = parentFiber, + flags = finishedWork.flags; + switch (finishedWork.tag) { + case 22: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitOffscreenPassiveMountEffects( + finishedWork.alternate, + finishedWork + ); + break; + case 24: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + flags & 2048 && + commitCachePassiveMountEffect( + finishedWork.alternate, + finishedWork + ); + break; + default: + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ); + } + parentFiber = parentFiber.sibling; + } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { if (parentFiber.subtreeFlags & suspenseyCommitFlag) @@ -12763,25 +12803,6 @@ while (null !== parentFiber); } } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); - } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -12798,11 +12819,7 @@ } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12846,7 +12863,7 @@ detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12876,22 +12893,37 @@ nearestMountedAncestor ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; - runWithFiberInDEV( - fiber, - commitPassiveUnmountInsideDeletedTreeOnFiber, - fiber, - nearestMountedAncestor - ); - var child = fiber.child; - if (null !== child) (child.return = fiber), (nextEffect = child); + var fiber = nextEffect, + current = fiber; + switch (current.tag) { + case 0: + case 11: + case 15: + commitHookPassiveUnmountEffects( + current, + nearestMountedAncestor, + Passive + ); + break; + case 23: + case 22: + null !== current.memoizedState && + null !== current.memoizedState.cachePool && + ((current = current.memoizedState.cachePool.pool), + null != current && retainCache(current)); + break; + case 24: + releaseCache(current.memoizedState.cache); + } + current = fiber.child; + if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { + current = nextEffect; + var sibling = current.sibling, + returnFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } @@ -12904,31 +12936,6 @@ } } } - function commitPassiveUnmountInsideDeletedTreeOnFiber( - current, - nearestMountedAncestor - ) { - switch (current.tag) { - case 0: - case 11: - case 15: - commitHookPassiveUnmountEffects( - current, - nearestMountedAncestor, - Passive - ); - break; - case 23: - case 22: - null !== current.memoizedState && - null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); - break; - case 24: - releaseCache(current.memoizedState.cache); - } - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -13002,7 +13009,8 @@ ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13055,7 +13063,8 @@ ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -14086,7 +14095,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -14128,7 +14138,8 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -14153,7 +14164,12 @@ var renderWasConcurrent = shouldTimeSlice; do { if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -14185,7 +14201,12 @@ } if (didTimeout === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -14201,7 +14222,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -14235,7 +14257,8 @@ markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -14247,7 +14270,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -14260,7 +14284,8 @@ workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -14315,7 +14340,8 @@ transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -14338,7 +14364,7 @@ didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -14386,26 +14412,31 @@ function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didSkipSuspendedSiblings[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14435,13 +14466,18 @@ if (exitStatus === RootFatalErrored) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (exitStatus === RootDidNotComplete) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -14494,7 +14530,8 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressRootExitStatus = RootInProgress; workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -14619,7 +14656,8 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -14669,8 +14707,8 @@ } workLoopSync(); break; - } catch (thrownValue$19) { - handleThrow(root, thrownValue$19); + } catch (thrownValue$8) { + handleThrow(root, thrownValue$8); } while (1); lanes && root.shellSuspendCounter++; @@ -14810,8 +14848,8 @@ ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$20) { - handleThrow(root, thrownValue$20); + } catch (thrownValue$9) { + handleThrow(root, thrownValue$9); } while (1); resetContextDependencies(); @@ -14936,43 +14974,20 @@ workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - console.error( - "Internal React error: Expected this fiber to be complete, but it isn't. It should have been unwound. This is a bug in React." + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; (completedWork.mode & ProfileMode) === NoMode @@ -15006,6 +15021,38 @@ workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } + function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if ((unitOfWork.mode & ProfileMode) !== NoMode) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), + (next.subtreeFlags = 0), + (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = RootDidNotComplete; + workInProgress = null; + } function commitRoot( root, recoverableErrors, @@ -15209,55 +15256,40 @@ injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - var finishedWork = priority.current; - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); - var finishedWork$jscomp$0 = priority.current; - runWithFiberInDEV( - finishedWork$jscomp$0, - commitPassiveMountOnFiber, + commitPassiveUnmountOnFiber(priority.current); + commitPassiveMountOnFiber( priority, - finishedWork$jscomp$0, + priority.current, lanes, transitions ); - finishedWork = pendingPassiveProfilerEffects; + transitions = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; - for ( - finishedWork$jscomp$0 = 0; - finishedWork$jscomp$0 < finishedWork.length; - finishedWork$jscomp$0++ - ) { - var finishedWork$jscomp$1 = finishedWork[finishedWork$jscomp$0]; + for (lanes = 0; lanes < transitions.length; lanes++) { + var finishedWork = transitions[lanes]; if ( executionContext & CommitContext && - 0 !== (finishedWork$jscomp$1.flags & 4) + 0 !== (finishedWork.flags & 4) ) - switch (finishedWork$jscomp$1.tag) { + switch (finishedWork.tag) { case 12: var passiveEffectDuration = - finishedWork$jscomp$1.stateNode.passiveEffectDuration, - _finishedWork$memoize = - finishedWork$jscomp$1.memoizedProps, + finishedWork.stateNode.passiveEffectDuration, + _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, - onPostCommit = _finishedWork$memoize.onPostCommit; - transitions = commitTime; - var phase = - null === finishedWork$jscomp$1.alternate - ? "mount" - : "update"; + onPostCommit = _finishedWork$memoize.onPostCommit, + commitTime$jscomp$0 = commitTime, + phase = + null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( id, phase, passiveEffectDuration, - transitions + commitTime$jscomp$0 ); - var parentFiber = finishedWork$jscomp$1.return; + var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { switch (parentFiber.tag) { case 3: @@ -15403,6 +15435,7 @@ var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & CommitContext && @@ -18850,6 +18883,38 @@ throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + 8 === container.nodeType + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -18873,6 +18938,27 @@ } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -19073,6 +19159,12 @@ } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function resolveSingletonInstance( type, props, @@ -19111,6 +19203,37 @@ ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.tagName.toLowerCase(); + console.error( + "You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.", + tagName, + tagName, + tagName + ); + } + switch (type) { + case "html": + case "head": + case "body": + break; + default: + console.error( + "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -19859,6 +19982,7 @@ this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -21946,6 +22070,13 @@ StrictLegacyMode = 8, StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23487,84 +23618,14 @@ updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }, - componentName = null, - errorBoundaryName = null, - SelectiveHydrationException = Error( - "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." - ), - didReceiveUpdate = !1; - var didWarnAboutBadClass = {}; - var didWarnAboutContextTypeOnFunctionComponent = {}; - var didWarnAboutContextTypes$1 = {}; - var didWarnAboutGetDerivedStateOnFunctionComponent = {}; - var didWarnAboutReassigningProps = !1; - var didWarnAboutRevealOrder = {}; - var didWarnAboutTailOptions = {}; - var SUSPENDED_MARKER = { - dehydrated: null, - treeContext: null, - retryLane: 0 - }, - hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - lastFullyObservedContext = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); @@ -23632,6 +23693,69 @@ injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } }, + reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }, + componentName = null, + errorBoundaryName = null, + SelectiveHydrationException = Error( + "This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue." + ), + didReceiveUpdate = !1; + var didWarnAboutBadClass = {}; + var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; + var didWarnAboutGetDerivedStateOnFunctionComponent = {}; + var didWarnAboutReassigningProps = !1; + var didWarnAboutRevealOrder = {}; + var didWarnAboutTailOptions = {}; + var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0 + }, + hasWarnedAboutUsingNoValuePropOnContextProvider = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null, + isDisallowedContextReadInDEV = !1, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -23651,7 +23775,7 @@ var nonExtensibleObject = Object.preventExtensions({}); new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); - } catch (e$18) { + } catch (e$7) { hasBadMapPolyfill = !0; } var DefaultAsyncDispatcher = { @@ -23702,6 +23826,7 @@ SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -24278,11 +24403,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24319,11 +24444,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827" + reconcilerVersion: "19.0.0-rc-a03254bc-20240905" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24797,7 +24922,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js index 60cd03dc8d647..757368f4153d1 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js @@ -676,28 +676,37 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((root &= nonIdlePendingLanes), - 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) - : ((pendingLanes &= ~suspendedLanes), - 0 !== pendingLanes - ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); + : ((pingedLanes &= nonIdlePendingLanes), + 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = nonIdlePendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : ((pingedLanes = pendingLanes & ~root), + 0 !== pingedLanes && + (nextLanes = getHighestPriorityLanes(pingedLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (pingedLanes = wipLanes & -wipLanes), + suspendedLanes >= pingedLanes || + (32 === suspendedLanes && 0 !== (pingedLanes & 4194176))) ? wipLanes : nextLanes; } @@ -768,6 +777,7 @@ function markRootFinished(root, remainingLanes, spawnedLane) { root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; @@ -779,18 +789,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -810,19 +820,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - root[index$9].add(fiber); + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + root[index$10].add(fiber); lanes &= ~lane; } } @@ -834,16 +844,16 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$10 = 31 - clz32(lanes); - root = 1 << index$10; - index$10 = pendingUpdatersLaneMap[index$10]; - 0 < index$10.size && - (index$10.forEach(function (fiber) { + var index$11 = 31 - clz32(lanes); + root = 1 << index$11; + index$11 = pendingUpdatersLaneMap[index$11]; + 0 < index$11.size && + (index$11.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$10.clear()); + index$11.clear()); lanes &= ~root; } } @@ -993,8 +1003,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$11 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$11 && "aria-" !== prefix$11) { + var prefix$12 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$12 && "aria-" !== prefix$12) { node.removeAttribute(name); return; } @@ -1327,15 +1337,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$17 in styles) - (styleName = styles[styleName$17]), - styles.hasOwnProperty(styleName$17) && - prevStyles[styleName$17] !== styleName && - setValueForStyle(node, styleName$17, styleName); - } else for (var styleName$18 in styles) - styles.hasOwnProperty(styleName$18) && - setValueForStyle(node, styleName$18, styles[styleName$18]); + (styleName = styles[styleName$18]), + styles.hasOwnProperty(styleName$18) && + prevStyles[styleName$18] !== styleName && + setValueForStyle(node, styleName$18, styleName); + } else + for (var styleName$19 in styles) + styles.hasOwnProperty(styleName$19) && + setValueForStyle(node, styleName$19, styles[styleName$19]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2064,19 +2074,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$307; + var JSCompiler_inline_result$jscomp$295; if (canUseDOM) { - var isSupported$jscomp$inline_444 = "oninput" in document; - if (!isSupported$jscomp$inline_444) { - var element$jscomp$inline_445 = document.createElement("div"); - element$jscomp$inline_445.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_444 = - "function" === typeof element$jscomp$inline_445.oninput; + var isSupported$jscomp$inline_432 = "oninput" in document; + if (!isSupported$jscomp$inline_432) { + var element$jscomp$inline_433 = document.createElement("div"); + element$jscomp$inline_433.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_432 = + "function" === typeof element$jscomp$inline_433.oninput; } - JSCompiler_inline_result$jscomp$307 = isSupported$jscomp$inline_444; - } else JSCompiler_inline_result$jscomp$307 = !1; + JSCompiler_inline_result$jscomp$295 = isSupported$jscomp$inline_432; + } else JSCompiler_inline_result$jscomp$295 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$307 && + JSCompiler_inline_result$jscomp$295 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2492,7 +2502,69 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); + now = Scheduler.unstable_now, + commitTime = 0, + layoutEffectStartTime = -1, + profilerStartTime = -1, + passiveEffectStartTime = -1, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +} +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); + profilerStartTime = -1; + } +} +function recordLayoutEffectDuration(fiber) { + if (0 <= layoutEffectStartTime) { + var elapsedTime = now() - layoutEffectStartTime; + layoutEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber.stateNode.effectDuration += elapsedTime; + return; + case 12: + fiber.stateNode.effectDuration += elapsedTime; + return; + } + fiber = fiber.return; + } + } +} +function recordPassiveEffectDuration(fiber) { + if (0 <= passiveEffectStartTime) { + var elapsedTime = now() - passiveEffectStartTime; + passiveEffectStartTime = -1; + for (fiber = fiber.return; null !== fiber; ) { + switch (fiber.tag) { + case 3: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + case 12: + fiber = fiber.stateNode; + null !== fiber && (fiber.passiveEffectDuration += elapsedTime); + return; + } + fiber = fiber.return; + } + } +} +function startLayoutEffectTimer() { + layoutEffectStartTime = now(); +} +function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); +} +var CapturedStacks = new WeakMap(); function createCapturedValueAtFiber(value, source) { if ("object" === typeof value && null !== value) { var stack = CapturedStacks.get(value); @@ -3966,7 +4038,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$55 = !1; + didReadFromEntangledAsyncAction$58 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3987,11 +4059,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$58 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$58 = !0); continue; } else (updateLane = { @@ -4037,7 +4109,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$55 && + didReadFromEntangledAsyncAction$58 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4235,8 +4307,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$61) { - onActionError(actionQueue, node, error$61); + } catch (error$64) { + onActionError(actionQueue, node, error$64); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4652,10 +4724,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$67 = enqueueUpdate(provider, fiber, lane); + null !== root$67 && + (scheduleUpdateOnFiber(root$67, provider, lane), + entangleTransitions(root$67, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -5073,67 +5145,112 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { - if (0 <= profilerStartTime) { - var elapsedTime = now() - profilerStartTime; - fiber.actualDuration += elapsedTime; - overrideBaseTime && (fiber.selfBaseDuration = elapsedTime); - profilerStartTime = -1; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + markStateUpdateScheduled(inst, lane); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && + injectedProfilingHooks.markForceUpdateScheduled(inst, lane); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function recordLayoutEffectDuration(fiber) { - if (0 <= layoutEffectStartTime) { - var elapsedTime = now() - layoutEffectStartTime; - layoutEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber.stateNode.effectDuration += elapsedTime; - return; - case 12: - fiber.stateNode.effectDuration += elapsedTime; - return; - } - fiber = fiber.return; - } - } +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function recordPassiveEffectDuration(fiber) { - if (0 <= passiveEffectStartTime) { - var elapsedTime = now() - passiveEffectStartTime; - passiveEffectStartTime = -1; - for (fiber = fiber.return; null !== fiber; ) { - switch (fiber.tag) { - case 3: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - case 12: - fiber = fiber.stateNode; - null !== fiber && (fiber.passiveEffectDuration += elapsedTime); - return; - } - fiber = fiber.return; - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } -} -function startLayoutEffectTimer() { - layoutEffectStartTime = now(); -} -function transferActualDuration(fiber) { - for (var child = fiber.child; child; ) - (fiber.actualDuration += child.actualDuration), (child = child.sibling); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$71 in Component) + void 0 === newProps[propName$71] && + (newProps[propName$71] = Component[propName$71]); + } + return newProps; } var reportGlobalError = "function" === typeof reportError @@ -5177,9 +5294,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { + } catch (e$72) { setTimeout(function () { - throw e$70; + throw e$72; }); } } @@ -5190,9 +5307,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$71) { + } catch (e$73) { setTimeout(function () { - throw e$71; + throw e$73; }); } } @@ -7400,122 +7517,139 @@ function commitCallbacks(updateQueue, context) { ) callCallback(callbacks[updateQueue], context); } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +function shouldProfile$1(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - markStateUpdateScheduled(inst, lane); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markForceUpdateScheduled && - injectedProfilingHooks.markForceUpdateScheduled(inst, lane); +function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookEffectListMount(flags, finishedWork) { + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + ); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped(); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext +} +function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor ) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + try { + var updateQueue = finishedWork.updateQueue, + lastEffect = null !== updateQueue ? updateQueue.lastEffect : null; + if (null !== lastEffect) { + var firstEffect = lastEffect.next; + updateQueue = firstEffect; + do { + if ((updateQueue.tag & flags) === flags) { + var inst = updateQueue.inst, + destroy = inst.destroy; + void 0 !== destroy && + ((inst.destroy = void 0), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + markComponentLayoutEffectUnmountStarted(finishedWork), + safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), + 0 !== (flags & 8) + ? null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext +function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListMount(hookFlags, finishedWork), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListMount(hookFlags, finishedWork); +} +function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags ) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + shouldProfile$1(finishedWork) + ? ((passiveEffectStartTime = now()), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordPassiveEffectDuration(finishedWork)) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$113 in Component) - void 0 === newProps[propName$113] && - (newProps[propName$113] = Component[propName$113]); +function commitClassCallbacks(finishedWork) { + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var instance = finishedWork.stateNode; + try { + commitCallbacks(updateQueue, instance); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } } - return newProps; -} -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; -function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); } function safelyCallComponentWillUnmount( current, @@ -7527,7 +7661,7 @@ function safelyCallComponentWillUnmount( current.memoizedProps ); instance.state = current.memoizedState; - if (shouldProfile(current)) { + if (shouldProfile$1(current)) { startLayoutEffectTimer(); try { instance.componentWillUnmount(); @@ -7538,8 +7672,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$118) { + captureCommitPhaseError(current, nearestMountedAncestor, error$118); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -7557,7 +7691,7 @@ function safelyAttachRef(current, nearestMountedAncestor) { instanceToUse = instance; } if ("function" === typeof ref) - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { @@ -7576,7 +7710,7 @@ function safelyDetachRef(current, nearestMountedAncestor) { if (null !== ref) if ("function" === typeof refCleanup) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), refCleanup(); } finally { @@ -7592,15 +7726,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else if ("function" === typeof ref) try { - if (shouldProfile(current)) + if (shouldProfile$1(current)) try { startLayoutEffectTimer(), ref(null); } finally { recordLayoutEffectDuration(current); } else ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$119) { + captureCommitPhaseError(current, nearestMountedAncestor, error$119); } else ref.current = null; } @@ -7611,6 +7745,148 @@ function safelyCallDestroy(current, nearestMountedAncestor, destroy) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } +function commitProfilerUpdate( + finishedWork, + current, + commitTime, + effectDuration +) { + if (executionContext & 4) + try { + var _finishedWork$memoize = finishedWork.memoizedProps, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + finishedWork.memoizedProps.id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitTime + ); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$2)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null; +function shouldProfile(current) { + return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); +} var shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { eventsEnabled = _enabled; @@ -7636,7 +7912,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$21) { + } catch (e$22) { JSCompiler_temp = null; break a; } @@ -7692,59 +7968,69 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags; - switch (firstChild.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + focusNode = firstChild.alternate; + root = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + if (0 !== (root & 1024) && null !== focusNode) { + root = void 0; + JSCompiler_temp = firstChild; + anchorOffset = focusNode.memoizedProps; + focusNode = focusNode.memoizedState; + selection = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + anchorOffset, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + root = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + focusNode + ); + selection.__reactInternalSnapshotBeforeUpdate = root; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (root & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -7754,176 +8040,9 @@ function commitBeforeMutationEffects(root, firstChild) { } nextEffect = firstChild.return; } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; - return current; -} -function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor -) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && markComponentLayoutEffectUnmountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - ); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - 0 !== (flags & 8) - ? null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped(); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$119) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$119); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7938,7 +8057,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidMount(); @@ -7949,11 +8068,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$120) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$120 + error$115 ); } else { @@ -7962,7 +8081,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current.memoizedProps ); current = current.memoizedState; - if (shouldProfile(finishedWork)) { + if (shouldProfile$1(finishedWork)) { startLayoutEffectTimer(); try { finishedRoot.componentDidUpdate( @@ -7970,11 +8089,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$121) { + } catch (error$116) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$121 + error$116 ); } recordLayoutEffectDuration(finishedWork); @@ -7985,11 +8104,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$122) { + } catch (error$117) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$122 + error$117 ); } } @@ -8023,12 +8142,30 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + if (flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8058,98 +8195,29 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); - break; - default: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - } -} -function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - 5 === fiber.tag && - ((alternate = fiber.stateNode), - null !== alternate && detachDeletedInstance(alternate)); - fiber.stateNode = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; -} -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; + break; + default: + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$2)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + 5 === fiber.tag && + ((alternate = fiber.stateNode), + null !== alternate && detachDeletedInstance(alternate)); + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } var hostParent = null, hostParentIsContainer = !1; @@ -8198,8 +8266,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8208,35 +8280,55 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$129 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$129; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8265,18 +8357,18 @@ function commitDeletionEffectsOnFiber( ) { prevHostParentIsContainer = prevHostParent = prevHostParent.next; do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, + prevHostParentIsContainer$129 = prevHostParentIsContainer.tag; + var inst = prevHostParentIsContainer.inst, destroy = inst.destroy; void 0 !== destroy && - (0 !== (tag & 2) + (0 !== (prevHostParentIsContainer$129 & 2) ? ((inst.destroy = void 0), safelyCallDestroy( deletedFiber, nearestMountedAncestor, destroy )) - : 0 !== (tag & 4) && + : 0 !== (prevHostParentIsContainer$129 & 4) && (markComponentLayoutEffectUnmountStarted(deletedFiber), shouldProfile(deletedFiber) ? (startLayoutEffectTimer(), @@ -8405,39 +8497,35 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) for (var i = 0; i < deletions.length; i++) { - var childToDelete = deletions[i]; - try { - var root = root$jscomp$0, - returnFiber = parentFiber, - parent = returnFiber; - a: for (; null !== parent; ) { - switch (parent.tag) { - case 27: - case 5: - hostParent = parent.stateNode; - hostParentIsContainer = !1; - break a; - case 3: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - case 4: - hostParent = parent.stateNode.containerInfo; - hostParentIsContainer = !0; - break a; - } - parent = parent.return; + var childToDelete = deletions[i], + root = root$jscomp$0, + returnFiber = parentFiber, + parent = returnFiber; + a: for (; null !== parent; ) { + switch (parent.tag) { + case 27: + case 5: + hostParent = parent.stateNode; + hostParentIsContainer = !1; + break a; + case 3: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; + case 4: + hostParent = parent.stateNode.containerInfo; + hostParentIsContainer = !0; + break a; } - if (null === hostParent) throw Error(formatProdErrorMessage(160)); - commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); - hostParent = null; - hostParentIsContainer = !1; - var alternate = childToDelete.alternate; - null !== alternate && (alternate.return = null); - childToDelete.return = null; - } catch (error) { - captureCommitPhaseError(childToDelete, parentFiber, error); + parent = parent.return; } + if (null === hostParent) throw Error(formatProdErrorMessage(160)); + commitDeletionEffectsOnFiber(root, returnFiber, childToDelete); + hostParent = null; + hostParentIsContainer = !1; + root = childToDelete.alternate; + null !== root && (root.return = null); + childToDelete.return = null; } if (parentFiber.subtreeFlags & 13878) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -8455,36 +8543,14 @@ function commitMutationEffectsOnFiber(finishedWork, root) { case 15: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4) { - try { - commitHookEffectListUnmount(3, finishedWork, finishedWork.return), - commitHookEffectListMount(3, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$136) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$136 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$137) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$137 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + shouldProfile(finishedWork) + ? (startLayoutEffectTimer(), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return), + recordLayoutEffectDuration(finishedWork)) + : commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8509,56 +8575,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -8566,36 +8631,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -8603,16 +8668,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -8627,64 +8692,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$138) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$138 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8693,24 +8757,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$139) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$139); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$141) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$141); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -8719,12 +8780,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$142) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$142); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8738,8 +8799,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$143) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$143); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -8770,15 +8831,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || domElement; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -8786,13 +8847,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -8801,45 +8862,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$126) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$126 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -8889,11 +8949,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -8906,21 +8966,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$127 = JSCompiler_inline_result.stateNode; + var parent$120 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$127, ""), + (setTextContent(parent$120, ""), (JSCompiler_inline_result.flags &= -33)); - var before$128 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$128, parent$127); + var before$121 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$121, parent$120); break; case 3: case 4: - var parent$129 = JSCompiler_inline_result.stateNode.containerInfo, - before$130 = getHostSibling(finishedWork); + var parent$122 = JSCompiler_inline_result.stateNode.containerInfo, + before$123 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$130, - parent$129 + before$123, + parent$122 ); break; default: @@ -9030,23 +9090,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current = finishedWork; + finishedRoot = current.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current, current.return, error); + } + current = finishedWork; + finishedRoot = current.updateQueue; + if (null !== finishedRoot) { + var instance = current.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current, current.return, error); } - current = finishedWork.updateQueue; - if (null !== current) { - var hiddenCallbacks = current.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current.shared.hiddenCallbacks = null, current = 0; - current < hiddenCallbacks.length; - current++ - ) - callCallback(hiddenCallbacks[current], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9064,7 +9131,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9073,9 +9140,25 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) + a: for ( + flags = finishedWork.stateNode.effectDuration, + commitProfilerUpdate(finishedWork, current, commitTime, flags), + enqueuePendingPassiveProfilerEffect(finishedWork), + finishedWork = finishedWork.return; + null !== finishedWork; + + ) { + switch (finishedWork.tag) { + case 3: + finishedWork.stateNode.effectDuration += flags; + break a; + case 12: + finishedWork.stateNode.effectDuration += flags; + break a; + } + finishedWork = finishedWork.return; + } break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -9106,22 +9189,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$148) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$148); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork) { var previousCache = null; null !== current && @@ -9419,25 +9486,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -9854,14 +9902,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$154 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$154 = lastTailNode), + for (var lastTailNode$142 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$142 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$154 + null === lastTailNode$142 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$154.sibling = null); + : (lastTailNode$142.sibling = null); } } function bubbleProperties(completedWork) { @@ -9873,53 +9921,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$156 = completedWork.selfBaseDuration, - child$157 = completedWork.child; - null !== child$157; + var treeBaseDuration$144 = completedWork.selfBaseDuration, + child$145 = completedWork.child; + null !== child$145; ) - (newChildLanes |= child$157.lanes | child$157.childLanes), - (subtreeFlags |= child$157.subtreeFlags & 31457280), - (subtreeFlags |= child$157.flags & 31457280), - (treeBaseDuration$156 += child$157.treeBaseDuration), - (child$157 = child$157.sibling); - completedWork.treeBaseDuration = treeBaseDuration$156; + (newChildLanes |= child$145.lanes | child$145.childLanes), + (subtreeFlags |= child$145.subtreeFlags & 31457280), + (subtreeFlags |= child$145.flags & 31457280), + (treeBaseDuration$144 += child$145.treeBaseDuration), + (child$145 = child$145.sibling); + completedWork.treeBaseDuration = treeBaseDuration$144; } else for ( - treeBaseDuration$156 = completedWork.child; - null !== treeBaseDuration$156; + treeBaseDuration$144 = completedWork.child; + null !== treeBaseDuration$144; ) (newChildLanes |= - treeBaseDuration$156.lanes | treeBaseDuration$156.childLanes), - (subtreeFlags |= treeBaseDuration$156.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$156.flags & 31457280), - (treeBaseDuration$156.return = completedWork), - (treeBaseDuration$156 = treeBaseDuration$156.sibling); + treeBaseDuration$144.lanes | treeBaseDuration$144.childLanes), + (subtreeFlags |= treeBaseDuration$144.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$144.flags & 31457280), + (treeBaseDuration$144.return = completedWork), + (treeBaseDuration$144 = treeBaseDuration$144.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$156 = completedWork.actualDuration; - child$157 = completedWork.selfBaseDuration; + treeBaseDuration$144 = completedWork.actualDuration; + child$145 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$156 += child.actualDuration), - (child$157 += child.treeBaseDuration), + (treeBaseDuration$144 += child.actualDuration), + (child$145 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$156; - completedWork.treeBaseDuration = child$157; + completedWork.actualDuration = treeBaseDuration$144; + completedWork.treeBaseDuration = child$145; } else for ( - treeBaseDuration$156 = completedWork.child; - null !== treeBaseDuration$156; + treeBaseDuration$144 = completedWork.child; + null !== treeBaseDuration$144; ) (newChildLanes |= - treeBaseDuration$156.lanes | treeBaseDuration$156.childLanes), - (subtreeFlags |= treeBaseDuration$156.subtreeFlags), - (subtreeFlags |= treeBaseDuration$156.flags), - (treeBaseDuration$156.return = completedWork), - (treeBaseDuration$156 = treeBaseDuration$156.sibling); + treeBaseDuration$144.lanes | treeBaseDuration$144.childLanes), + (subtreeFlags |= treeBaseDuration$144.subtreeFlags), + (subtreeFlags |= treeBaseDuration$144.flags), + (treeBaseDuration$144.return = completedWork), + (treeBaseDuration$144 = treeBaseDuration$144.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10212,11 +10260,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$172 = null; + var cache$160 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$172 = newProps.memoizedState.cachePool.pool); - cache$172 !== type && (newProps.flags |= 2048); + (cache$160 = newProps.memoizedState.cachePool.pool); + cache$160 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10246,8 +10294,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$172 = type.rendering; - if (null === cache$172) + cache$160 = type.rendering; + if (null === cache$160) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10255,11 +10303,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$172 = findFirstSuspended(current); - if (null !== cache$172) { + cache$160 = findFirstSuspended(current); + if (null !== cache$160) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$172.updateQueue; + current = cache$160.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10284,7 +10332,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$172)), null !== current)) { + if (((current = findFirstSuspended(cache$160)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10294,7 +10342,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$172.alternate && + !cache$160.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10307,13 +10355,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$172.sibling = workInProgress.child), - (workInProgress.child = cache$172)) + ? ((cache$160.sibling = workInProgress.child), + (workInProgress.child = cache$160)) : ((current = type.last), null !== current - ? (current.sibling = cache$172) - : (workInProgress.child = cache$172), - (type.last = cache$172)); + ? (current.sibling = cache$160) + : (workInProgress.child = cache$160), + (type.last = cache$160)); } if (null !== type.tail) return ( @@ -10495,6 +10543,7 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10546,7 +10595,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10558,7 +10608,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )), ensureRootIsScheduled(root); } @@ -10581,7 +10632,13 @@ function performConcurrentWorkOnRoot(root, didTimeout) { if (0 !== didTimeout) { var renderWasConcurrent = shouldTimeSlice; do { - if (6 === didTimeout) markRootSuspended(root, lanes, 0); + if (6 === didTimeout) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { shouldTimeSlice = root.current.alternate; if ( @@ -10613,7 +10670,12 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } if (1 === didTimeout) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } root.finishedWork = shouldTimeSlice; @@ -10629,7 +10691,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -10651,7 +10714,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( @@ -10663,7 +10727,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ), didTimeout ); @@ -10676,7 +10741,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } } @@ -10728,7 +10794,8 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + didSkipSuspendedSiblings ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10747,7 +10814,7 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -10795,25 +10862,28 @@ function isRenderConsistentWithExternalStores(finishedWork) { function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; 268435456 !== updatedLanes && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended(root, suspendedLanes, spawnedLane) { +function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didSkipSuspendedSiblings +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -10842,13 +10912,18 @@ function performSyncWorkOnRoot(root, lanes) { if (1 === exitStatus) return ( prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), + markRootSuspended(root, lanes, 0, !1), ensureRootIsScheduled(root), null ); if (6 === exitStatus) return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), + markRootSuspended( + root, + lanes, + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings + ), ensureRootIsScheduled(root), null ); @@ -10901,7 +10976,8 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = !1; + workInProgressRootDidAttachPingListener = + workInProgressRootDidSkipSuspendedSiblings = !1; workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = @@ -10919,9 +10995,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11020,7 +11096,8 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -11064,8 +11141,8 @@ function renderRootSync(root, lanes) { } workLoopSync(); break; - } catch (thrownValue$187) { - handleThrow(root, thrownValue$187); + } catch (thrownValue$175) { + handleThrow(root, thrownValue$175); } while (1); lanes && root.shellSuspendCounter++; @@ -11185,8 +11262,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$189) { - handleThrow(root, thrownValue$189); + } catch (thrownValue$177) { + handleThrow(root, thrownValue$177); } while (1); resetContextDependencies(); @@ -11296,39 +11373,20 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + unitOfWork.flags & 32768 + ? unwindUnitOfWork(unitOfWork, !0) + : completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } var current = completedWork.alternate; unitOfWork = completedWork.return; 0 === (completedWork.mode & 2) @@ -11349,6 +11407,36 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !1); + next = unitOfWork.actualDuration; + for (var child = unitOfWork.child; null !== child; ) + (next += child.actualDuration), (child = child.sibling); + unitOfWork.actualDuration = next; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, @@ -11484,7 +11572,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$193 = rootWithPendingPassiveEffects, + var root$181 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11529,7 +11617,7 @@ function flushPassiveEffects() { _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit, - commitTime$117 = commitTime, + commitTime$125 = commitTime, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && @@ -11537,7 +11625,7 @@ function flushPassiveEffects() { id, phase, passiveEffectDuration, - commitTime$117 + commitTime$125 ); var parentFiber = finishedWork.return; b: for (; null !== parentFiber; ) { @@ -11577,7 +11665,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$193, remainingLanes); + releaseRootPooledCache(root$181, remainingLanes); } } return !1; @@ -11658,6 +11746,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); @@ -11749,14 +11838,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$195 = firstScheduledRoot; null !== root$195; ) { + for (var root$183 = firstScheduledRoot; null !== root$183; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$195.pendingLanes; + var pendingLanes = root$183.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$195.suspendedLanes, - pingedLanes = root$195.pingedLanes; + var suspendedLanes = root$183.suspendedLanes, + pingedLanes = root$183.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11770,17 +11859,17 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$195, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$183, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$195, - root$195 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$183, + root$183 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 !== (JSCompiler_inline_result & 3) && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$195, JSCompiler_inline_result)); - root$195 = root$195.next; + performSyncWorkOnRoot(root$183, JSCompiler_inline_result)); + root$183 = root$183.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11821,12 +11910,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11990,20 +12079,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1504 = 0; - i$jscomp$inline_1504 < simpleEventPluginEvents.length; - i$jscomp$inline_1504++ + var i$jscomp$inline_1508 = 0; + i$jscomp$inline_1508 < simpleEventPluginEvents.length; + i$jscomp$inline_1508++ ) { - var eventName$jscomp$inline_1505 = - simpleEventPluginEvents[i$jscomp$inline_1504], - domEventName$jscomp$inline_1506 = - eventName$jscomp$inline_1505.toLowerCase(), - capitalizedEvent$jscomp$inline_1507 = - eventName$jscomp$inline_1505[0].toUpperCase() + - eventName$jscomp$inline_1505.slice(1); + var eventName$jscomp$inline_1509 = + simpleEventPluginEvents[i$jscomp$inline_1508], + domEventName$jscomp$inline_1510 = + eventName$jscomp$inline_1509.toLowerCase(), + capitalizedEvent$jscomp$inline_1511 = + eventName$jscomp$inline_1509[0].toUpperCase() + + eventName$jscomp$inline_1509.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1506, - "on" + capitalizedEvent$jscomp$inline_1507 + domEventName$jscomp$inline_1510, + "on" + capitalizedEvent$jscomp$inline_1511 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -13186,34 +13275,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$209 = props[hasSrc]; - if (null != propValue$209) + var propValue$197 = props[hasSrc]; + if (null != propValue$197) switch (hasSrc) { case "name": - hasSrcSet = propValue$209; + hasSrcSet = propValue$197; break; case "type": - propValue = propValue$209; + propValue = propValue$197; break; case "checked": - checked = propValue$209; + checked = propValue$197; break; case "defaultChecked": - defaultChecked = propValue$209; + defaultChecked = propValue$197; break; case "value": - propKey = propValue$209; + propKey = propValue$197; break; case "defaultValue": - defaultValue = propValue$209; + defaultValue = propValue$197; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$209) + if (null != propValue$197) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$209, props, null); + setProp(domElement, tag, hasSrc, propValue$197, props, null); } } initInput( @@ -13350,14 +13439,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$209 in props) - props.hasOwnProperty(propValue$209) && - ((hasSrc = props[propValue$209]), + for (propValue$197 in props) + props.hasOwnProperty(propValue$197) && + ((hasSrc = props[propValue$197]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$209, + propValue$197, hasSrc, props, void 0 @@ -13405,14 +13494,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$226 in nextProps) { - var propKey = nextProps[propKey$226]; - lastProp = lastProps[propKey$226]; + for (var propKey$214 in nextProps) { + var propKey = nextProps[propKey$214]; + lastProp = lastProps[propKey$214]; if ( - nextProps.hasOwnProperty(propKey$226) && + nextProps.hasOwnProperty(propKey$214) && (null != propKey || null != lastProp) ) - switch (propKey$226) { + switch (propKey$214) { case "type": type = propKey; break; @@ -13441,7 +13530,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$226, + propKey$214, propKey, nextProps, lastProp @@ -13460,7 +13549,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$226 = null; + propKey = value = defaultValue = propKey$214 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13491,7 +13580,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$226 = type; + propKey$214 = type; break; case "defaultValue": defaultValue = type; @@ -13512,15 +13601,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$226 - ? updateOptions(domElement, !!lastProps, propKey$226, !1) + null != propKey$214 + ? updateOptions(domElement, !!lastProps, propKey$214, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$226 = null; + propKey = propKey$214 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13544,7 +13633,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$226 = name; + propKey$214 = name; break; case "defaultValue": propKey = name; @@ -13558,17 +13647,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$226, propKey); + updateTextarea(domElement, propKey$214, propKey); return; case "option": - for (var propKey$242 in lastProps) + for (var propKey$230 in lastProps) if ( - ((propKey$226 = lastProps[propKey$242]), - lastProps.hasOwnProperty(propKey$242) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$242)) + ((propKey$214 = lastProps[propKey$230]), + lastProps.hasOwnProperty(propKey$230) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$230)) ) - switch (propKey$242) { + switch (propKey$230) { case "selected": domElement.selected = !1; break; @@ -13576,33 +13665,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$242, + propKey$230, null, nextProps, - propKey$226 + propKey$214 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$226 = nextProps[lastDefaultValue]), + ((propKey$214 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$226 !== propKey && - (null != propKey$226 || null != propKey)) + propKey$214 !== propKey && + (null != propKey$214 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$226 && - "function" !== typeof propKey$226 && - "symbol" !== typeof propKey$226; + propKey$214 && + "function" !== typeof propKey$214 && + "symbol" !== typeof propKey$214; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$226, + propKey$214, nextProps, propKey ); @@ -13623,24 +13712,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$247 in lastProps) - (propKey$226 = lastProps[propKey$247]), - lastProps.hasOwnProperty(propKey$247) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$247) && - setProp(domElement, tag, propKey$247, null, nextProps, propKey$226); + for (var propKey$235 in lastProps) + (propKey$214 = lastProps[propKey$235]), + lastProps.hasOwnProperty(propKey$235) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$235) && + setProp(domElement, tag, propKey$235, null, nextProps, propKey$214); for (checked in nextProps) if ( - ((propKey$226 = nextProps[checked]), + ((propKey$214 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$226 !== propKey && - (null != propKey$226 || null != propKey)) + propKey$214 !== propKey && + (null != propKey$214 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$226) + if (null != propKey$214) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13648,7 +13737,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$226, + propKey$214, nextProps, propKey ); @@ -13656,49 +13745,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$252 in lastProps) - (propKey$226 = lastProps[propKey$252]), - lastProps.hasOwnProperty(propKey$252) && - void 0 !== propKey$226 && - !nextProps.hasOwnProperty(propKey$252) && + for (var propKey$240 in lastProps) + (propKey$214 = lastProps[propKey$240]), + lastProps.hasOwnProperty(propKey$240) && + void 0 !== propKey$214 && + !nextProps.hasOwnProperty(propKey$240) && setPropOnCustomElement( domElement, tag, - propKey$252, + propKey$240, void 0, nextProps, - propKey$226 + propKey$214 ); for (defaultChecked in nextProps) - (propKey$226 = nextProps[defaultChecked]), + (propKey$214 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$226 === propKey || - (void 0 === propKey$226 && void 0 === propKey) || + propKey$214 === propKey || + (void 0 === propKey$214 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$226, + propKey$214, nextProps, propKey ); return; } } - for (var propKey$257 in lastProps) - (propKey$226 = lastProps[propKey$257]), - lastProps.hasOwnProperty(propKey$257) && - null != propKey$226 && - !nextProps.hasOwnProperty(propKey$257) && - setProp(domElement, tag, propKey$257, null, nextProps, propKey$226); + for (var propKey$245 in lastProps) + (propKey$214 = lastProps[propKey$245]), + lastProps.hasOwnProperty(propKey$245) && + null != propKey$214 && + !nextProps.hasOwnProperty(propKey$245) && + setProp(domElement, tag, propKey$245, null, nextProps, propKey$214); for (lastProp in nextProps) - (propKey$226 = nextProps[lastProp]), + (propKey$214 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$226 === propKey || - (null == propKey$226 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$226, nextProps, propKey); + propKey$214 === propKey || + (null == propKey$214 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$214, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14243,26 +14332,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$265 = getResourcesFromRoot( + var styles$253 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$266 = styles$265.get(type); - resource$266 || + resource$254 = styles$253.get(type); + resource$254 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$266 = { + (resource$254 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$265.set(type, resource$266), - (styles$265 = JSCompiler_inline_result.querySelector( + styles$253.set(type, resource$254), + (styles$253 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$265._p && - ((resource$266.instance = styles$265), - (resource$266.state.loading = 5)), + !styles$253._p && + ((resource$254.instance = styles$253), + (resource$254.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14275,16 +14364,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$265 || + styles$253 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$266.state + resource$254.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$266; + return resource$254; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14381,37 +14470,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$271 = hoistableRoot.querySelector( + var instance$259 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$271) + if (instance$259) return ( (resource.state.loading |= 4), - (resource.instance = instance$271), - markNodeAsHoistable(instance$271), - instance$271 + (resource.instance = instance$259), + markNodeAsHoistable(instance$259), + instance$259 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$271 = ( + instance$259 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$271); - var linkInstance = instance$271; + markNodeAsHoistable(instance$259); + var linkInstance = instance$259; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$271, "link", instance); + setInitialProperties(instance$259, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$271, props.precedence, hoistableRoot); - return (resource.instance = instance$271); + insertStylesheet(instance$259, props.precedence, hoistableRoot); + return (resource.instance = instance$259); case "script": - instance$271 = getScriptKey(props.src); + instance$259 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$271) + getScriptSelectorFromKey(instance$259) )) ) return ( @@ -14420,7 +14509,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$271))) + if ((styleProps = preloadPropsMap.get(instance$259))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -14743,6 +14832,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -15462,16 +15552,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1757 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== - isomorphicReactPackageVersion$jscomp$inline_1753 + "19.0.0-rc-a03254bc-20240905" !== + isomorphicReactPackageVersion$jscomp$inline_1757 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1753, - "19.0.0-rc-7771d3a7-20240827" + isomorphicReactPackageVersion$jscomp$inline_1757, + "19.0.0-rc-a03254bc-20240905" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15491,18 +15581,18 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1760 = { +var internals$jscomp$inline_1764 = { bundleType: 0, - version: "19.0.0-rc-7771d3a7-20240827", + version: "19.0.0-rc-a03254bc-20240905", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-7771d3a7-20240827", + reconcilerVersion: "19.0.0-rc-a03254bc-20240905", getLaneLabelMap: function () { for ( - var map = new Map(), lane = 1, index$288 = 0; - 31 > index$288; - index$288++ + var map = new Map(), lane = 1, index$276 = 0; + 31 > index$276; + index$276++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -15515,16 +15605,16 @@ var internals$jscomp$inline_1760 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2140 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2156 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2140.isDisabled && - hook$jscomp$inline_2140.supportsFiber + !hook$jscomp$inline_2156.isDisabled && + hook$jscomp$inline_2156.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2140.inject( - internals$jscomp$inline_1760 + (rendererID = hook$jscomp$inline_2156.inject( + internals$jscomp$inline_1764 )), - (injectedHook = hook$jscomp$inline_2140); + (injectedHook = hook$jscomp$inline_2156); } catch (err) {} } function noop() {} @@ -15777,7 +15867,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js index 67393878d6c6f..ad7813e8832df 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js @@ -8566,5 +8566,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js index 8bda064d2ffaa..b5b05f99972ab 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js @@ -5622,4 +5622,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js index f6c07e29a80c1..57b9c2080181e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js @@ -8566,5 +8566,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js index 5c80916be670d..98caf86d62c64 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js @@ -5700,4 +5700,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js index f671015c168cb..25cee34ada0c4 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js @@ -8753,11 +8753,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8850,5 +8850,5 @@ startWork(request$jscomp$0); }); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js index 86d98a463a33c..e6027eea35c6f 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js @@ -5911,14 +5911,14 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_731 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_731 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_731, - "19.0.0-rc-7771d3a7-20240827" + "19.0.0-rc-a03254bc-20240905" ) ); exports.renderToReadableStream = function (children, options) { @@ -6007,4 +6007,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js index 9e667cb883714..7270300578a1b 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js @@ -5595,13 +5595,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_735 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_735 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_735 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5689,4 +5689,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js index 3c19a28a57bf6..db1b4fe3a8289 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js @@ -8772,11 +8772,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8880,5 +8880,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js index f3d80f80cef73..91015e7dc1600 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js @@ -6005,13 +6005,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_739 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_739 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_739 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6110,4 +6110,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js index 179ce3f6d8eaf..c99c7d8d60bb2 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js @@ -8630,11 +8630,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-7771d3a7-20240827" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToPipeableStream = function (children, options) { @@ -8676,5 +8676,5 @@ } }; }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js index 6475e58abd9ce..f5c455bc77234 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js @@ -5654,13 +5654,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_762 = React.version; if ( - "19.0.0-rc-7771d3a7-20240827" !== + "19.0.0-rc-a03254bc-20240905" !== isomorphicReactPackageVersion$jscomp$inline_762 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_762 + - "\n - react-dom: 19.0.0-rc-7771d3a7-20240827\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-a03254bc-20240905\nLearn more: https://react.dev/warnings/version-mismatch") ); function createDrainHandler(destination, request) { return function () { @@ -5935,4 +5935,4 @@ exports.renderToPipeableStream = function (children, options) { } }; }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js index 173968e695fe5..eed93fd44781a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js index 095b510774e87..aff9fd653cccc 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js index b8e5b5d5d8823..3ba79d07ed18a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js index 677e60302ca72..f4e689cfc5258 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index 9cade623320be..e615d64a4dae2 100644 --- a/packages/next/src/compiled/react-dom/package.json +++ b/packages/next/src/compiled/react-dom/package.json @@ -67,10 +67,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.25.0-rc-7771d3a7-20240827" + "scheduler": "0.25.0-rc-a03254bc-20240905" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-experimental/cjs/react.development.js b/packages/next/src/compiled/react-experimental/cjs/react.development.js index ef45f672d3fda..b28a930c2eeaa 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -1233,7 +1233,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-experimental/cjs/react.production.js b/packages/next/src/compiled/react-experimental/cjs/react.production.js index 9916bf518ef8c..95e0b6e2d4215 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.production.js @@ -562,4 +562,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js index d39f411b29a54..985967ee4db67 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js @@ -979,5 +979,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-experimental-7771d3a7-20240827"; + exports.version = "19.0.0-experimental-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js index 8e16a838764cf..b61820102df55 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js @@ -567,4 +567,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-experimental-7771d3a7-20240827"; +exports.version = "19.0.0-experimental-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index db9e4d6053862..62137480be330 100644 --- a/packages/next/src/compiled/react-is/package.json +++ b/packages/next/src/compiled/react-is/package.json @@ -1,6 +1,6 @@ { "name": "react-is", - "version": "19.0.0-rc-7771d3a7-20240827", + "version": "19.0.0-rc-a03254bc-20240905", "description": "Brand checking of React Elements.", "main": "index.js", "sideEffects": false, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json index 58e09426b50e0..b2de52d126612 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827", - "react-dom": "0.0.0-experimental-7771d3a7-20240827" + "react": "0.0.0-experimental-a03254bc-20240905", + "react-dom": "0.0.0-experimental-a03254bc-20240905" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js index 4f9fc1562a777..4f6e91f12fc75 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js @@ -324,6 +324,9 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + return currentOwner ? currentOwner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -521,6 +524,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = currentRequest ? currentRequest : null; + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -622,14 +674,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -656,7 +708,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -807,10 +859,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -882,7 +933,7 @@ } prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); props = callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1015,7 +1066,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1055,7 +1106,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1085,7 +1136,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1110,7 +1161,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1164,6 +1215,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1209,7 +1263,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1362,9 +1416,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1458,7 +1512,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1732,33 +1786,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1766,19 +1801,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1802,7 +1832,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -1994,6 +2024,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2035,9 +2094,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2069,11 +2128,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2086,13 +2145,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2201,7 +2260,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -2222,7 +2281,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2243,8 +2302,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3361,13 +3420,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - return currentOwner ? currentOwner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3408,10 +3465,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3563,7 +3643,7 @@ startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js index b902bf461ac3c..68f4c93c24597 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js @@ -320,6 +320,14 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + if (supportsComponentStorage) { + var owner = componentStorage.getStore(); + if (owner) return owner; + } + return null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -517,6 +525,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -626,14 +683,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -660,7 +717,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -811,10 +868,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -894,7 +950,7 @@ componentDebugInfo ) : callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1027,7 +1083,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1067,7 +1123,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1097,7 +1153,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1122,7 +1178,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1176,6 +1232,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1221,7 +1280,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1374,9 +1433,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1470,7 +1529,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1755,33 +1814,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1789,19 +1829,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1825,7 +1860,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -2017,6 +2052,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2058,9 +2122,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2092,11 +2156,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2109,13 +2173,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2224,7 +2288,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? supportsRequestStorage ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); @@ -2253,7 +2317,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2274,8 +2338,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3396,18 +3460,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - if (supportsComponentStorage) { - var owner = componentStorage.getStore(); - if (owner) return owner; - } - return null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3448,10 +3505,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3614,7 +3694,7 @@ const setTimeoutOrImmediate = startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js index 2bbb0ad1f8c23..9afa158423241 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3412,15 +3472,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3461,10 +3517,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/package.json b/packages/next/src/compiled/react-server-dom-turbopack/package.json index d95937760dc98..662ac9825244e 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827" + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json index 352747126cc0b..17855ceb80001 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "0.0.0-experimental-7771d3a7-20240827", - "react-dom": "0.0.0-experimental-7771d3a7-20240827", + "react": "0.0.0-experimental-a03254bc-20240905", + "react-dom": "0.0.0-experimental-a03254bc-20240905", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js index 0f6d80d7ebd73..25797e2f8a0a2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js @@ -324,6 +324,9 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + return currentOwner ? currentOwner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -521,6 +524,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = currentRequest ? currentRequest : null; + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -622,14 +674,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -656,7 +708,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -807,10 +859,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -882,7 +933,7 @@ } prepareToUseHooksForComponent(prevThenableState, componentDebugInfo); props = callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1015,7 +1066,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1055,7 +1106,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1085,7 +1136,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1110,7 +1161,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1164,6 +1215,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1209,7 +1263,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1362,9 +1416,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1458,7 +1512,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1732,33 +1786,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1766,19 +1801,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1802,7 +1832,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -1994,6 +2024,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2035,9 +2094,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2069,11 +2128,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2086,13 +2145,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2201,7 +2260,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -2222,7 +2281,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2243,8 +2302,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3366,13 +3425,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - return currentOwner ? currentOwner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3413,10 +3470,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3576,7 +3656,7 @@ startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js index c5eabf83b8a58..33e21c07b0e7a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js @@ -320,6 +320,14 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + if (supportsComponentStorage) { + var owner = componentStorage.getStore(); + if (owner) return owner; + } + return null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -517,6 +525,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -626,14 +683,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -660,7 +717,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -811,10 +868,9 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - model = stringToChunk(code + model + "\n"); - request.completedHintChunks.push(model); + code = serializeRowHeader("H" + code, id) + model + "\n"; + code = stringToChunk(code); + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -894,7 +950,7 @@ componentDebugInfo ) : callComponentInDEV(Component, props, componentDebugInfo); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1027,7 +1083,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1067,7 +1123,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1097,7 +1153,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1122,7 +1178,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1176,6 +1232,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); id = id.toString(16) + ":" + request + "\n"; @@ -1221,7 +1280,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - row = importId.toString(16) + ":I" + json + "\n", + row = serializeRowHeader("I", importId) + json + "\n", processedChunk = stringToChunk(row); request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); @@ -1374,9 +1433,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1470,7 +1529,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1755,33 +1814,14 @@ null !== request.destination ? ((request.status = CLOSED), closeWithError(request.destination, error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1789,19 +1829,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; id = stringToChunk(id); request.completedErrorChunks.push(id); } @@ -1825,7 +1860,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; id = stringToChunk(id); request.completedRegularChunks.push(id); } @@ -2017,6 +2052,35 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + id = stringToChunk(id); + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2058,9 +2122,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2092,11 +2156,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2109,13 +2173,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2224,7 +2288,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? supportsRequestStorage ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); @@ -2253,7 +2317,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2274,8 +2338,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3397,18 +3461,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - if (supportsComponentStorage) { - var owner = componentStorage.getStore(); - if (owner) return owner; - } - return null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3449,10 +3506,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, @@ -3615,7 +3695,7 @@ const setTimeoutOrImmediate = startWork(request); }, pull: function (controller) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), closeWithError(controller, request.fatalError); else if ( diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js index 87fb8b4e46712..4f59bff1c89d8 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3413,15 +3473,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3462,10 +3518,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js index 56fe8a4040e4e..ff55e31013a32 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -347,6 +347,11 @@ function unsupportedContext() { throw Error("Cannot read a Client Context from a Server Component."); } + function resolveOwner() { + if (currentOwner) return currentOwner; + var owner = componentStorage.getStore(); + return owner ? owner : null; + } function isObjectPrototype(object) { if (!object) return !1; var ObjectPrototype = Object.prototype; @@ -544,6 +549,55 @@ !filename.includes("node_modules") ); } + function filterStackTrace(request, error, skipFrames) { + request = request.filterStackFrame; + error = parseStackTrace(error, skipFrames); + for (skipFrames = 0; skipFrames < error.length; skipFrames++) { + var callsite = error[skipFrames], + functionName = callsite[0], + url = callsite[1]; + if (url.startsWith("rsc://React/")) { + var envIdx = url.indexOf("/", 12), + suffixIdx = url.lastIndexOf("?"); + -1 < envIdx && + -1 < suffixIdx && + (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); + } + request(url, functionName) || + (error.splice(skipFrames, 1), skipFrames--); + } + return error; + } + function patchConsole(consoleInst, methodName) { + var descriptor = Object.getOwnPropertyDescriptor(consoleInst, methodName); + if ( + descriptor && + (descriptor.configurable || descriptor.writable) && + "function" === typeof descriptor.value + ) { + var originalMethod = descriptor.value; + descriptor = Object.getOwnPropertyDescriptor(originalMethod, "name"); + var wrapperMethod = function () { + var request = resolveRequest(); + if (("assert" !== methodName || !arguments[0]) && null !== request) { + var stack = filterStackTrace( + request, + Error("react-stack-top-frame"), + 1 + ); + request.pendingChunks++; + var id = request.nextChunkId++, + owner = resolveOwner(); + emitConsoleChunk(request, id, methodName, owner, stack, arguments); + } + return originalMethod.apply(this, arguments); + }; + descriptor && Object.defineProperty(wrapperMethod, "name", descriptor); + Object.defineProperty(consoleInst, methodName, { + value: wrapperMethod + }); + } + } function getCurrentStackInDEV() { return ""; } @@ -650,14 +704,14 @@ task = thenable.reason; var digest = logRecoverableError(request, task, null); emitErrorChunk(request, newTask.id, digest, task); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); return newTask.id; default: - if (11 === request.status) + if (request.status === ABORTING) return ( request.abortableTasks.delete(newTask), - (newTask.status = 3), + (newTask.status = ABORTED), (task = stringify(serializeByValueID(request.fatalError))), emitModelChunk(request, newTask.id, task), newTask.id @@ -684,7 +738,7 @@ function (reason) { var _digest = logRecoverableError(request, reason, newTask); emitErrorChunk(request, newTask.id, _digest, reason); - newTask.status = 4; + newTask.status = ERRORED$1; request.abortableTasks.delete(newTask); enqueueFlush(request); } @@ -835,9 +889,8 @@ function emitHint(request, code, model) { model = stringify(model); var id = request.nextChunkId++; - code = "H" + code; - code = id.toString(16) + ":" + code; - request.completedHintChunks.push(code + model + "\n"); + code = serializeRowHeader("H" + code, id) + model + "\n"; + request.completedHintChunks.push(code); enqueueFlush(request); } function readThenable(thenable) { @@ -915,7 +968,7 @@ props, componentDebugInfo ); - if (11 === request.status) + if (request.status === ABORTING) throw ( ("object" !== typeof props || null === props || @@ -1048,7 +1101,7 @@ task.debugOwner ); retryTask(request, task); - return 1 === task.status + return task.status === COMPLETED ? serializeByValueID(task.id) : "$L" + task.id.toString(16); } @@ -1088,7 +1141,7 @@ switch (type.$$typeof) { case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; return renderElement(request, task, type, key, ref, props); case REACT_FORWARD_REF_TYPE: return renderFunctionComponent( @@ -1118,7 +1171,7 @@ pingedTasks.push(task); 1 === pingedTasks.length && ((request.flushScheduled = null !== request.destination), - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { return performWork(request); }) @@ -1143,7 +1196,7 @@ request.writtenObjects.set(model, serializeByValueID(id)); var task = { id: id, - status: 0, + status: PENDING$1, model: model, keyPath: keyPath, implicitSlot: implicitSlot, @@ -1197,6 +1250,9 @@ ? "$-Infinity" : "$NaN"; } + function serializeRowHeader(tag, id) { + return id.toString(16) + ":" + tag; + } function encodeReferenceChunk(request, id, reference) { request = stringify(reference); return id.toString(16) + ":" + request + "\n"; @@ -1241,7 +1297,7 @@ request.pendingChunks++; var importId = request.nextChunkId++, json = stringify(clientReferenceMetadata), - processedChunk = importId.toString(16) + ":I" + json + "\n"; + processedChunk = serializeRowHeader("I", importId) + json + "\n"; request.completedImportChunks.push(processedChunk); writtenClientReferences.set(clientReferenceKey, importId); return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName @@ -1393,9 +1449,9 @@ null !== parent && (parent.$$typeof === REACT_ELEMENT_TYPE || parent.$$typeof === REACT_LAZY_TYPE); - if (11 === request.status) + if (request.status === ABORTING) return ( - (task.status = 3), + (task.status = ABORTED), (task = request.fatalError), parent ? "$L" + task.toString(16) : serializeByValueID(task) ); @@ -1489,7 +1545,7 @@ case REACT_LAZY_TYPE: task.thenableState = null; elementReference = callLazyInitInDEV(value); - if (11 === request.status) throw null; + if (request.status === ABORTING) throw null; if ((_writtenObjects = value._debugInfo)) { if (null === debugID) return outlineTask(request, task); forwardDebugInfo(request, debugID, _writtenObjects); @@ -1769,33 +1825,14 @@ onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 12), (request.fatalError = error)); + : ((request.status = CLOSING), (request.fatalError = error)); } function emitErrorChunk(request, id, digest, error) { var env = (0, request.environmentName)(); try { if (error instanceof Error) { var message = String(error.message); - for ( - var filterStackFrame = request.filterStackFrame, - stack = parseStackTrace(error, 0), - i = 0; - i < stack.length; - i++ - ) { - var callsite = stack[i], - functionName = callsite[0], - url = callsite[1]; - if (url.startsWith("rsc://React/")) { - var envIdx = url.indexOf("/", 12), - suffixIdx = url.lastIndexOf("?"); - -1 < envIdx && - -1 < suffixIdx && - (url = callsite[1] = url.slice(envIdx + 1, suffixIdx)); - } - filterStackFrame(url, functionName) || (stack.splice(i, 1), i--); - } - var stack$jscomp$0 = stack; + var stack = filterStackTrace(request, error, 0); var errorEnv = error.environmentName; "string" === typeof errorEnv && (env = errorEnv); } else @@ -1803,19 +1840,14 @@ "object" === typeof error && null !== error ? describeObjectForErrorMessage(error) : String(error)), - (stack$jscomp$0 = []); + (stack = []); } catch (x) { (message = "An error occurred but serializing the error message failed."), - (stack$jscomp$0 = []); + (stack = []); } - digest = { - digest: digest, - message: message, - stack: stack$jscomp$0, - env: env - }; - id = id.toString(16) + ":E" + stringify(digest) + "\n"; + digest = { digest: digest, message: message, stack: stack, env: env }; + id = serializeRowHeader("E", id) + stringify(digest) + "\n"; request.completedErrorChunks.push(id); } function emitSymbolChunk(request, id, name) { @@ -1837,7 +1869,7 @@ value ); }); - id = id.toString(16) + ":D" + debugInfo + "\n"; + id = serializeRowHeader("D", id) + debugInfo + "\n"; request.completedRegularChunks.push(id); } function emitTypedArrayChunk(request, id, tag, typedArray) { @@ -2023,6 +2055,34 @@ request.completedRegularChunks.push(json); return model; } + function emitConsoleChunk( + request, + id, + methodName, + owner, + stackTrace, + args + ) { + var counter = { objectCount: 0 }, + env = (0, request.environmentName)(); + methodName = [methodName, stackTrace, owner, env]; + methodName.push.apply(methodName, args); + args = stringify(methodName, function (parentPropertyName, value) { + try { + return renderConsoleValue( + request, + counter, + this, + parentPropertyName, + value + ); + } catch (x) { + return "unknown value"; + } + }); + id = serializeRowHeader("W", id) + args + "\n"; + request.completedRegularChunks.push(id); + } function forwardDebugInfo(request, id, debugInfo) { for (var i = 0; i < debugInfo.length; i++) request.pendingChunks++, @@ -2064,9 +2124,9 @@ emitModelChunk(request, task.id, value)); } function retryTask(request, task) { - if (0 === task.status) { + if (task.status === PENDING$1) { var prevDebugID = debugID; - task.status = 5; + task.status = RENDERING; try { modelRoot = task.model; debugID = task.id; @@ -2098,11 +2158,11 @@ emitModelChunk(request, task.id, json); } request.abortableTasks.delete(task); - task.status = 1; + task.status = COMPLETED; } catch (thrownValue) { - if (11 === request.status) { + if (request.status === ABORTING) { request.abortableTasks.delete(task); - task.status = 3; + task.status = ABORTED; var model = stringify(serializeByValueID(request.fatalError)); emitModelChunk(request, task.id, model); } else { @@ -2115,13 +2175,13 @@ null !== x && "function" === typeof x.then ) { - task.status = 0; + task.status = PENDING$1; task.thenableState = getThenableStateAfterSuspending(); var ping = task.ping; x.then(ping, ping); } else { request.abortableTasks.delete(task); - task.status = 4; + task.status = ERRORED$1; var digest = logRecoverableError(request, x, task); emitErrorChunk(request, task.id, digest, x); } @@ -2231,7 +2291,7 @@ } function startWork(request) { request.flushScheduled = null !== request.destination; - 21 === request.type + request.type === PRERENDER ? scheduleMicrotask(function () { requestStorage.run(request, performWork, request); }) @@ -2251,7 +2311,7 @@ })); } function startFlowing(request, destination) { - if (12 === request.status) + if (request.status === CLOSING) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -2264,7 +2324,7 @@ } function abort(request, reason) { try { - 10 === request.status && (request.status = 11); + 10 === request.status && (request.status = ABORTING); var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { var error = @@ -2285,8 +2345,8 @@ request.pendingChunks++; emitErrorChunk(request, _errorId2, digest, error); abortableTasks.forEach(function (task) { - if (5 !== task.status) { - task.status = 3; + if (task.status !== RENDERING) { + task.status = ABORTED; var ref = serializeByValueID(_errorId2); task = encodeReferenceChunk(request, task.id, ref); request.completedErrorChunks.push(task); @@ -3378,15 +3438,11 @@ void 0 === entry && ((entry = resourceType()), cache.set(resourceType, entry)); return entry; - }, - getOwner: function () { - if (currentOwner) return currentOwner; - var owner = componentStorage.getStore(); - return owner ? owner : null; } - }, - ReactSharedInternalsServer = - React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; + }; + DefaultAsyncDispatcher.getOwner = resolveOwner; + var ReactSharedInternalsServer = + React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; if (!ReactSharedInternalsServer) throw Error( 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.' @@ -3427,10 +3483,33 @@ getPrototypeOf = Object.getPrototypeOf, jsxPropsParents = new WeakMap(), jsxChildrenParents = new WeakMap(), - CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"), - ObjectPrototype = Object.prototype, + CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference"); + "object" === typeof console && + null !== console && + (patchConsole(console, "assert"), + patchConsole(console, "debug"), + patchConsole(console, "dir"), + patchConsole(console, "dirxml"), + patchConsole(console, "error"), + patchConsole(console, "group"), + patchConsole(console, "groupCollapsed"), + patchConsole(console, "groupEnd"), + patchConsole(console, "info"), + patchConsole(console, "log"), + patchConsole(console, "table"), + patchConsole(console, "trace"), + patchConsole(console, "warn")); + var ObjectPrototype = Object.prototype, stringify = JSON.stringify, + PENDING$1 = 0, + COMPLETED = 1, + ABORTED = 3, + ERRORED$1 = 4, + RENDERING = 5, + ABORTING = 11, + CLOSING = 12, CLOSED = 13, + PRERENDER = 21, currentRequest = null, debugID = null, modelRoot = !1, diff --git a/packages/next/src/compiled/react-server-dom-webpack/package.json b/packages/next/src/compiled/react-server-dom-webpack/package.json index 4d1d9dfc69f72..b24434873a303 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "19.0.0-rc-7771d3a7-20240827", - "react-dom": "19.0.0-rc-7771d3a7-20240827", + "react": "19.0.0-rc-a03254bc-20240905", + "react-dom": "19.0.0-rc-a03254bc-20240905", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react/cjs/react.development.js b/packages/next/src/compiled/react/cjs/react.development.js index 7126d341e05ed..1265b6889d366 100644 --- a/packages/next/src/compiled/react/cjs/react.development.js +++ b/packages/next/src/compiled/react/cjs/react.development.js @@ -1517,7 +1517,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react/cjs/react.production.js b/packages/next/src/compiled/react/cjs/react.production.js index 2a9081477239c..a1bea69c5b312 100644 --- a/packages/next/src/compiled/react/cjs/react.production.js +++ b/packages/next/src/compiled/react/cjs/react.production.js @@ -536,4 +536,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/react/cjs/react.react-server.development.js b/packages/next/src/compiled/react/cjs/react.react-server.development.js index 5129867cd65f2..72e0a2e83398f 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.development.js @@ -1113,5 +1113,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-rc-7771d3a7-20240827"; + exports.version = "19.0.0-rc-a03254bc-20240905"; })(); diff --git a/packages/next/src/compiled/react/cjs/react.react-server.production.js b/packages/next/src/compiled/react/cjs/react.react-server.production.js index 17974fedf0a07..392dff3a969e3 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.production.js @@ -424,4 +424,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-rc-7771d3a7-20240827"; +exports.version = "19.0.0-rc-a03254bc-20240905"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index ecfa6bcdddea5..349a82673cd10 100644 --- a/packages/next/src/compiled/unistore/unistore.js +++ b/packages/next/src/compiled/unistore/unistore.js @@ -1 +1 @@ -(()=>{var t={583:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a{var t={30:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a