From 5452a01de0c8f80a5bc8b85b8b6fd42a93548474 Mon Sep 17 00:00:00 2001 From: AnselK Date: Tue, 15 Oct 2024 02:12:16 -0700 Subject: [PATCH] [Re-land] Make prerendering always non-blocking: Add missing feature flag checks (#31238) This is a partial re-land of https://github.com/facebook/react/pull/31056. We saw breakages surface after the original land and had to revert. Now that they've been fixed, let's try this again. This time we'll split up the commits to give us more control of testing and rollout internally. Original PR: https://github.com/facebook/react/pull/31056 Original Commit: https://github.com/facebook/react/pull/31056/commits/2a9fb445d98b60a97f3642cec2ff22469727e0c7 Revert PR: https://github.com/facebook/react/pull/31080 Commit description: ``` Neglected to wrap some places in the enableSiblingPrerendering flag. ``` Co-authored-by: Andrew Clark DiffTrain build for [13411e4589f3d999727c5322781e2dd7bef3b256](https://github.com/facebook/react/commit/13411e4589f3d999727c5322781e2dd7bef3b256) --- compiled/babel-plugin-react-refresh/index.js | 6 + .../facebook-www/JSXDEVRuntime-dev.classic.js | 131 +- .../facebook-www/JSXDEVRuntime-dev.modern.js | 131 +- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 212 +- compiled/facebook-www/React-dev.modern.js | 212 +- compiled/facebook-www/React-prod.classic.js | 277 +- compiled/facebook-www/React-prod.modern.js | 273 +- .../facebook-www/React-profiling.classic.js | 277 +- .../facebook-www/React-profiling.modern.js | 273 +- compiled/facebook-www/ReactART-dev.classic.js | 5569 ++++---- compiled/facebook-www/ReactART-dev.modern.js | 5452 ++++---- .../facebook-www/ReactART-prod.classic.js | 2836 ++-- compiled/facebook-www/ReactART-prod.modern.js | 2844 ++-- .../facebook-www/ReactCacheOld-dev.classic.js | 9 +- .../facebook-www/ReactCacheOld-dev.modern.js | 9 +- compiled/facebook-www/ReactDOM-dev.classic.js | 11518 ++++++++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 10022 +++++++------- .../facebook-www/ReactDOM-prod.classic.js | 3968 +++--- compiled/facebook-www/ReactDOM-prod.modern.js | 3941 +++--- .../ReactDOM-profiling.classic.js | 4676 ++++--- .../facebook-www/ReactDOM-profiling.modern.js | 4675 ++++--- .../ReactDOMServer-dev.classic.js | 1611 ++- .../facebook-www/ReactDOMServer-dev.modern.js | 2235 +-- .../ReactDOMServer-prod.classic.js | 1384 +- .../ReactDOMServer-prod.modern.js | 1354 +- .../ReactDOMServerStreaming-dev.modern.js | 2192 +-- .../ReactDOMServerStreaming-prod.modern.js | 1295 +- .../ReactDOMTesting-dev.classic.js | 11518 ++++++++-------- .../ReactDOMTesting-dev.modern.js | 10022 +++++++------- .../ReactDOMTesting-prod.classic.js | 3978 +++--- .../ReactDOMTesting-prod.modern.js | 3890 +++--- .../ReactFreshRuntime-dev.classic.js | 16 - .../ReactFreshRuntime-dev.modern.js | 16 - compiled/facebook-www/ReactIs-dev.classic.js | 4 +- compiled/facebook-www/ReactIs-dev.modern.js | 4 +- compiled/facebook-www/ReactIs-prod.classic.js | 2 +- compiled/facebook-www/ReactIs-prod.modern.js | 2 +- .../ReactReconciler-dev.classic.js | 5615 ++++---- .../ReactReconciler-dev.modern.js | 5555 ++++---- .../ReactReconciler-prod.classic.js | 3183 +++-- .../ReactReconciler-prod.modern.js | 3121 +++-- .../ReactTestRenderer-dev.classic.js | 4596 +++--- .../ReactTestRenderer-dev.modern.js | 4596 +++--- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 17 +- .../facebook-www/eslint-plugin-react-hooks.js | 97 +- 49 files changed, 64767 insertions(+), 58855 deletions(-) diff --git a/compiled/babel-plugin-react-refresh/index.js b/compiled/babel-plugin-react-refresh/index.js index 4858c8fddb533..dd72594ae4239 100644 --- a/compiled/babel-plugin-react-refresh/index.js +++ b/compiled/babel-plugin-react-refresh/index.js @@ -6,6 +6,12 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. + * + * @noformat + * @nolint + * @lightSyntaxTransform + * @preventMunge + * @oncall react_core */ "use strict"; diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js index f64369cdc015d..8b333d5fd3f9d 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -23,12 +23,11 @@ __DEV__ && ) args[_key2 - 1] = arguments[_key2]; _len2 = format; - _key2 = Error("react-stack-top-frame"); - var ReactSharedInternals = + _key2 = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - null != ReactSharedInternals && - ReactSharedInternals.getCurrentStack && - ((_key2 = ReactSharedInternals.getCurrentStack(_key2)), + null != _key2 && + _key2.getCurrentStack && + ((_key2 = _key2.getCurrentStack()), "" !== _key2 && ((_len2 += "%s"), args.push(_key2))); args.unshift(_len2); args.unshift(!1); @@ -182,8 +181,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -461,7 +466,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -593,13 +599,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -632,22 +640,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || + (!enableFastJSXWithoutStringRefs && "ref" in config) || "key" in config ) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef( + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( config[propName], getOwner(), type - )) - : (maybeKey[propName] = config[propName])); + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -753,6 +762,7 @@ __DEV__ && return info; } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) willCoercionThrow(mixedRef) && @@ -771,46 +781,51 @@ __DEV__ && return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - if ( - "function" !== typeof type || - (type.prototype && type.prototype.isReactComponent) - ) - (type = getComponentNameFromFiber(owner) || "Component"), - didWarnAboutStringRefs[type] || - (error( - 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', - type, - stringRef - ), - (didWarnAboutStringRefs[type] = !0)); - owner = owner.stateNode; - if (!owner) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - owner = owner.refs; - null === value ? delete owner[stringRef] : (owner[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + if ( + "function" !== typeof type || + (type.prototype && type.prototype.isReactComponent) + ) + (type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && + enableLogStringRefsProd(type, stringRef), + error( + 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', + type, + stringRef + ), + (didWarnAboutStringRefs[type] = !0)); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } var React = require("react"), dynamicFeatureFlags = require("ReactFeatureFlags"), - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, disableLegacyMode = dynamicFeatureFlags.disableLegacyMode; dynamicFeatureFlags = Symbol.for("react.element"); @@ -853,6 +868,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -861,8 +877,7 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, + var enableFastJSXWithoutStringRefs = disableStringRefs, didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js index 11911356d1826..c227e584f6df0 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js @@ -23,12 +23,11 @@ __DEV__ && ) args[_key2 - 1] = arguments[_key2]; _len2 = format; - _key2 = Error("react-stack-top-frame"); - var ReactSharedInternals = + _key2 = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - null != ReactSharedInternals && - ReactSharedInternals.getCurrentStack && - ((_key2 = ReactSharedInternals.getCurrentStack(_key2)), + null != _key2 && + _key2.getCurrentStack && + ((_key2 = _key2.getCurrentStack()), "" !== _key2 && ((_len2 += "%s"), args.push(_key2))); args.unshift(_len2); args.unshift(!1); @@ -182,8 +181,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -458,7 +463,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -590,13 +596,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -629,22 +637,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || + (!enableFastJSXWithoutStringRefs && "ref" in config) || "key" in config ) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef( + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( config[propName], getOwner(), type - )) - : (maybeKey[propName] = config[propName])); + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -750,6 +759,7 @@ __DEV__ && return info; } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) willCoercionThrow(mixedRef) && @@ -768,46 +778,51 @@ __DEV__ && return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - if ( - "function" !== typeof type || - (type.prototype && type.prototype.isReactComponent) - ) - (type = getComponentNameFromFiber(owner) || "Component"), - didWarnAboutStringRefs[type] || - (error( - 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', - type, - stringRef - ), - (didWarnAboutStringRefs[type] = !0)); - owner = owner.stateNode; - if (!owner) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - owner = owner.refs; - null === value ? delete owner[stringRef] : (owner[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + if ( + "function" !== typeof type || + (type.prototype && type.prototype.isReactComponent) + ) + (type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && + enableLogStringRefsProd(type, stringRef), + error( + 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', + type, + stringRef + ), + (didWarnAboutStringRefs[type] = !0)); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } var React = require("react"), dynamicFeatureFlags = require("ReactFeatureFlags"), - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX; + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing; dynamicFeatureFlags = dynamicFeatureFlags.renameElementSymbol; var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = dynamicFeatureFlags @@ -849,6 +864,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -857,8 +873,7 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, + var enableFastJSXWithoutStringRefs = disableStringRefs, didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 9d09158773357..a6043fa86b8c7 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -e02baf6c92833a0d45a77fb2e741676f393c24f7 +13411e4589f3d999727c5322781e2dd7bef3b256 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 9d09158773357..a6043fa86b8c7 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -e02baf6c92833a0d45a77fb2e741676f393c24f7 +13411e4589f3d999727c5322781e2dd7bef3b256 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 2701c44e1c4e5..159886f78b539 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -41,7 +41,7 @@ __DEV__ && _key++ ) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args, Error("react-stack-top-frame")); + printWarning("warn", format, args); } function error$jscomp$0(format) { for ( @@ -52,15 +52,15 @@ __DEV__ && _key2++ ) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args, Error("react-stack-top-frame")); + printWarning("error", format, args); } - function printWarning(level, format, args, currentStack) { + function printWarning(level, format, args) { level = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; null != level && level.getCurrentStack && - ((currentStack = level.getCurrentStack(currentStack)), - "" !== currentStack && ((format += "%s"), args.push(currentStack))); + ((level = level.getCurrentStack()), + "" !== level && ((format += "%s"), args.push(level))); args.unshift(format); args.unshift(!1); warningWWW.apply(null, args); @@ -268,8 +268,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -547,7 +553,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -654,13 +661,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error$jscomp$0( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -693,22 +702,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || + (!enableFastJSXWithoutStringRefs && "ref" in config) || "key" in config ) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef( + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( config[propName], getOwner(), type - )) - : (maybeKey[propName] = config[propName])); + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -822,6 +832,7 @@ __DEV__ && return info; } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) willCoercionThrow(mixedRef) && @@ -840,37 +851,41 @@ __DEV__ && return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - if ( - "function" !== typeof type || - (type.prototype && type.prototype.isReactComponent) - ) - (type = getComponentNameFromFiber(owner) || "Component"), - didWarnAboutStringRefs[type] || - (error$jscomp$0( - 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', - type, - stringRef - ), - (didWarnAboutStringRefs[type] = !0)); - owner = owner.stateNode; - if (!owner) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - owner = owner.refs; - null === value ? delete owner[stringRef] : (owner[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + if ( + "function" !== typeof type || + (type.prototype && type.prototype.isReactComponent) + ) + (type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && + enableLogStringRefsProd(type, stringRef), + error$jscomp$0( + 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', + type, + stringRef + ), + (didWarnAboutStringRefs[type] = !0)); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -1193,12 +1208,13 @@ __DEV__ && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -1303,6 +1319,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -1312,8 +1329,7 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, + var enableFastJSXWithoutStringRefs = disableStringRefs, didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, @@ -1359,7 +1375,8 @@ __DEV__ && return queueMicrotask(callback); }); } - : enqueueTask; + : enqueueTask, + ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -1401,6 +1418,7 @@ __DEV__ && exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; + exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function (callback) { var prevIsBatchingLegacy = disableLegacyMode ? !1 @@ -1563,13 +1581,13 @@ __DEV__ && (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -1681,13 +1699,13 @@ __DEV__ && isArrayImpl(type) ? (typeString = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); + ? ((typeString = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (i = + " Did you accidentally export a JSX literal instead of a component?")) + : (typeString = typeof type); error$jscomp$0( "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, @@ -1705,7 +1723,8 @@ __DEV__ && "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" )), hasValidRef(config) && - warnIfStringRefCannotBeAutoConverted(config, config.__self), + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, config.__self)), hasValidKey(config) && (checkKeyStringCoercion(config.key), (typeString = "" + config.key)), config)) @@ -1713,9 +1732,9 @@ __DEV__ && "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (i.ref = coerceStringRef(config[propName], getOwner(), type)) - : (i[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (i[propName] = config[propName]) + : (i.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) i.children = children; else if (1 < childrenLength) { @@ -1762,18 +1781,18 @@ __DEV__ && "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." ) : "function" !== typeof render - ? error$jscomp$0( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - error$jscomp$0( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); + ? error$jscomp$0( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + error$jscomp$0( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); null != render && null != render.defaultProps && error$jscomp$0( @@ -1872,20 +1891,19 @@ __DEV__ && }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; - var currentTransition = ReactSharedInternals.T; - ReactSharedInternals.T._updatedFibers = new Set(); + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + currentTransition._updatedFibers = new Set(); enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -1919,6 +1937,14 @@ __DEV__ && exports.unstable_useCacheRefresh = function () { return resolveDispatcher().useCacheRefresh(); }; + exports.unstable_useContextWithBailout = function (context, select) { + var dispatcher = resolveDispatcher(); + context.$$typeof === REACT_CONSUMER_TYPE && + error$jscomp$0( + "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" + ); + return dispatcher.unstable_useContextWithBailout(context, select); + }; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return resolveDispatcher().use(usable); @@ -1991,7 +2017,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-e02baf6c92-20240627"; + exports.version = "19.0.0-www-classic-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 7621bc99d7c1f..16f743f8fb2b2 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -41,7 +41,7 @@ __DEV__ && _key++ ) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args, Error("react-stack-top-frame")); + printWarning("warn", format, args); } function error$jscomp$0(format) { for ( @@ -52,15 +52,15 @@ __DEV__ && _key2++ ) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args, Error("react-stack-top-frame")); + printWarning("error", format, args); } - function printWarning(level, format, args, currentStack) { + function printWarning(level, format, args) { level = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; null != level && level.getCurrentStack && - ((currentStack = level.getCurrentStack(currentStack)), - "" !== currentStack && ((format += "%s"), args.push(currentStack))); + ((level = level.getCurrentStack()), + "" !== level && ((format += "%s"), args.push(level))); args.unshift(format); args.unshift(!1); warningWWW.apply(null, args); @@ -268,8 +268,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -544,7 +550,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -651,13 +658,15 @@ __DEV__ && null === type ? (isStaticChildren = "null") : isArrayImpl(type) - ? (isStaticChildren = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((isStaticChildren = - "<" + (getComponentNameFromType(type.type) || "Unknown") + " />"), - (children = - " Did you accidentally export a JSX literal instead of a component?")) - : (isStaticChildren = typeof type); + ? (isStaticChildren = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((isStaticChildren = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (children = + " Did you accidentally export a JSX literal instead of a component?")) + : (isStaticChildren = typeof type); error$jscomp$0( "React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", isStaticChildren, @@ -690,22 +699,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || + (!enableFastJSXWithoutStringRefs && "ref" in config) || "key" in config ) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef( + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( config[propName], getOwner(), type - )) - : (maybeKey[propName] = config[propName])); + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; @@ -819,6 +829,7 @@ __DEV__ && return info; } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) willCoercionThrow(mixedRef) && @@ -837,37 +848,41 @@ __DEV__ && return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - if ( - "function" !== typeof type || - (type.prototype && type.prototype.isReactComponent) - ) - (type = getComponentNameFromFiber(owner) || "Component"), - didWarnAboutStringRefs[type] || - (error$jscomp$0( - 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', - type, - stringRef - ), - (didWarnAboutStringRefs[type] = !0)); - owner = owner.stateNode; - if (!owner) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - owner = owner.refs; - null === value ? delete owner[stringRef] : (owner[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + if ( + "function" !== typeof type || + (type.prototype && type.prototype.isReactComponent) + ) + (type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && + enableLogStringRefsProd(type, stringRef), + error$jscomp$0( + 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref', + type, + stringRef + ), + (didWarnAboutStringRefs[type] = !0)); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -1190,12 +1205,13 @@ __DEV__ && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -1299,6 +1315,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -1308,8 +1325,7 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1, + var enableFastJSXWithoutStringRefs = disableStringRefs, didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, @@ -1355,7 +1371,8 @@ __DEV__ && return queueMicrotask(callback); }); } - : enqueueTask; + : enqueueTask, + ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -1397,6 +1414,7 @@ __DEV__ && exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; + exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function (callback) { var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth; @@ -1543,13 +1561,13 @@ __DEV__ && (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -1661,13 +1679,13 @@ __DEV__ && isArrayImpl(type) ? (typeString = "array") : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((typeString = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (i = - " Did you accidentally export a JSX literal instead of a component?")) - : (typeString = typeof type); + ? ((typeString = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (i = + " Did you accidentally export a JSX literal instead of a component?")) + : (typeString = typeof type); error$jscomp$0( "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, @@ -1685,7 +1703,8 @@ __DEV__ && "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform" )), hasValidRef(config) && - warnIfStringRefCannotBeAutoConverted(config, config.__self), + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, config.__self)), hasValidKey(config) && (checkKeyStringCoercion(config.key), (typeString = "" + config.key)), config)) @@ -1693,9 +1712,9 @@ __DEV__ && "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (i.ref = coerceStringRef(config[propName], getOwner(), type)) - : (i[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (i[propName] = config[propName]) + : (i.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) i.children = children; else if (1 < childrenLength) { @@ -1742,18 +1761,18 @@ __DEV__ && "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))." ) : "function" !== typeof render - ? error$jscomp$0( - "forwardRef requires a render function but was given %s.", - null === render ? "null" : typeof render - ) - : 0 !== render.length && - 2 !== render.length && - error$jscomp$0( - "forwardRef render functions accept exactly two parameters: props and ref. %s", - 1 === render.length - ? "Did you forget to use the ref parameter?" - : "Any additional parameter will be undefined." - ); + ? error$jscomp$0( + "forwardRef requires a render function but was given %s.", + null === render ? "null" : typeof render + ) + : 0 !== render.length && + 2 !== render.length && + error$jscomp$0( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + 1 === render.length + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined." + ); null != render && null != render.defaultProps && error$jscomp$0( @@ -1852,20 +1871,19 @@ __DEV__ && }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; - var currentTransition = ReactSharedInternals.T; - ReactSharedInternals.T._updatedFibers = new Set(); + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + currentTransition._updatedFibers = new Set(); enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -1899,6 +1917,14 @@ __DEV__ && exports.unstable_useCacheRefresh = function () { return resolveDispatcher().useCacheRefresh(); }; + exports.unstable_useContextWithBailout = function (context, select) { + var dispatcher = resolveDispatcher(); + context.$$typeof === REACT_CONSUMER_TYPE && + error$jscomp$0( + "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?" + ); + return dispatcher.unstable_useContextWithBailout(context, select); + }; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return resolveDispatcher().use(usable); @@ -1971,7 +1997,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-e02baf6c92-20240627"; + exports.version = "19.0.0-www-modern-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 74822acf42524..cfb7250c24f57 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -12,12 +12,14 @@ "use strict"; var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -91,46 +93,184 @@ pureComponentPrototype.constructor = PureComponent; assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, - ReactSharedInternals = { H: null, A: null, T: null, S: null }, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} +var ReactSharedInternals = { H: null, A: null, T: null, S: null }, hasOwnProperty = Object.prototype.hasOwnProperty; +function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return enableRenderableContext + ? (type._context.displayName || "Context") + ".Consumer" + : (type.displayName || "Context") + ".Consumer"; + case 10: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 23: + return "LegacyHidden"; + } + return null; +} function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); + if (!disableStringRefs) { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + return null; } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; +var didWarnAboutStringRefs; +enableLogStringRefsProd && (didWarnAboutStringRefs = {}); function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== _ref ? _ref : null, - props: props, - _owner: owner - }; + _ref = void 0 !== _ref ? _ref : null; + return disableStringRefs + ? { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props + } + : { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props, + _owner: owner + }; } function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ((!disableStringRefs && "ref" in config) || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( + config[propName], + getOwner(), + type + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; - for (var propName$0 in config) - void 0 === maybeKey[propName$0] && - (maybeKey[propName$0] = config[propName$0]); + for (var propName$1 in config) + void 0 === maybeKey[propName$1] && + (maybeKey[propName$1] = config[propName$1]); } return ReactElement(type, key, null, void 0, void 0, getOwner(), maybeKey); } @@ -141,7 +281,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -153,6 +293,7 @@ function isValidElement(object) { ); } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) mixedRef = "" + mixedRef; @@ -164,25 +305,34 @@ function coerceStringRef(mixedRef, owner, type) { return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + enableLogStringRefsProd && + ("function" !== typeof type || + (type.prototype && type.prototype.isReactComponent)) && + ((type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && enableLogStringRefsProd(type, stringRef), + (didWarnAboutStringRefs[type] = !0))); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -402,6 +552,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -443,6 +594,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; +exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function () { throw Error("act(...) is not supported in production builds of React."); }; @@ -459,9 +611,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - owner = element._owner; + owner = disableStringRefs ? void 0 : element._owner; if (null != config) { - void 0 !== config.ref && (owner = getOwner()); + void 0 !== config.ref && (owner = disableStringRefs ? void 0 : getOwner()); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -478,13 +630,13 @@ exports.cloneElement = function (element, config, children) { (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -528,9 +680,9 @@ exports.createElement = function (type, config, children) { "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -573,18 +725,18 @@ exports.memo = function (type, compare) { }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; + currentTransition = {}; + ReactSharedInternals.T = currentTransition; enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -608,6 +760,9 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; +exports.unstable_useContextWithBailout = function (context, select) { + return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); +}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -669,4 +824,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-e02baf6c92-20240627"; +exports.version = "19.0.0-www-classic-13411e45-20241014"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 3620c7781159f..f64f2001461d4 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -12,11 +12,12 @@ "use strict"; var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -91,46 +92,181 @@ pureComponentPrototype.constructor = PureComponent; assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, - ReactSharedInternals = { H: null, A: null, T: null, S: null }, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} +var ReactSharedInternals = { H: null, A: null, T: null, S: null }, hasOwnProperty = Object.prototype.hasOwnProperty; +function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return enableRenderableContext + ? (type._context.displayName || "Context") + ".Consumer" + : (type.displayName || "Context") + ".Consumer"; + case 10: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 23: + return "LegacyHidden"; + } + return null; +} function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); + if (!disableStringRefs) { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + return null; } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; +var didWarnAboutStringRefs; +enableLogStringRefsProd && (didWarnAboutStringRefs = {}); function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== _ref ? _ref : null, - props: props, - _owner: owner - }; + _ref = void 0 !== _ref ? _ref : null; + return disableStringRefs + ? { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props + } + : { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props, + _owner: owner + }; } function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ((!disableStringRefs && "ref" in config) || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( + config[propName], + getOwner(), + type + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; - for (var propName$0 in config) - void 0 === maybeKey[propName$0] && - (maybeKey[propName$0] = config[propName$0]); + for (var propName$1 in config) + void 0 === maybeKey[propName$1] && + (maybeKey[propName$1] = config[propName$1]); } return ReactElement(type, key, null, void 0, void 0, getOwner(), maybeKey); } @@ -141,7 +277,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -153,6 +289,7 @@ function isValidElement(object) { ); } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) mixedRef = "" + mixedRef; @@ -164,25 +301,34 @@ function coerceStringRef(mixedRef, owner, type) { return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + enableLogStringRefsProd && + ("function" !== typeof type || + (type.prototype && type.prototype.isReactComponent)) && + ((type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && enableLogStringRefsProd(type, stringRef), + (didWarnAboutStringRefs[type] = !0))); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -402,6 +548,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -443,6 +590,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; +exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function () { throw Error("act(...) is not supported in production builds of React."); }; @@ -459,9 +607,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - owner = element._owner; + owner = disableStringRefs ? void 0 : element._owner; if (null != config) { - void 0 !== config.ref && (owner = getOwner()); + void 0 !== config.ref && (owner = disableStringRefs ? void 0 : getOwner()); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -478,13 +626,13 @@ exports.cloneElement = function (element, config, children) { (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -528,9 +676,9 @@ exports.createElement = function (type, config, children) { "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -573,18 +721,18 @@ exports.memo = function (type, compare) { }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; + currentTransition = {}; + ReactSharedInternals.T = currentTransition; enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -608,6 +756,9 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; +exports.unstable_useContextWithBailout = function (context, select) { + return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); +}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -669,4 +820,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-e02baf6c92-20240627"; +exports.version = "19.0.0-www-modern-13411e45-20241014"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index f7efeda88ac35..b0a6c0e11adc7 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -16,12 +16,14 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -95,46 +97,184 @@ pureComponentPrototype.constructor = PureComponent; assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, - ReactSharedInternals = { H: null, A: null, T: null, S: null }, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} +var ReactSharedInternals = { H: null, A: null, T: null, S: null }, hasOwnProperty = Object.prototype.hasOwnProperty; +function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return enableRenderableContext + ? (type._context.displayName || "Context") + ".Consumer" + : (type.displayName || "Context") + ".Consumer"; + case 10: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 17: + case 28: + if (disableLegacyMode) break; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 23: + return "LegacyHidden"; + } + return null; +} function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); + if (!disableStringRefs) { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + return null; } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; +var didWarnAboutStringRefs; +enableLogStringRefsProd && (didWarnAboutStringRefs = {}); function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== _ref ? _ref : null, - props: props, - _owner: owner - }; + _ref = void 0 !== _ref ? _ref : null; + return disableStringRefs + ? { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props + } + : { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props, + _owner: owner + }; } function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ((!disableStringRefs && "ref" in config) || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( + config[propName], + getOwner(), + type + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; - for (var propName$0 in config) - void 0 === maybeKey[propName$0] && - (maybeKey[propName$0] = config[propName$0]); + for (var propName$1 in config) + void 0 === maybeKey[propName$1] && + (maybeKey[propName$1] = config[propName$1]); } return ReactElement(type, key, null, void 0, void 0, getOwner(), maybeKey); } @@ -145,7 +285,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -157,6 +297,7 @@ function isValidElement(object) { ); } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) mixedRef = "" + mixedRef; @@ -168,25 +309,34 @@ function coerceStringRef(mixedRef, owner, type) { return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + enableLogStringRefsProd && + ("function" !== typeof type || + (type.prototype && type.prototype.isReactComponent)) && + ((type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && enableLogStringRefsProd(type, stringRef), + (didWarnAboutStringRefs[type] = !0))); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -406,6 +556,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -447,6 +598,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; +exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function () { throw Error("act(...) is not supported in production builds of React."); }; @@ -463,9 +615,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - owner = element._owner; + owner = disableStringRefs ? void 0 : element._owner; if (null != config) { - void 0 !== config.ref && (owner = getOwner()); + void 0 !== config.ref && (owner = disableStringRefs ? void 0 : getOwner()); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -482,13 +634,13 @@ exports.cloneElement = function (element, config, children) { (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -532,9 +684,9 @@ exports.createElement = function (type, config, children) { "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -577,18 +729,18 @@ exports.memo = function (type, compare) { }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; + currentTransition = {}; + ReactSharedInternals.T = currentTransition; enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -612,6 +764,9 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; +exports.unstable_useContextWithBailout = function (context, select) { + return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); +}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -673,7 +828,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-e02baf6c92-20240627"; +exports.version = "19.0.0-www-classic-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index 7243e01ebe8f1..a7ade58801eb4 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -16,11 +16,12 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var dynamicFeatureFlags = require("ReactFeatureFlags"), - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - enableFastJSX = dynamicFeatureFlags.enableFastJSX, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -95,46 +96,181 @@ pureComponentPrototype.constructor = PureComponent; assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = !0; var isArrayImpl = Array.isArray, - ReactSharedInternals = { H: null, A: null, T: null, S: null }, + REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} +var ReactSharedInternals = { H: null, A: null, T: null, S: null }, hasOwnProperty = Object.prototype.hasOwnProperty; +function getComponentNameFromFiber(fiber) { + var type = fiber.type; + switch (fiber.tag) { + case 24: + return "Cache"; + case 9: + return enableRenderableContext + ? (type._context.displayName || "Context") + ".Consumer" + : (type.displayName || "Context") + ".Consumer"; + case 10: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return ( + (fiber = type.render), + (fiber = fiber.displayName || fiber.name || ""), + type.displayName || + ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef") + ); + case 7: + return "Fragment"; + case 26: + case 27: + case 5: + return type; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return getComponentNameFromType(type); + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 14: + case 15: + if ("function" === typeof type) + return type.displayName || type.name || null; + if ("string" === typeof type) return type; + break; + case 23: + return "LegacyHidden"; + } + return null; +} function getOwner() { - var dispatcher = ReactSharedInternals.A; - return null === dispatcher ? null : dispatcher.getOwner(); + if (!disableStringRefs) { + var dispatcher = ReactSharedInternals.A; + return null === dispatcher ? null : dispatcher.getOwner(); + } + return null; } -var enableFastJSXWithStringRefs = enableFastJSX && !0, - enableFastJSXWithoutStringRefs = enableFastJSXWithStringRefs && !1; +var didWarnAboutStringRefs; +enableLogStringRefsProd && (didWarnAboutStringRefs = {}); function ReactElement(type, key, _ref, self, source, owner, props) { _ref = props.ref; - return { - $$typeof: REACT_ELEMENT_TYPE, - type: type, - key: key, - ref: void 0 !== _ref ? _ref : null, - props: props, - _owner: owner - }; + _ref = void 0 !== _ref ? _ref : null; + return disableStringRefs + ? { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props + } + : { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key, + ref: _ref, + props: props, + _owner: owner + }; } function jsxProd(type, config, maybeKey) { var key = null; void 0 !== maybeKey && (key = "" + maybeKey); void 0 !== config.key && (key = "" + config.key); - if ( - (!enableFastJSXWithoutStringRefs && - (!enableFastJSXWithStringRefs || "ref" in config)) || - "key" in config - ) { + if ((!disableStringRefs && "ref" in config) || "key" in config) { maybeKey = {}; for (var propName in config) "key" !== propName && - ("ref" === propName - ? (maybeKey.ref = coerceStringRef(config[propName], getOwner(), type)) - : (maybeKey[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (maybeKey[propName] = config[propName]) + : (maybeKey.ref = coerceStringRef( + config[propName], + getOwner(), + type + ))); } else maybeKey = config; if (!disableDefaultPropsExceptForClasses && type && type.defaultProps) { config = type.defaultProps; - for (var propName$0 in config) - void 0 === maybeKey[propName$0] && - (maybeKey[propName$0] = config[propName$0]); + for (var propName$1 in config) + void 0 === maybeKey[propName$1] && + (maybeKey[propName$1] = config[propName$1]); } return ReactElement(type, key, null, void 0, void 0, getOwner(), maybeKey); } @@ -145,7 +281,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -157,6 +293,7 @@ function isValidElement(object) { ); } function coerceStringRef(mixedRef, owner, type) { + if (disableStringRefs) return mixedRef; if ("string" !== typeof mixedRef) if ("number" === typeof mixedRef || "boolean" === typeof mixedRef) mixedRef = "" + mixedRef; @@ -168,25 +305,34 @@ function coerceStringRef(mixedRef, owner, type) { return callback; } function stringRefAsCallbackRef(stringRef, type, owner, value) { - if (!owner) - throw Error( - "Element ref was specified as a string (" + - stringRef + - ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." - ); - if (1 !== owner.tag) - throw Error( - "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" - ); - type = owner.stateNode; - if (!type) - throw Error( - "Missing owner for string ref " + - stringRef + - ". This error is likely caused by a bug in React. Please file an issue." - ); - type = type.refs; - null === value ? delete type[stringRef] : (type[stringRef] = value); + if (!disableStringRefs) { + if (!owner) + throw Error( + "Element ref was specified as a string (" + + stringRef + + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://react.dev/link/refs-must-have-owner for more information." + ); + if (1 !== owner.tag) + throw Error( + "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://react.dev/link/strict-mode-string-ref" + ); + enableLogStringRefsProd && + ("function" !== typeof type || + (type.prototype && type.prototype.isReactComponent)) && + ((type = getComponentNameFromFiber(owner) || "Component"), + didWarnAboutStringRefs[type] || + (enableLogStringRefsProd && enableLogStringRefsProd(type, stringRef), + (didWarnAboutStringRefs[type] = !0))); + owner = owner.stateNode; + if (!owner) + throw Error( + "Missing owner for string ref " + + stringRef + + ". This error is likely caused by a bug in React. Please file an issue." + ); + owner = owner.refs; + null === value ? delete owner[stringRef] : (owner[stringRef] = value); + } } function escape(key) { var escaperLookup = { "=": "=0", ":": "=2" }; @@ -406,6 +552,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -447,6 +594,7 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals; +exports.__COMPILER_RUNTIME = ReactCompilerRuntime; exports.act = function () { throw Error("act(...) is not supported in production builds of React."); }; @@ -463,9 +611,9 @@ exports.cloneElement = function (element, config, children) { ); var props = assign({}, element.props), key = element.key, - owner = element._owner; + owner = disableStringRefs ? void 0 : element._owner; if (null != config) { - void 0 !== config.ref && (owner = getOwner()); + void 0 !== config.ref && (owner = disableStringRefs ? void 0 : getOwner()); void 0 !== config.key && (key = "" + config.key); if ( !disableDefaultPropsExceptForClasses && @@ -482,13 +630,13 @@ exports.cloneElement = function (element, config, children) { (disableDefaultPropsExceptForClasses || void 0 !== config[propName] || void 0 === defaultProps - ? "ref" === propName - ? (props.ref = coerceStringRef( + ? disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef( config[propName], owner, element.type )) - : (props[propName] = config[propName]) : (props[propName] = defaultProps[propName])); } var propName = arguments.length - 2; @@ -532,9 +680,9 @@ exports.createElement = function (type, config, children) { "key" !== propName && "__self" !== propName && "__source" !== propName && - ("ref" === propName - ? (props.ref = coerceStringRef(config[propName], getOwner(), type)) - : (props[propName] = config[propName])); + (disableStringRefs || "ref" !== propName + ? (props[propName] = config[propName]) + : (props.ref = coerceStringRef(config[propName], getOwner(), type))); var childrenLength = arguments.length - 2; if (1 === childrenLength) props.children = children; else if (1 < childrenLength) { @@ -577,18 +725,18 @@ exports.memo = function (type, compare) { }; exports.startTransition = function (scope, options) { var prevTransition = ReactSharedInternals.T, - transition = {}; - ReactSharedInternals.T = transition; + currentTransition = {}; + ReactSharedInternals.T = currentTransition; enableTransitionTracing && void 0 !== options && void 0 !== options.name && - ((ReactSharedInternals.T.name = options.name), - (ReactSharedInternals.T.startTime = -1)); + ((currentTransition.name = options.name), + (currentTransition.startTime = -1)); try { var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && - onStartTransitionFinish(transition, returnValue); + onStartTransitionFinish(currentTransition, returnValue); "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && @@ -612,6 +760,9 @@ exports.unstable_getCacheForType = function (resourceType) { exports.unstable_useCacheRefresh = function () { return ReactSharedInternals.H.useCacheRefresh(); }; +exports.unstable_useContextWithBailout = function (context, select) { + return ReactSharedInternals.H.unstable_useContextWithBailout(context, select); +}; exports.unstable_useMemoCache = useMemoCache; exports.use = function (usable) { return ReactSharedInternals.H.use(usable); @@ -673,7 +824,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-e02baf6c92-20240627"; +exports.version = "19.0.0-www-modern-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 5ed5b6a6cdc18..290e9b32abb92 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -72,20 +72,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork()); @@ -161,7 +147,7 @@ __DEV__ && _key++ ) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args, Error("react-stack-top-frame")); + printWarning("warn", format, args); } } function error$jscomp$0(format) { @@ -174,16 +160,16 @@ __DEV__ && _key2++ ) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args, Error("react-stack-top-frame")); + printWarning("error", format, args); } } - function printWarning(level, format, args, currentStack) { + function printWarning(level, format, args) { level = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; null != level && level.getCurrentStack && - ((currentStack = level.getCurrentStack(currentStack)), - "" !== currentStack && ((format += "%s"), args.push(currentStack))); + ((level = level.getCurrentStack()), + "" !== level && ((format += "%s"), args.push(level))); args.unshift(format); args.unshift(!1); warningWWW.apply(null, args); @@ -388,8 +374,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -543,28 +535,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -603,7 +573,7 @@ __DEV__ && var JSCompiler_temp_const = info, env = entry.env; var JSCompiler_inline_result = describeBuiltInComponentFrame( - entry.name + (env ? " (" + env + ")" : "") + entry.name + (env ? " [" + env + "]" : "") ); info = JSCompiler_temp_const + JSCompiler_inline_result; } @@ -652,96 +622,6 @@ __DEV__ && } return 3 === node.tag ? nearestMounted : null; } - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); - } - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); - } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; - } - function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; - } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -767,8 +647,8 @@ __DEV__ && ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } function injectInternals(internals) { @@ -783,13 +663,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -849,21 +723,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -884,20 +743,6 @@ __DEV__ && typeof injectedProfilingHooks.markComponentRenderStopped && injectedProfilingHooks.markComponentRenderStopped(); } - function markComponentLayoutEffectUnmountStarted(fiber) { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && - injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); - } - function markComponentLayoutEffectUnmountStopped() { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); - } function markRenderStarted(lanes) { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -922,41 +767,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -972,21 +816,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -1001,41 +845,55 @@ __DEV__ && var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; 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)) + : enableSiblingPrerendering && + !root && + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : enableSiblingPrerendering && + !root && + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1059,11 +917,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1074,60 +932,50 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1137,11 +985,17 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + !enableSiblingPrerendering || + 0 === suspendedRetryLanes || + 0 !== updatedLanes || + (disableLegacyMode && 0 === root.tag) || + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1150,8 +1004,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1283,14 +1137,14 @@ __DEV__ && null != props.scaleX ? props.scaleX : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; var scaleY = null != props.scaleY ? props.scaleY : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; pooledTransform .transformTo(1, 0, 0, 1, 0, 0) .move(props.x || 0, props.y || 0) @@ -1380,12 +1234,12 @@ __DEV__ && JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1396,11 +1250,36 @@ __DEV__ && instance.draw(string, props.font, props.alignment, props.path), (instance._currentString = string); } + function resetTextContent() {} function shouldSetTextContent(type, props) { return ( "string" === typeof props.children || "number" === typeof props.children ); } + function removeChild(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function removeChildFromContainer(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function commitTextUpdate() {} + function commitMount() {} + function commitUpdate(instance, type, oldProps, newProps) { + instance._applyProps(instance, newProps, oldProps); + } + function hideInstance(instance) { + instance.hide(); + } + function hideTextInstance() {} + function unhideInstance(instance, props) { + (null == props.visible || props.visible) && instance.show(); + } + function unhideTextInstance() {} + function getInstanceFromNode() { + return null; + } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1560,7 +1439,7 @@ __DEV__ && var id = getWakeableID(wakeable), display = wakeable.displayName || wakeable; log( - "%c\u269b\ufe0f%c " + componentName + " suspended", + "%c\u269b%c " + componentName + " suspended", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1569,7 +1448,7 @@ __DEV__ && wakeable.then( function () { log( - "%c\u269b\ufe0f%c " + componentName + " resolved", + "%c\u269b%c " + componentName + " resolved", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1578,7 +1457,7 @@ __DEV__ && }, function () { log( - "%c\u269b\ufe0f%c " + componentName + " rejected", + "%c\u269b%c " + componentName + " rejected", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1591,7 +1470,7 @@ __DEV__ && function logRenderStarted(lanes) { enableDebugTracing && group( - "%c\u269b\ufe0f%c render%c (" + formatLanes(lanes) + ")", + "%c\u269b%c render%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -1600,7 +1479,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -1708,10 +1587,10 @@ __DEV__ && : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } function describeTextDiff(clientText, serverProps, indent) { var maxLength = 120 - 2 * indent; @@ -1805,10 +1684,10 @@ __DEV__ && return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } function describeExpandedElement(type, props, rowPrefix) { var remainingRowLength = 120 - rowPrefix.length - type.length, @@ -1826,17 +1705,17 @@ __DEV__ && return 0 === properties.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } function describePropertiesDiff(clientObject, serverObject, indent) { var properties = "", @@ -1985,7 +1864,10 @@ __DEV__ && "number" === typeof clientProps || "bigint" === typeof clientProps ) - content += describeTextDiff("" + clientProps, void 0, indent + 1); + content = + null == type + ? content + describeTextDiff("" + clientProps, null, indent + 1) + : content + describeTextDiff("" + clientProps, void 0, indent + 1); return content; } function describeSiblingFiber(fiber, indent) { @@ -2021,7 +1903,7 @@ __DEV__ && debugInfo = ""; i = node.fiber.pendingProps; if (6 === node.fiber.tag) - debugInfo = describeTextDiff(i, node.serverProps, indent); + (debugInfo = describeTextDiff(i, node.serverProps, indent)), indent++; else if ( ((serverComponentName = describeFiberType(node.fiber)), null !== serverComponentName) @@ -2049,22 +1931,23 @@ __DEV__ && indent++; } else null === node.serverProps - ? (debugInfo = describeExpandedElement( + ? ((debugInfo = describeExpandedElement( serverComponentName, i, added(indent) - )) - : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent )), - indent++); + indent++) + : "string" === typeof node.serverProps + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); var propName = ""; i = node.fiber.child; for ( @@ -2081,9 +1964,10 @@ __DEV__ && i && 0 < node.children.length && (propName += indentation(indent) + "...\n"); - node = node.serverTail; - for (i = 0; i < node.length; i++) - (serverComponentName = node[i]), + i = node.serverTail; + null === node.serverProps && indent--; + for (node = 0; node < i.length; node++) + (serverComponentName = i[node]), (propName = "string" === typeof serverComponentName ? propName + @@ -2166,7 +2050,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -2181,6 +2065,54 @@ __DEV__ && (parent = node.return); return 3 === node.tag ? node.stateNode : null; } + function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; + } + function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; + } + function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; + } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; + } + } + function recordEffectDuration() { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + profilerStartTime = -1; + profilerEffectDuration += elapsedTime; + } + } + function startEffectTimer() { + profilerStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function ensureRootIsScheduled(root) { root !== lastScheduledRoot && null === root.next && @@ -2202,30 +2134,41 @@ __DEV__ && 0 === root.tag && (ReactSharedInternals.didScheduleLegacyUpdate = !0); } - function flushSyncWorkAcrossRoots_impl(onlyLegacy) { + function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { - var workInProgressRootRenderLanes$jscomp$0 = - workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot - ? workInProgressRootRenderLanes$jscomp$0 - : 0 - ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot( - root, - workInProgressRootRenderLanes$jscomp$0 - )); - } + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var nextLanes = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + nextLanes = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); + nextLanes = + nextLanes & 201326677 + ? (nextLanes & 201326677) | 1 + : nextLanes + ? nextLanes | 2 + : 0; + } + 0 !== nextLanes && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); + } else + (nextLanes = workInProgressRootRenderLanes), + (nextLanes = getNextLanes( + root, + root === workInProgressRoot ? nextLanes : 0 + )), + 0 !== (nextLanes & 3) && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -2237,6 +2180,7 @@ __DEV__ && didScheduleMicrotask_act = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now$1(), prev = null, root = firstScheduledRoot; null !== root; @@ -2249,12 +2193,10 @@ __DEV__ && null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev)) : ((prev = root), - 0 !== (nextLanes & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -2264,7 +2206,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -2295,12 +2237,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -2326,7 +2268,7 @@ __DEV__ && default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode$1)) @@ -2335,6 +2277,34 @@ __DEV__ && root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + !disableSchedulerTimeoutInWorkLoop && didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode$1 && null !== callbackNode && @@ -2372,8 +2342,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2470,10 +2440,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -2569,7 +2536,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -2696,6 +2663,16 @@ __DEV__ && ); 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) @@ -2976,6 +2953,7 @@ __DEV__ && lanes )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -3049,6 +3027,7 @@ __DEV__ && key )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -3070,6 +3049,7 @@ __DEV__ && lanes )), (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -3116,6 +3096,7 @@ __DEV__ && null )), (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -3135,7 +3116,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3216,7 +3197,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3313,7 +3294,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3648,6 +3629,7 @@ __DEV__ && newChild.key )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), (currentFirstChild._debugInfo = currentDebugInfo), validateFragmentProps( newChild, @@ -3789,7 +3771,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3819,6 +3801,8 @@ __DEV__ && lanes )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), + (currentFirstChild._debugInfo = currentDebugInfo), (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); @@ -3902,12 +3886,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -4089,8 +4073,8 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = 0 !== (workInProgress.mode & 8); var children = callComponentInDEV(Component, props, secondArg); @@ -4120,6 +4104,14 @@ __DEV__ && } 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; @@ -4144,9 +4136,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -4178,10 +4169,16 @@ __DEV__ && numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -4279,6 +4276,38 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + null === lastContextDependency) + ) { + if (null === JSCompiler_temp) + throw Error( + "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; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -4329,7 +4358,7 @@ __DEV__ && (currentlyRenderingFiber$1.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) + if (void 0 === updateQueue || ignorePreviousDependencies) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; @@ -4410,7 +4439,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -4527,12 +4556,11 @@ __DEV__ && ), (didWarnUncachedGetSnapshot = !0)); } - cachedSnapshot = workInProgressRoot; - if (null === cachedSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) || + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -4597,12 +4625,11 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -4636,13 +4663,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -4765,8 +4792,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -4782,8 +4809,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4930,17 +4957,16 @@ __DEV__ && function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -5140,15 +5166,13 @@ __DEV__ && ); } function mountDeferredValueImpl(hook, value, initialValue) { - return enableUseDeferredValueInitialArg && - void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) - ? ((hook.memoizedState = initialValue), - (hook = requestDeferredLane()), - (currentlyRenderingFiber$1.lanes |= hook), - (workInProgressRootSkippedLanes |= hook), - initialValue) - : (hook.memoizedState = value); + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber$1.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (objectIs(value, prevValue)) return value; @@ -5158,7 +5182,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -5202,14 +5226,26 @@ __DEV__ && returnValue, finishedState ); - dispatchSetState(fiber, queue, thenableForFinishedState); - } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$5 - }); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error$9) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -5256,8 +5292,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -5346,8 +5381,17 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); + dispatchSetStateInternal( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 + ); + markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { - lane: JSCompiler_OptimizeArgumentsArray_p1, + lane: lane, revertLane: 0, action: action, hasEagerState: !1, @@ -5369,35 +5413,27 @@ __DEV__ && eagerState = alternate(currentState, action); update.hasEagerState = !0; update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) { - enqueueUpdate$1(fiber, queue, update, 0); - null === workInProgressRoot && finishQueueingConcurrentUpdates(); - return; - } - } catch (error$6) { + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } } - currentState = enqueueConcurrentHookUpdate( - fiber, - queue, - update, - JSCompiler_OptimizeArgumentsArray_p1 - ); - null !== currentState && - (scheduleUpdateOnFiber( - currentState, - fiber, - JSCompiler_OptimizeArgumentsArray_p1 - ), - entangleTransitionUpdate( - currentState, - queue, - JSCompiler_OptimizeArgumentsArray_p1 - )); + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + return !1; } function dispatchOptimisticSetState( fiber, @@ -5411,7 +5447,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -5427,11 +5463,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -5450,7 +5486,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5465,61 +5501,6 @@ __DEV__ && } enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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 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 warnOnInvalidCallback(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); @@ -5617,12 +5598,12 @@ __DEV__ && void 0 === context ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", @@ -5772,11 +5753,6 @@ __DEV__ && "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name ); - instance.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - name - ); instance.contextType && error$jscomp$0( "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", @@ -5795,6 +5771,20 @@ __DEV__ && "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name )); + ctor.childContextTypes && + !didWarnAboutChildContextTypes.has(ctor) && + (didWarnAboutChildContextTypes.add(ctor), + error$jscomp$0( + "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + name + )); + ctor.contextTypes && + !didWarnAboutContextTypes$1.has(ctor) && + (didWarnAboutContextTypes$1.add(ctor), + error$jscomp$0( + "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + name + )); "function" === typeof instance.componentShouldUpdate && error$jscomp$0( "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", @@ -6045,12 +6035,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -6071,16 +6058,14 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || 0 !== (sourceFiber.mode & 1) || @@ -6113,20 +6098,20 @@ __DEV__ && ? ((currentSourceFiber.flags |= 65536), (currentSourceFiber.lanes = rootRenderLanes)) : currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(SyncLane)), - (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, SyncLane)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= SyncLane)); + ? (currentSourceFiber.flags |= 65536) + : ((currentSourceFiber.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = ForceUpdate), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)); value === noopSuspenseyCommitThenable ? (currentSourceFiber.flags |= 16384) : ((returnFiber = currentSourceFiber.updateQueue), @@ -6407,7 +6392,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -6565,7 +6550,7 @@ __DEV__ && ); } if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) - if (0 !== (renderLanes & OffscreenLane)) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -6579,8 +6564,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = - OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -6636,8 +6620,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -6654,6 +6637,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -6696,19 +6680,29 @@ __DEV__ && null ); null === current && - validateFunctionComponentInDev(workInProgress, workInProgress.type); - componentName = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current; - componentName = getMaskedContext(workInProgress, componentName); - prepareToReadContext(workInProgress, renderLanes); + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + error$jscomp$0( + "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + if (!disableLegacyContextForFunctionComponents) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor$1.current; + context = getMaskedContext(workInProgress, context); + } + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, workInProgress, Component, nextProps, - componentName, + context, renderLanes ); enableSchedulingProfiler && markComponentRenderStopped(); @@ -6729,11 +6723,12 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -6790,7 +6785,7 @@ __DEV__ && isContextProvider(Component) ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -6925,8 +6920,7 @@ __DEV__ && unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -6948,8 +6942,7 @@ __DEV__ && newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -7234,47 +7227,47 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - showFallback, - 0, - null - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + showFallback, + 0, + null + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isSuspenseInstanceFallback()) @@ -7308,8 +7301,7 @@ __DEV__ && renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, @@ -7322,18 +7314,17 @@ __DEV__ && JSCompiler_temp = workInProgressRoot; if (null !== JSCompiler_temp) { nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & SyncUpdateLanes)) - nextProps = SyncHydrationLane; + if (0 !== (nextProps & 42)) nextProps = 1; else switch (nextProps) { - case SyncLane: - nextProps = SyncHydrationLane; + case 2: + nextProps = 1; break; - case InputContinuousLane: - nextProps = InputContinuousHydrationLane; + case 8: + nextProps = 4; break; - case DefaultLane: - nextProps = DefaultHydrationLane; + case 32: + nextProps = 16; break; case 128: case 256: @@ -7354,10 +7345,10 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - nextProps = TransitionHydrationLane; + nextProps = 64; break; - case IdleLane: - nextProps = IdleHydrationLane; + case 268435456: + nextProps = 134217728; break; default: nextProps = 0; @@ -7410,8 +7401,8 @@ __DEV__ && (nextProps.childLanes = 0), (nextProps.pendingProps = primaryChildProps), workInProgress.mode & 2 && - ((nextProps.actualDuration = 0), - (nextProps.actualStartTime = -1), + ((nextProps.actualDuration = -0), + (nextProps.actualStartTime = -1.1), (nextProps.selfBaseDuration = didSuspend.selfBaseDuration), (nextProps.treeBaseDuration = didSuspend.treeBaseDuration)), (workInProgress.deletions = null)); @@ -7469,16 +7460,17 @@ __DEV__ && retryQueue: null }) : currentFallbackChildFragment === primaryChildProps - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== primaryChildProps - ? primaryChildProps.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)))); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = + didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -7540,10 +7532,10 @@ __DEV__ && : ((progressedPrimaryFragment.childLanes = 0), (progressedPrimaryFragment.pendingProps = primaryChildren), workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = 0), - (progressedPrimaryFragment.actualStartTime = -1), - (progressedPrimaryFragment.selfBaseDuration = 0), - (progressedPrimaryFragment.treeBaseDuration = 0))); + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, @@ -7806,7 +7798,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -7834,12 +7826,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -7884,9 +7873,10 @@ __DEV__ && case 12: 0 !== (renderLanes & workInProgress.childLanes) && (workInProgress.flags |= 4); + workInProgress.flags |= 2048; var stateNode = workInProgress.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; break; case 13: stateNode = workInProgress.memoizedState; @@ -7916,8 +7906,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -8122,9 +8111,10 @@ __DEV__ && current.$$typeof === REACT_LAZY_TYPE && (workInProgress = " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; throw Error( "Element type is invalid. Received a promise that resolves to: " + - current + + renderLanes + ". Lazy element type must resolve to a class or function." + workInProgress ); @@ -8182,7 +8172,12 @@ __DEV__ && var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== prevSibling.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); prevSibling = nextProps.element; prevSibling === returnFiber @@ -8222,16 +8217,7 @@ __DEV__ && null, renderLanes )), - (HostTransitionContext._currentValue2 = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = prevSibling)), markRef(current, workInProgress), reconcileChildren( current, @@ -8310,9 +8296,10 @@ __DEV__ && case 12: return ( (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = 0), - (returnFiber.passiveEffectDuration = 0), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), reconcileChildren( current, workInProgress, @@ -8322,48 +8309,27 @@ __DEV__ && workInProgress.child ); case 10: - a: { - returnFiber = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = prevSibling.value; + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, returnFiber, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if ( - nextProps.children === prevSibling.children && - !didPerformWorkStackCursor.current - ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, prevSibling.children, renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + ), + workInProgress.child + ); case 9: return ( enableRenderableContext @@ -8376,7 +8342,7 @@ __DEV__ && error$jscomp$0( "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." ), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (prevSibling = readContext(prevSibling)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), @@ -8440,7 +8406,7 @@ __DEV__ && isContextProvider(returnFiber) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); constructClassInstance(workInProgress, returnFiber, prevSibling); mountClassInstance( workInProgress, @@ -8501,7 +8467,7 @@ __DEV__ && ); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (returnFiber = readContext(CacheContext)), null === current ? ((prevSibling = peekCacheFromPool()), @@ -8539,10 +8505,11 @@ __DEV__ && : ((returnFiber = nextProps.cache), pushProvider(workInProgress, CacheContext, returnFiber), returnFiber !== prevSibling.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -8645,147 +8612,80 @@ __DEV__ && "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + var select = dependency.select; + if ( + null != select && + null != dependency.lastSelectedValue && + !checkIfSelectedContextValuesChanged( + dependency.lastSelectedValue, + select(dependency.context._currentValue2) + ) + ) + continue b; + list.lanes |= renderLanes; + dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); scheduleContextWorkOnParentPath( - fiber.return, + list.return, renderLanes, workInProgress ); - list.lanes |= renderLanes; - break; + forcePropagateEntireTree || (nextFiber = null); + break a; } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } - fiber = nextFiber; - } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -8794,85 +8694,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + } + function checkIfSelectedContextValuesChanged( + oldComparedValue, + newComparedValue + ) { + if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { + if (oldComparedValue.length !== newComparedValue.length) return !0; + for (var i = 0; i < oldComparedValue.length; i++) + if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; + } else throw Error("Compared context values must be arrays"); + return !1; } function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -8881,9 +8786,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -8898,8 +8802,12 @@ __DEV__ && "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 }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -8946,16 +8854,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -9062,7 +8970,11 @@ __DEV__ && : null; } function containsNode() { - throw Error("Not implemented."); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = getInstanceFromScope(); @@ -9078,12 +8990,13 @@ __DEV__ && return childContextValues; } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + enableSiblingPrerendering && + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { switch (renderState.tailMode) { @@ -9505,7 +9418,7 @@ __DEV__ && 2 * now$1() - fallthroughToNormalSuspensePath.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(fallthroughToNormalSuspensePath, !1), @@ -9563,7 +9476,7 @@ __DEV__ && : newProps && (workInProgress.flags |= 8192)), !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) ? bubbleProperties(workInProgress) - : 0 !== (renderLanes & OffscreenLane) && + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -9760,87 +9673,388 @@ __DEV__ && } } function shouldProfile(current) { - return ( - 0 !== (current.mode & 2) && - (executionContext & CommitContext) !== NoContext - ); + return 0 !== (current.mode & 2); } - function safelyCallComponentWillUnmount( - current, + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookLayoutUnmountEffects( + finishedWork, nearestMountedAncestor, - instance + hookFlags ) { - try { - if ( - ((instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - )), - (instance.state = current.memoizedState), - shouldProfile(current)) - ) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); - } catch (error$7) { - captureCommitPhaseError(current, nearestMountedAncestor, error$7); - } + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); } - function safelyAttachRef(current, nearestMountedAncestor) { + function commitHookEffectListMount(flags, finishedWork) { 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); + 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 && + (enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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) { + error$jscomp$0( + "%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$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + } catch (error$11) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$11); } } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor + ) { + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && + injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( + finishedWork + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error$12) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$12); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassDidMount(finishedWork) { + var instance = finishedWork.stateNode; + "function" === typeof instance.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); + } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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$13) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } + } + } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordEffectDuration()) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ); + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile(finishedWork)) + try { + startEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordEffectDuration(); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + disableStringRefs && "string" === typeof ref + ? error$jscomp$0("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error$17) { + captureCommitPhaseError(current, nearestMountedAncestor, error$17); + } + } + 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(); + startEffectTimer(), runWithFiberInDEV(current, refCleanup); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else refCleanup(); - } catch (error$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); + else runWithFiberInDEV(current, refCleanup); + } catch (error$18) { + captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9850,21 +10064,193 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else ref(null); - } catch (error$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + else runWithFiberInDEV(current, ref, null); + } catch (error$19) { + captureCommitPhaseError(current, nearestMountedAncestor, error$19); } else ref.current = null; } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitStartTime + ); + } + function commitProfilerPostCommitImpl( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { + var _finishedWork$memoize2 = finishedWork.memoizedProps; + finishedWork = _finishedWork$memoize2.id; + _finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize2 && + _finishedWork$memoize2( + finishedWork, + current, + passiveEffectDuration, + commitStartTime + ); + } + function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$22) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$22); + } + } + function isHostParent(fiber) { + return 5 === fiber.tag || 3 === 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 && 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) + if (((node = node.stateNode), before)) { + if (node === before) + throw Error("ReactART: Can not insert node before itself"); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) + if (((node = node.stateNode), before)) { + if (node === before) + throw Error("ReactART: Can not insert node before itself"); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); } } function commitBeforeMutationEffects(root, firstChild) { @@ -9881,11 +10267,67 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - try { - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$12) { - captureCommitPhaseError(root, root.return, error$12); + firstChild = root = nextEffect; + i = firstChild.alternate; + var flags = firstChild.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (firstChild.tag) { + case 0: + if ( + 0 !== (flags & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (flags = firstChild[i]), (flags.ref.impl = flags.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 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." + ); } firstChild = root.sibling; if (null !== firstChild) { @@ -9901,399 +10343,55 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - 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: - 0 !== (flags & 1024) && - null !== current && - ((flags = current.memoizedProps), - (JSCompiler_temp = current.memoizedState), - (current = finishedWork.stateNode), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (JSCompiler_temp = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== flags || - JSCompiler_temp.has(finishedWork.type) || - (JSCompiler_temp.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = flags)); - break; - case 3: - 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), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork)), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - 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) { - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - )); - var create = effect.create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\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: " + create - )); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitPassiveEffectDurations(finishedRoot, finishedWork) { - if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) - switch (finishedWork.tag) { - case 12: - finishedRoot = finishedWork.stateNode.passiveEffectDuration; - var _finishedWork$memoize = finishedWork.memoizedProps, - id = _finishedWork$memoize.id; - _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$jscomp$0 = commitTime, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize( - id, - phase, - finishedRoot, - commitTime$jscomp$0 - ); - finishedWork = finishedWork.return; - a: for (; null !== finishedWork; ) { - switch (finishedWork.tag) { - case 3: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - case 12: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - } - finishedWork = finishedWork.return; - } - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); - } - } - 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 && - error$jscomp$0( - "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 && - error$jscomp$0( - "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$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } - } - } - 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) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); - } - } - 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)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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) + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps, finishedWork.elementType === finishedWork.type ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -10307,110 +10405,113 @@ __DEV__ && "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" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startEffectTimer(), + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( - committedLanes, - prevState, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordEffectDuration()) + : runWithFiberInDEV( finishedWork, - finishedWork.return, - error$18 + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + current = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) ) { - finishedRoot = null; + prevProps = null; if (null !== finishedWork.child) switch (finishedWork.child.tag) { case 27: case 5: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; break; case 1: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); - } catch (error$22) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$15 ); } } + finishedRoot.effectDuration += popNestedEffectDurations(current); break; case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + 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); + if (flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + finishedRoot = finishedWork.stateNode; + finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 22: if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { if ( - ((prevState = + ((prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !prevState) + !prevProps) ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -10418,31 +10519,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -10648,64 +10736,6 @@ __DEV__ && fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return 5 === fiber.tag || 3 === 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 && 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) - if (((node = node.stateNode), before)) { - if (node === before) - throw Error("ReactART: Can not insert node before itself"); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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) - if (((node = node.stateNode), before)) { - if (node === before) - throw Error("ReactART: Can not insert node before itself"); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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, @@ -10755,16 +10785,51 @@ __DEV__ && ); hostParent = _prevHostParent; hostParentIsContainer = _prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error$29) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$29 + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error$30) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$30 + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (_prevHostParent = finishedRoot.onDeleted) && + _prevHostParent(deletedFiber.stateNode); + } catch (error$31) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$31 + ); + } null !== hostParent && (hostParentIsContainer ? clearSuspenseBoundaryFromContainer() @@ -10787,49 +10852,19 @@ __DEV__ && case 11: case 14: case 15: - if ( - !offscreenSubtreeWasHidden && - ((_prevHostParent = deletedFiber.updateQueue), - null !== _prevHostParent && - ((_prevHostParent = _prevHostParent.lastEffect), - null !== _prevHostParent)) - ) { - _prevHostParentIsContainer = _prevHostParent = _prevHostParent.next; - do { - var tag = _prevHostParentIsContainer.tag, - inst = _prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((tag & Insertion) !== NoFlags - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )), - enableSchedulingProfiler && - markComponentLayoutEffectUnmountStopped())); - _prevHostParentIsContainer = _prevHostParentIsContainer.next; - } while (_prevHostParentIsContainer !== _prevHostParent); - } + (!enableHiddenSubtreeInsertionEffectCleanup && + offscreenSubtreeWasHidden) || + commitHookEffectListUnmount( + Insertion, + deletedFiber, + nearestMountedAncestor + ); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects( + deletedFiber, + nearestMountedAncestor, + Layout + ); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10917,10 +10952,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -10930,10 +10965,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -10956,74 +10991,53 @@ __DEV__ && 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$25) { - captureCommitPhaseError(childToDelete, parentFiber, error$25); + 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) { @@ -11031,57 +11045,23 @@ __DEV__ && 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$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$27) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$27 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout | HasEffect + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -11099,25 +11079,42 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) { - var _instance2 = finishedWork.stateNode; - if (null != _instance2) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; - try { - _instance2._applyProps(_instance2, newProps, current); - } catch (error$30) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$30 - ); - } + if (finishedWork.flags & 32) { + var instance = finishedWork.stateNode; + try { + runWithFiberInDEV(finishedWork, resetTextContent, instance); + } catch (error$25) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$25 + ); + } + } + if (flags & 4 && null != finishedWork.stateNode) { + instance = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : instance; + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + current, + instance, + finishedWork + ); + } catch (error$23) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$23 + ); } } flags & 1024 && @@ -11127,31 +11124,59 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4 && 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." - ); + 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.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + instance, + current, + flags + ); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + root.effectDuration += popNestedEffectDurations(flags); + break; + case 4: + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; - case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + case 12: + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); + finishedWork.stateNode.effectDuration += + bubbleNestedEffectDurations(flags); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((_instance2 = null !== finishedWork.memoizedState), + ((instance = null !== finishedWork.memoizedState), (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? _instance2 !== current && - (globalMostRecentFallbackTime = now$1()) - : _instance2 && + ? instance !== current && (globalMostRecentFallbackTime = now$1()) + : instance && !current && (globalMostRecentFallbackTime = now$1())); if (flags & 4) { @@ -11192,10 +11217,10 @@ __DEV__ && prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; - } else recursivelyTraverseMutationEffects(root, finishedWork, lanes); + } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -11219,24 +11244,51 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - current = root; + retryQueue = current = root; try { - (_instance2 = root.stateNode), + (instance = retryQueue.stateNode), suspenseCallback - ? _instance2.hide() - : ((newProps = root.memoizedProps), - (null == newProps.visible || newProps.visible) && - root.stateNode.show()); - } catch (error$23) { + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$23 + retryQueue, + retryQueue.return, + error$26 + ); + } + } + } else if (6 === root.tag) { + if (null === current) { + retryQueue = root; + try { + var instance$jscomp$0 = retryQueue.stateNode; + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + instance$jscomp$0 + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + instance$jscomp$0, + retryQueue.memoizedProps + ); + } catch (error$27) { + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$27 ); } } } else if ( - 6 !== root.tag && ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || root === finishedWork) && @@ -11266,7 +11318,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -11275,7 +11327,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -11284,7 +11336,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -11292,43 +11344,9 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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." - ); - } - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -11337,27 +11355,13 @@ __DEV__ && 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) { @@ -11366,23 +11370,11 @@ __DEV__ && case 11: case 14: case 15: - if (shouldProfile(finishedWork)) - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); - } finally { - recordLayoutEffectDuration(finishedWork); - } - else - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 1: @@ -11440,28 +11432,25 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + commitClassDidMount(finishedWork); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); - } catch (error$34) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$14 ); } - 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); @@ -11475,17 +11464,45 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects = finishedWork.stateNode; + includeWorkInProgressEffects.effectDuration += + bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + includeWorkInProgressEffects.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -11519,9 +11536,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -11529,22 +11544,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$35) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$35); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -11619,21 +11618,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -11642,9 +11626,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11673,6 +11655,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11740,6 +11723,33 @@ __DEV__ && clearTransitionsForLanes(finishedRoot, committedLanes); } } + finishedRoot.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + flags & 2048 + ? ((prevEffectDuration = pushNestedEffectDurations()), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration)), + commitProfilerPostCommit( + finishedWork, + finishedWork.alternate, + commitStartTime, + finishedRoot.passiveEffectDuration + )) + : recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); break; case 23: recursivelyTraversePassiveMountEffects( @@ -11756,9 +11766,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11766,39 +11776,37 @@ __DEV__ && committedTransitions ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((prevEffectDuration._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : prevEffectDuration._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( + : ((prevEffectDuration._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, - committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -11842,9 +11850,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11891,9 +11897,9 @@ __DEV__ && ); break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & 4 + ? _instance2._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11902,21 +11908,19 @@ __DEV__ && includeWorkInProgressEffects ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance4._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((_instance4._visibility |= 4), + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((_instance2._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11929,7 +11933,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -11969,70 +11973,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -12079,29 +12059,10 @@ __DEV__ && previousFiber.child = null; do (previousFiber = parentFiber.sibling), - (parentFiber.sibling = null), - (parentFiber = previousFiber); - while (null !== parentFiber); - } - } - function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags - ) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); + (parentFiber.sibling = null), + (parentFiber = previousFiber); + while (null !== parentFiber); + } } function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; @@ -12119,11 +12080,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -12139,12 +12096,24 @@ __DEV__ && Passive | HasEffect ); break; + case 3: + var prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration); + break; case 22: - var instance = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState && - instance._visibility & 4 && + prevEffectDuration._visibility & 4 && (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((instance._visibility &= -5), + ? ((prevEffectDuration._visibility &= -5), recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork); break; @@ -12167,7 +12136,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -12194,116 +12163,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { 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, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } + } + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), + abortParentMarkerTransitionsForDeletedFiber( + current, + instance, + offscreenFiber, + null, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + 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; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; break a; } - nextEffect = returnFiber; - } - } - } - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) - abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } + nextEffect = offscreenFiber; } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - instance, - offscreenFiber, - null, - !1 - ))); } } function invokeLayoutEffectMountInDEV(fiber) { @@ -12311,20 +12271,10 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$37) { - captureCommitPhaseError(fiber, fiber.return, error$37); - } + commitHookEffectListMount(Layout | HasEffect, fiber); break; case 1: - var instance = fiber.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error$38) { - captureCommitPhaseError(fiber, fiber.return, error$38); - } + commitClassDidMount(fiber); } } function invokePassiveEffectMountInDEV(fiber) { @@ -12332,11 +12282,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$39) { - captureCommitPhaseError(fiber, fiber.return, error$39); - } + commitHookEffectListMount(Passive | HasEffect, fiber); } } function invokeLayoutEffectUnmountInDEV(fiber) { @@ -12344,15 +12290,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Layout | HasEffect, - fiber, - fiber.return - ); - } catch (error$40) { - captureCommitPhaseError(fiber, fiber.return, error$40); - } + commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); break; case 1: var instance = fiber.stateNode; @@ -12365,15 +12303,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Passive | HasEffect, - fiber, - fiber.return - ); - } catch (error$41) { - captureCommitPhaseError(fiber, fiber.return, error$41); - } + commitHookEffectListUnmount(Passive | HasEffect, fiber, fiber.return); } } function isConcurrentActEnvironment() { @@ -12454,7 +12384,7 @@ __DEV__ && } function requestUpdateLane(fiber) { var mode = fiber.mode; - if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; + if (!disableLegacyMode && 0 === (mode & 1)) return 2; if ( (executionContext & RenderContext) !== NoContext && 0 !== workInProgressRootRenderLanes @@ -12471,8 +12401,8 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? OffscreenLane + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 : claimNextTransitionLane()); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); @@ -12491,7 +12421,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -12549,90 +12480,112 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )); ensureRootIsScheduled(root); - lane !== SyncLane || + 2 !== lane || executionContext !== NoContext || disableLegacyMode || 0 !== (fiber.mode & 1) || ReactSharedInternals.isBatchingLegacy || ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var shouldTimeSlice = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice + var exitStatus = (forceSync = + !forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { - var renderWasConcurrent = shouldTimeSlice; + if (exitStatus !== RootInProgress) { + var renderWasConcurrent = forceSync; do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { - shouldTimeSlice = root.current.alternate; + forceSync = root.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) + !isRenderConsistentWithExternalStores(forceSync) ) { - didTimeout = renderRootSync(root, lanes); + exitStatus = renderRootSync(root, lanes); renderWasConcurrent = !1; continue; } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; + if ( + (disableLegacyMode || 0 !== root.tag) && + exitStatus === RootErrored + ) { + var lanesThatJustErrored = lanes; + root.errorRecoveryDisabledLanes & lanesThatJustErrored + ? (renderWasConcurrent = 0) + : ((renderWasConcurrent = root.pendingLanes & -536870913), + (renderWasConcurrent = + 0 !== renderWasConcurrent + ? renderWasConcurrent + : renderWasConcurrent & 536870912 + ? 536870912 + : 0)); + if (0 !== renderWasConcurrent) { + lanes = renderWasConcurrent; + a: { + exitStatus = root; + var originallyAttemptedLanes = lanesThatJustErrored; + lanesThatJustErrored = workInProgressRootConcurrentErrors; + renderWasConcurrent = renderRootSync( + exitStatus, + renderWasConcurrent + ); + if (renderWasConcurrent !== RootErrored) { + if (workInProgressRootDidAttachPingListener) { + exitStatus.errorRecoveryDisabledLanes |= + originallyAttemptedLanes; + workInProgressRootInterleavedUpdatedLanes |= + originallyAttemptedLanes; + exitStatus = RootSuspendedWithDelay; + break a; + } + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = lanesThatJustErrored; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = renderWasConcurrent; + } + renderWasConcurrent = !1; + if (exitStatus !== RootErrored) continue; + } } - if (didTimeout === RootFatalErrored) { + if (exitStatus === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; - switch (didTimeout) { + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -12646,53 +12599,93 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) { + lanes = renderWasConcurrent; + forceSync = workInProgressRootRecoverableErrors; + exitStatus = workInProgressTransitions; + renderWasConcurrent = + workInProgressRootDidIncludeRecursiveRenderUpdate; + lanesThatJustErrored = workInProgressDeferredLane; + originallyAttemptedLanes = + workInProgressRootInterleavedUpdatedLanes; + var suspendedRetryLanes = workInProgressSuspendedRetryLanes, + suspendedCommitReason = IMMEDIATE_COMMIT, + prevTransition = ReactSharedInternals.T, + previousUpdateLanePriority = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + lanes, + forceSync, + exitStatus, + renderWasConcurrent, + previousUpdateLanePriority, + lanesThatJustErrored, + originallyAttemptedLanes, + suspendedRetryLanes, + suspendedCommitReason, + -0, + 0 + ); + } finally { + (ReactSharedInternals.T = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + } else { if ( - (lanes & RetryLanes) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < didTimeout) + 10 < exitStatus) ) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + -0, + 0 ), - didTimeout + exitStatus ); break a; } commitRootWhenReady( renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + -0, + 0 ); } } @@ -12701,33 +12694,6 @@ __DEV__ && } while (1); } ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -12744,41 +12710,62 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { lanes = finishedWork.subtreeFlags; (lanes & 8192 || 16785408 === (lanes & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); + finishedWork = ReactSharedInternals.T; + lanes = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ); + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = lanes); + } } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$42) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error$33) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -12793,8 +12780,10 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -12802,73 +12791,32 @@ __DEV__ && (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; - - ) { + enableSiblingPrerendering && + !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 && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork() { return (executionContext & (RenderContext | CommitContext)) === NoContext - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -12903,9 +12851,16 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -12913,9 +12868,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -12939,20 +12892,28 @@ __DEV__ && resetCurrentFiber(); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); - var handler = suspenseHandlerStackCursor.current; + var JSCompiler_temp; + if ((JSCompiler_temp = !enableSiblingPrerendering)) + (JSCompiler_temp = suspenseHandlerStackCursor.current), + (JSCompiler_temp = + null === JSCompiler_temp + ? !0 + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? JSCompiler_temp === shellBoundary + : !1); workInProgressSuspendedReason = - (null !== handler && - ((workInProgressRootRenderLanes & TransitionLanes) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & RetryLanes) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & OffscreenLane)) || - handler !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? SuspendedOnImmediate - : SuspendedOnData; + JSCompiler_temp && + 0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? SuspendedOnData + : SuspendedOnImmediate; } else thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), @@ -12961,21 +12922,21 @@ __DEV__ && thrownValue === SelectiveHydrationException ? SuspendedOnHydration : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; - handler = workInProgress; - if (null === handler) + JSCompiler_temp = workInProgress; + if (null === JSCompiler_temp) (workInProgressRootExitStatus = RootFatalErrored), logUncaughtError( root, createCapturedValueAtFiber(thrownValue, root.current) ); else if ( - (handler.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(handler, !0), + (JSCompiler_temp.mode & 2 && + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -12985,7 +12946,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentErrored && injectedProfilingHooks.markComponentErrored( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12999,7 +12960,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentSuspended && injectedProfilingHooks.markComponentSuspended( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -13017,13 +12978,17 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + 0 !== (workInProgressRootRenderLanes & 60) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -13067,15 +13032,21 @@ __DEV__ && null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$43) { - handleThrow(root, thrownValue$43); + } catch (thrownValue$34) { + handleThrow(root, thrownValue$34); } while (1); lanes && root.shellSuspendCounter++; @@ -13116,7 +13087,13 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering && + (workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes)); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -13133,7 +13110,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -13165,7 +13147,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -13197,12 +13184,22 @@ __DEV__ && } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -13217,8 +13214,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$44) { - handleThrow(root, thrownValue$44); + } catch (thrownValue$35) { + handleThrow(root, thrownValue$35); } while (1); resetContextDependencies(); @@ -13256,7 +13253,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -13264,7 +13261,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -13272,7 +13269,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -13335,10 +13332,15 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } - function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { + function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason + ) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); thenableState$1 = null; @@ -13362,73 +13364,63 @@ __DEV__ && workInProgress = null; return; } - } catch (error$45) { + } catch (error$36) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$45); + throw ((workInProgress = returnFiber), error$36); workInProgressRootExitStatus = RootFatalErrored; - logUncaughtError( - root, - createCapturedValueAtFiber(thrownValue, root.current) - ); - 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 = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + logUncaughtError( + root, + createCapturedValueAtFiber(thrownValue, root.current) + ); + workInProgress = null; + return; + } + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (suspendedReason === SuspendedOnError) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else { + if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + suspendedReason === SuspendedOnData || + suspendedReason === SuspendedOnImmediate || + suspendedReason === SuspendedOnDeprecatedThrowPromise) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + } + else root = !0; + unwindUnitOfWork(unitOfWork, root); + } else completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - error$jscomp$0( - "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; - 0 === (completedWork.mode & 2) - ? (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )) - : (startProfilerTimer(completedWork), - (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + startProfilerTimer(completedWork); + current = runWithFiberInDEV( + completedWork, + completeWork, + current, + completedWork, + entangledRenderLanes + ); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); if (null !== current) { workInProgress = current; return; @@ -13443,31 +13435,37 @@ __DEV__ && workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } - function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - return null; + 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)) { + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); + 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 commitRootImpl( root, @@ -13475,7 +13473,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -13488,7 +13488,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c commit%c (" + formatLanes(lanes) + ")", + "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -13519,7 +13519,14 @@ __DEV__ && root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -13531,48 +13538,48 @@ __DEV__ && (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - root.current = finishedWork; - enableDebugTracing && + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = currentUpdatePriority), + (currentUpdatePriority = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffects(root, finishedWork, lanes), + (root.current = finishedWork), enableDebugTracing && - group( - "%c\u269b\ufe0f%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - enableSchedulingProfiler && + enableDebugTracing && + group( + "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "", + "font-weight: normal;" + ), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableDebugTracing && enableDebugTracing && groupEnd(); - enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -13600,19 +13607,19 @@ __DEV__ && remainingLanes.value, transitions ); - 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + 0 === (pendingPassiveEffectsLanes & 3) || (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; @@ -13634,7 +13641,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -13650,7 +13657,7 @@ __DEV__ && return ( (currentUpdatePriority = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -13660,15 +13667,6 @@ __DEV__ && } return !1; } - function enqueuePendingPassiveProfilerEffect(fiber) { - pendingPassiveProfilerEffects.push(fiber); - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); - return null; - })); - } function flushPassiveEffectsImpl() { if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; @@ -13684,7 +13682,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c passive effects%c (" + formatLanes(lanes) + ")", + "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -13697,12 +13695,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); - transitions = pendingPassiveProfilerEffects; - pendingPassiveProfilerEffects = []; - for (lanes = 0; lanes < transitions.length; lanes++) - commitPassiveEffectDurations(root, transitions[lanes]); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && @@ -13712,7 +13706,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -13750,22 +13744,17 @@ __DEV__ && err )); } - root = root.current.stateNode; - root.effectDuration = 0; - root.passiveEffectDuration = 0; + transitions = root.current.stateNode; + transitions.effectDuration = 0; + transitions.passiveEffectDuration = 0; return !0; } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -13795,12 +13784,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -13808,7 +13793,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -13842,6 +13827,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -13858,12 +13844,14 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -13872,7 +13860,7 @@ __DEV__ && (retryLane = disableLegacyMode || 0 !== (retryLane & 1) ? claimNextRetryLane() - : SyncLane)); + : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -14074,8 +14062,8 @@ __DEV__ && ); }) : "undefined" !== typeof IS_REACT_ACT_ENVIRONMENT - ? IS_REACT_ACT_ENVIRONMENT - : void 0; + ? IS_REACT_ACT_ENVIRONMENT + : void 0; } function resolveFunctionForHotReloading(type) { if (null === resolveFamily) return type; @@ -14182,9 +14170,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -14199,83 +14186,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -14299,9 +14209,9 @@ __DEV__ && this.deletions = null; this.childLanes = this.lanes = 0; this.alternate = null; - this.actualDuration = 0; - this.actualStartTime = -1; - this.treeBaseDuration = this.selfBaseDuration = 0; + this.actualDuration = -0; + this.actualStartTime = -1.1; + this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; this._debugNeedsRemount = !1; this._debugHookTypes = null; @@ -14309,9 +14219,48 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { + function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function createFiberImplObject(tag, pendingProps, key, mode) { + tag = { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, + _debugInfo: null, + _debugOwner: null, + _debugNeedsRemount: !1, + _debugHookTypes: null + }; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(tag); + return tag; + } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -14337,8 +14286,8 @@ __DEV__ && (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null), - (workInProgress.actualDuration = 0), - (workInProgress.actualStartTime = -1)); + (workInProgress.actualDuration = -0), + (workInProgress.actualStartTime = -1.1)); workInProgress.flags = current.flags & 31457280; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; @@ -14352,7 +14301,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -14405,7 +14355,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -14545,21 +14496,21 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null + ? owner.name + : null : null; fiberTag && (resolvedType += @@ -14688,6 +14639,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -14708,18 +14660,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], identifierPrefix = 0; - identifierPrefix < TotalLanes; + 31 > identifierPrefix; identifierPrefix++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for ( - identifierPrefix = 0; - identifierPrefix < TotalLanes; - identifierPrefix++ - ) + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) containerInfo.push(new Set()); if (disableLegacyMode) this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; @@ -14739,8 +14687,7 @@ __DEV__ && callback ) { 0 === container.tag && flushPassiveEffects(); - var rootFiber = container.current, - lane = SyncLane; + var rootFiber = container.current; if ( injectedHook && "function" === typeof injectedHook.onScheduleFiberRoot @@ -14759,18 +14706,17 @@ __DEV__ && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markRenderScheduled && - injectedProfilingHooks.markRenderScheduled(lane); + injectedProfilingHooks.markRenderScheduled(2); a: if (parentComponent) { parentComponent = parentComponent._reactInternals; b: { - if ( - getNearestMountedFiber(parentComponent) !== parentComponent || - 1 !== parentComponent.tag - ) + var parentContext = + getNearestMountedFiber(parentComponent) === parentComponent; + if (!parentContext || 1 !== parentComponent.tag) throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." ); - var parentContext = parentComponent; + parentContext = parentComponent; do { switch (parentContext.tag) { case 3: @@ -14814,7 +14760,7 @@ __DEV__ && "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown" )); - container = createUpdate(lane); + container = createUpdate(2); container.payload = { element: element }; callback = void 0 === callback ? null : callback; null !== callback && @@ -14824,23 +14770,26 @@ __DEV__ && callback ), (container.callback = callback)); - element = enqueueUpdate(rootFiber, container, lane); + element = enqueueUpdate(rootFiber, container, 2); null !== element && - (scheduleUpdateOnFiber(element, rootFiber, lane), - entangleTransitions(element, rootFiber, lane)); - return SyncLane; - } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; + (scheduleUpdateOnFiber(element, rootFiber, 2), + entangleTransitions(element, rootFiber, 2)); + return 2; } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -14854,31 +14803,34 @@ __DEV__ && suppressWarning = !1, assign = Object.assign, dynamicFeatureFlags = require("ReactFeatureFlags"), + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + disableDefaultPropsExceptForClasses = + dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableLegacyContextForFunctionComponents = + dynamicFeatureFlags.disableLegacyContextForFunctionComponents, + disableSchedulerTimeoutInWorkLoop = + dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, - disableSchedulerTimeoutInWorkLoop = - dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableUseDeferredValueInitialArg = - dynamicFeatureFlags.enableUseDeferredValueInitialArg, - retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, - syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, - transitionLaneExpirationMs = - dynamicFeatureFlags.transitionLaneExpirationMs, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - disableDefaultPropsExceptForClasses = - dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, + syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, + transitionLaneExpirationMs = + dynamicFeatureFlags.transitionLaneExpirationMs, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -14917,6 +14869,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -14957,30 +14910,12 @@ __DEV__ && clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, - TotalLanes = 31, - SyncHydrationLane = 1, - SyncLane = 2, - InputContinuousHydrationLane = 4, - InputContinuousLane = 8, - DefaultHydrationLane = 16, - DefaultLane = 32, - SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane, - TransitionHydrationLane = 64, - TransitionLanes = 4194176, - RetryLanes = 62914560, - SelectiveHydrationLane = 67108864, - IdleHydrationLane = 134217728, - IdleLane = 268435456, - OffscreenLane = 536870912, - DeferredLane = 1073741824, - UpdateLanes = - SyncLane | InputContinuousLane | DefaultLane | TransitionLanes, nextTransitionLane = 128, nextRetryLane = 4194304, - DiscreteEventPriority = SyncLane, - ContinuousEventPriority = InputContinuousLane, - DefaultEventPriority = DefaultLane, - IdleEventPriority = IdleLane, + DiscreteEventPriority = 2, + ContinuousEventPriority = 8, + DefaultEventPriority = 32, + IdleEventPriority = 268435456, isSuspenseInstancePending = shim$2, isSuspenseInstanceFallback = shim$2, getSuspenseInstanceFallbackErrorDetails = shim$2, @@ -14997,6 +14932,14 @@ __DEV__ && var scheduleTimeout = setTimeout, cancelTimeout = clearTimeout, currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = []; var fiberStack = []; var index$jscomp$0 = -1; @@ -15018,20 +14961,18 @@ __DEV__ && contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, - needsEscaping = /["'&<>\n\t]/, + needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0, + now = Scheduler.unstable_now, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -15261,6 +15202,120 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, + callComponent = { + "react-stack-bottom-frame": function (Component, props, secondArg) { + var wasRendering = isRendering; + isRendering = !0; + try { + return Component(props, secondArg); + } finally { + isRendering = wasRendering; + } + } + }, + callComponentInDEV = + callComponent["react-stack-bottom-frame"].bind(callComponent), + callRender = { + "react-stack-bottom-frame": function (instance) { + var wasRendering = isRendering; + isRendering = !0; + try { + return instance.render(); + } finally { + isRendering = wasRendering; + } + } + }, + callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender), + callComponentDidMount = { + "react-stack-bottom-frame": function (finishedWork, instance) { + try { + instance.componentDidMount(); + } catch (error$2) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$2); + } + } + }, + callComponentDidMountInDEV = callComponentDidMount[ + "react-stack-bottom-frame" + ].bind(callComponentDidMount), + callComponentDidUpdate = { + "react-stack-bottom-frame": function ( + finishedWork, + instance, + prevProps, + prevState, + snapshot + ) { + try { + instance.componentDidUpdate(prevProps, prevState, snapshot); + } catch (error$3) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$3); + } + } + }, + callComponentDidUpdateInDEV = callComponentDidUpdate[ + "react-stack-bottom-frame" + ].bind(callComponentDidUpdate), + callComponentDidCatch = { + "react-stack-bottom-frame": function (instance, errorInfo) { + var stack = errorInfo.stack; + instance.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + } + }, + callComponentDidCatchInDEV = callComponentDidCatch[ + "react-stack-bottom-frame" + ].bind(callComponentDidCatch), + callComponentWillUnmount = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + instance + ) { + try { + instance.componentWillUnmount(); + } catch (error$4) { + captureCommitPhaseError(current, nearestMountedAncestor, error$4); + } + } + }, + callComponentWillUnmountInDEV = callComponentWillUnmount[ + "react-stack-bottom-frame" + ].bind(callComponentWillUnmount), + callCreate = { + "react-stack-bottom-frame": function (effect) { + var create = effect.create; + effect = effect.inst; + create = create(); + return (effect.destroy = create); + } + }, + callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate), + callDestroy = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + destroy + ) { + try { + destroy(); + } catch (error$5) { + captureCommitPhaseError(current, nearestMountedAncestor, error$5); + } + } + }, + callDestroyInDEV = + callDestroy["react-stack-bottom-frame"].bind(callDestroy), + callLazyInit = { + "react-stack-bottom-frame": function (lazy) { + var init = lazy._init; + return init(lazy._payload); + } + }, + callLazyInitInDEV = + callLazyInit["react-stack-bottom-frame"].bind(callLazyInit), thenableState$1 = null, thenableIndexCounter$1 = 0, currentDebugInfo = null, @@ -15383,6 +15438,8 @@ __DEV__ && ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; + ContextOnlyDispatcher.unstable_useContextWithBailout = + throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15510,6 +15567,7 @@ __DEV__ && HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { currentHookNameInDev = "useFormState"; mountHookTypesDev(); + warnOnUseFormStateInDev(); return mountActionState(action, initialState); }; HooksDispatcherOnMountInDEV.useActionState = function ( @@ -15525,6 +15583,14 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15662,6 +15728,12 @@ __DEV__ && updateHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15792,6 +15864,14 @@ __DEV__ && updateHookTypesDev(); return updateOptimistic(passthrough, reducer); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -15922,6 +16002,14 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16082,6 +16170,13 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16239,6 +16334,13 @@ __DEV__ && updateHookTypesDev(); return updateOptimistic(passthrough, reducer); }; + InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16398,14 +16500,14 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); @@ -16413,6 +16515,8 @@ __DEV__ && var didWarnAboutDirectlyAssigningPropsToState = new Set(); var didWarnAboutUndefinedDerivedState = new Set(); var didWarnAboutContextTypeAndContextTypes = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); Object.freeze(fakeInternalInstance); @@ -16486,7 +16590,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -16540,6 +16644,7 @@ __DEV__ && didReceiveUpdate = !1; var didWarnAboutBadClass = {}; var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; var didWarnAboutGetDerivedStateOnFunctionComponent = {}; var didWarnAboutReassigningProps = !1; var didWarnAboutRevealOrder = {}; @@ -16657,6 +16762,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -16664,6 +16771,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -16679,7 +16787,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -16691,6 +16798,8 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16705,6 +16814,9 @@ __DEV__ && } catch (e) { hasBadMapPolyfill = !0; } + var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; var didWarnAboutNestedUpdates = !1; var overrideHookState = null, overrideHookStateDeletePath = null, @@ -16722,8 +16834,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateDeletePath = function (fiber, id, path) { id = findHook(fiber, id); @@ -16732,8 +16844,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { id = findHook(fiber, id); @@ -16742,20 +16854,20 @@ __DEV__ && (id.memoizedState = oldPath), (id.baseState = oldPath), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane)); + (oldPath = enqueueConcurrentRenderForLane(fiber, 2)), + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2)); }; overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename( @@ -16764,12 +16876,12 @@ __DEV__ && newPath ); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane); + oldPath = enqueueConcurrentRenderForLane(fiber, 2); + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); }; scheduleUpdate = function (fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; @@ -16909,41 +17021,33 @@ __DEV__ && }; return Text; })(React.Component); - (function (devToolsConfig) { - return injectInternals({ - bundleType: devToolsConfig.bundleType, - version: devToolsConfig.version, - rendererPackageName: devToolsConfig.rendererPackageName, - rendererConfig: devToolsConfig.rendererConfig, - overrideHookState: overrideHookState, - overrideHookStateDeletePath: overrideHookStateDeletePath, - overrideHookStateRenamePath: overrideHookStateRenamePath, - overrideProps: overrideProps, - overridePropsDeletePath: overridePropsDeletePath, - overridePropsRenamePath: overridePropsRenamePath, - setErrorHandler: setErrorHandler, - setSuspenseHandler: setSuspenseHandler, - scheduleUpdate: scheduleUpdate, + (function () { + var internals = { + bundleType: 1, + version: "19.0.0-www-classic-13411e45-20241014", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: findHostInstanceByFiber, - findFiberByHostInstance: - devToolsConfig.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: findHostInstancesForRefresh, - scheduleRefresh: scheduleRefresh, - scheduleRoot: scheduleRoot, - setRefreshHandler: setRefreshHandler, - getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627" - }); - })({ - findFiberByHostInstance: function () { - return null; - }, - bundleType: 1, - version: "19.0.0-www-classic-e02baf6c92-20240627", - rendererPackageName: "react-art" - }); + findFiberByHostInstance: getInstanceFromNode, + reconcilerVersion: "19.0.0-www-classic-13411e45-20241014" + }; + internals.overrideHookState = overrideHookState; + internals.overrideHookStateDeletePath = overrideHookStateDeletePath; + internals.overrideHookStateRenamePath = overrideHookStateRenamePath; + internals.overrideProps = overrideProps; + internals.overridePropsDeletePath = overridePropsDeletePath; + internals.overridePropsRenamePath = overridePropsRenamePath; + internals.scheduleUpdate = scheduleUpdate; + internals.setErrorHandler = setErrorHandler; + internals.setSuspenseHandler = setSuspenseHandler; + internals.scheduleRefresh = scheduleRefresh; + internals.scheduleRoot = scheduleRoot; + internals.setRefreshHandler = setRefreshHandler; + internals.getCurrentFiber = getCurrentFiberForDevTools; + enableSchedulingProfiler && + ((internals.getLaneLabelMap = getLaneLabelMap), + (internals.injectProfilingHooks = injectProfilingHooks)); + return injectInternals(internals); + })(); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, Group = TYPES.GROUP, Shape = TYPES.SHAPE, @@ -16958,6 +17062,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; + exports.version = "19.0.0-www-classic-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index b802f2c5da3b7..1d79ef908516c 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -72,20 +72,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork()); @@ -161,7 +147,7 @@ __DEV__ && _key++ ) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args, Error("react-stack-top-frame")); + printWarning("warn", format, args); } } function error$jscomp$0(format) { @@ -174,16 +160,16 @@ __DEV__ && _key2++ ) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args, Error("react-stack-top-frame")); + printWarning("error", format, args); } } - function printWarning(level, format, args, currentStack) { + function printWarning(level, format, args) { level = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; null != level && level.getCurrentStack && - ((currentStack = level.getCurrentStack(currentStack)), - "" !== currentStack && ((format += "%s"), args.push(currentStack))); + ((level = level.getCurrentStack()), + "" !== level && ((format += "%s"), args.push(level))); args.unshift(format); args.unshift(!1); warningWWW.apply(null, args); @@ -385,8 +371,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -540,28 +532,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -600,7 +570,7 @@ __DEV__ && var JSCompiler_temp_const = info, env = entry.env; var JSCompiler_inline_result = describeBuiltInComponentFrame( - entry.name + (env ? " (" + env + ")" : "") + entry.name + (env ? " [" + env + "]" : "") ); info = JSCompiler_temp_const + JSCompiler_inline_result; } @@ -635,110 +605,6 @@ __DEV__ && isRendering = !1; current = null; } - function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; - } - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error("Unable to find node on an unmounted component."); - } - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) - throw Error("Unable to find node on an unmounted component."); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error("Unable to find node on an unmounted component."); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - _child = _child.sibling; - } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { - if (_child === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (_child === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - _child = _child.sibling; - } - if (!didFindChild) - throw Error( - "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." - ); - } - } - if (a.alternate !== b) - throw Error( - "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." - ); - } - if (3 !== a.tag) - throw Error("Unable to find node on an unmounted component."); - return a.stateNode.current === a ? fiber : alternate; - } - function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; - } function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -764,8 +630,8 @@ __DEV__ && ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } function injectInternals(internals) { @@ -780,13 +646,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -846,21 +706,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -881,20 +726,6 @@ __DEV__ && typeof injectedProfilingHooks.markComponentRenderStopped && injectedProfilingHooks.markComponentRenderStopped(); } - function markComponentLayoutEffectUnmountStarted(fiber) { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && - injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); - } - function markComponentLayoutEffectUnmountStopped() { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); - } function markRenderStarted(lanes) { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -919,41 +750,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -969,21 +799,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -998,41 +828,55 @@ __DEV__ && var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; 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)) + : enableSiblingPrerendering && + !root && + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : enableSiblingPrerendering && + !root && + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1056,11 +900,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1071,60 +915,50 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1134,11 +968,17 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + enableSiblingPrerendering && + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1147,8 +987,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1280,14 +1120,14 @@ __DEV__ && null != props.scaleX ? props.scaleX : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; var scaleY = null != props.scaleY ? props.scaleY : null != props.scale - ? props.scale - : 1; + ? props.scale + : 1; pooledTransform .transformTo(1, 0, 0, 1, 0, 0) .move(props.x || 0, props.y || 0) @@ -1377,12 +1217,12 @@ __DEV__ && JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1393,11 +1233,36 @@ __DEV__ && instance.draw(string, props.font, props.alignment, props.path), (instance._currentString = string); } + function resetTextContent() {} function shouldSetTextContent(type, props) { return ( "string" === typeof props.children || "number" === typeof props.children ); } + function removeChild(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function removeChildFromContainer(parentInstance, child) { + destroyEventListeners(child); + child.eject(); + } + function commitTextUpdate() {} + function commitMount() {} + function commitUpdate(instance, type, oldProps, newProps) { + instance._applyProps(instance, newProps, oldProps); + } + function hideInstance(instance) { + instance.hide(); + } + function hideTextInstance() {} + function unhideInstance(instance, props) { + (null == props.visible || props.visible) && instance.show(); + } + function unhideTextInstance() {} + function getInstanceFromNode() { + return null; + } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1463,7 +1328,7 @@ __DEV__ && var id = getWakeableID(wakeable), display = wakeable.displayName || wakeable; log( - "%c\u269b\ufe0f%c " + componentName + " suspended", + "%c\u269b%c " + componentName + " suspended", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1472,7 +1337,7 @@ __DEV__ && wakeable.then( function () { log( - "%c\u269b\ufe0f%c " + componentName + " resolved", + "%c\u269b%c " + componentName + " resolved", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1481,7 +1346,7 @@ __DEV__ && }, function () { log( - "%c\u269b\ufe0f%c " + componentName + " rejected", + "%c\u269b%c " + componentName + " rejected", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "color: #80366d; font-weight: bold;", id, @@ -1494,7 +1359,7 @@ __DEV__ && function logRenderStarted(lanes) { enableDebugTracing && group( - "%c\u269b\ufe0f%c render%c (" + formatLanes(lanes) + ")", + "%c\u269b%c render%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -1503,7 +1368,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -1611,10 +1476,10 @@ __DEV__ && : "{" + content.slice(0, maxLength - 7) + '..."}' : "{" + content + "}") : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; } function describeTextDiff(clientText, serverProps, indent) { var maxLength = 120 - 2 * indent; @@ -1708,10 +1573,10 @@ __DEV__ && return "string" !== typeof value || needsEscaping.test(value) ? "{" + describeValue(value, maxLength - 2) + "}" : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } function describeExpandedElement(type, props, rowPrefix) { var remainingRowLength = 120 - rowPrefix.length - type.length, @@ -1729,17 +1594,17 @@ __DEV__ && return 0 === properties.length ? rowPrefix + "<" + type + ">\n" : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } function describePropertiesDiff(clientObject, serverObject, indent) { var properties = "", @@ -1888,7 +1753,10 @@ __DEV__ && "number" === typeof clientProps || "bigint" === typeof clientProps ) - content += describeTextDiff("" + clientProps, void 0, indent + 1); + content = + null == type + ? content + describeTextDiff("" + clientProps, null, indent + 1) + : content + describeTextDiff("" + clientProps, void 0, indent + 1); return content; } function describeSiblingFiber(fiber, indent) { @@ -1924,7 +1792,7 @@ __DEV__ && debugInfo = ""; i = node.fiber.pendingProps; if (6 === node.fiber.tag) - debugInfo = describeTextDiff(i, node.serverProps, indent); + (debugInfo = describeTextDiff(i, node.serverProps, indent)), indent++; else if ( ((serverComponentName = describeFiberType(node.fiber)), null !== serverComponentName) @@ -1952,22 +1820,23 @@ __DEV__ && indent++; } else null === node.serverProps - ? (debugInfo = describeExpandedElement( + ? ((debugInfo = describeExpandedElement( serverComponentName, i, added(indent) - )) - : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent )), - indent++); + indent++) + : "string" === typeof node.serverProps + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); var propName = ""; i = node.fiber.child; for ( @@ -1984,9 +1853,10 @@ __DEV__ && i && 0 < node.children.length && (propName += indentation(indent) + "...\n"); - node = node.serverTail; - for (i = 0; i < node.length; i++) - (serverComponentName = node[i]), + i = node.serverTail; + null === node.serverProps && indent--; + for (node = 0; node < i.length; node++) + (serverComponentName = i[node]), (propName = "string" === typeof serverComponentName ? propName + @@ -2069,7 +1939,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -2084,6 +1954,54 @@ __DEV__ && (parent = node.return); return 3 === node.tag ? node.stateNode : null; } + function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; + } + function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; + } + function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; + } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; + } + } + function recordEffectDuration() { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + profilerStartTime = -1; + profilerEffectDuration += elapsedTime; + } + } + function startEffectTimer() { + profilerStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function ensureRootIsScheduled(root) { root !== lastScheduledRoot && null === root.next && @@ -2101,30 +2019,41 @@ __DEV__ && enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } - function flushSyncWorkAcrossRoots_impl(onlyLegacy) { + function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { - var workInProgressRootRenderLanes$jscomp$0 = - workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot - ? workInProgressRootRenderLanes$jscomp$0 - : 0 - ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot( - root, - workInProgressRootRenderLanes$jscomp$0 - )); - } + if (!onlyLegacy) + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var nextLanes = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + nextLanes = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); + nextLanes = + nextLanes & 201326677 + ? (nextLanes & 201326677) | 1 + : nextLanes + ? nextLanes | 2 + : 0; + } + 0 !== nextLanes && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); + } else + (nextLanes = workInProgressRootRenderLanes), + (nextLanes = getNextLanes( + root, + root === workInProgressRoot ? nextLanes : 0 + )), + 0 !== (nextLanes & 3) && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -2136,6 +2065,7 @@ __DEV__ && didScheduleMicrotask_act = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now$1(), prev = null, root = firstScheduledRoot; null !== root; @@ -2148,12 +2078,10 @@ __DEV__ && null === prev ? (firstScheduledRoot = next) : (prev.next = next), null === next && (lastScheduledRoot = prev)) : ((prev = root), - 0 !== (nextLanes & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -2163,7 +2091,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -2194,12 +2122,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -2225,7 +2153,7 @@ __DEV__ && default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode$1)) @@ -2234,6 +2162,34 @@ __DEV__ && root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + !disableSchedulerTimeoutInWorkLoop && didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode$1 && null !== callbackNode && @@ -2271,8 +2227,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2369,10 +2325,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -2468,7 +2421,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -2595,6 +2548,16 @@ __DEV__ && ); 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) @@ -2875,6 +2838,7 @@ __DEV__ && lanes )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -2948,6 +2912,7 @@ __DEV__ && key )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -2969,6 +2934,7 @@ __DEV__ && lanes )), (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -3015,6 +2981,7 @@ __DEV__ && null )), (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -3034,7 +3001,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3115,7 +3082,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3212,7 +3179,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3547,6 +3514,7 @@ __DEV__ && newChild.key )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), (currentFirstChild._debugInfo = currentDebugInfo), validateFragmentProps( newChild, @@ -3688,7 +3656,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -3718,6 +3686,8 @@ __DEV__ && lanes )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), + (currentFirstChild._debugInfo = currentDebugInfo), (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); @@ -3793,12 +3763,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -3980,8 +3950,8 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = 0 !== (workInProgress.mode & 8); var children = callComponentInDEV(Component, props, secondArg); @@ -4011,6 +3981,14 @@ __DEV__ && } 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; @@ -4034,9 +4012,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -4068,10 +4045,16 @@ __DEV__ && numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -4169,6 +4152,38 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + null === lastContextDependency) + ) { + if (null === JSCompiler_temp) + throw Error( + "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; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -4219,7 +4234,7 @@ __DEV__ && (currentlyRenderingFiber$1.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) + if (void 0 === updateQueue || ignorePreviousDependencies) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; @@ -4300,7 +4315,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -4417,12 +4432,11 @@ __DEV__ && ), (didWarnUncachedGetSnapshot = !0)); } - cachedSnapshot = workInProgressRoot; - if (null === cachedSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) || + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -4487,12 +4501,11 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -4526,13 +4539,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -4655,8 +4668,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -4672,8 +4685,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4820,17 +4833,16 @@ __DEV__ && function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -5030,15 +5042,13 @@ __DEV__ && ); } function mountDeferredValueImpl(hook, value, initialValue) { - return enableUseDeferredValueInitialArg && - void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) - ? ((hook.memoizedState = initialValue), - (hook = requestDeferredLane()), - (currentlyRenderingFiber$1.lanes |= hook), - (workInProgressRootSkippedLanes |= hook), - initialValue) - : (hook.memoizedState = value); + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber$1.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (objectIs(value, prevValue)) return value; @@ -5048,7 +5058,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -5092,14 +5102,26 @@ __DEV__ && returnValue, finishedState ); - dispatchSetState(fiber, queue, thenableForFinishedState); - } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$5 - }); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error$9) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -5146,8 +5168,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -5236,8 +5257,17 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); + dispatchSetStateInternal( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 + ); + markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { - lane: JSCompiler_OptimizeArgumentsArray_p1, + lane: lane, revertLane: 0, action: action, hasEagerState: !1, @@ -5259,35 +5289,27 @@ __DEV__ && eagerState = alternate(currentState, action); update.hasEagerState = !0; update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) { - enqueueUpdate$1(fiber, queue, update, 0); - null === workInProgressRoot && finishQueueingConcurrentUpdates(); - return; - } - } catch (error$6) { + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } } - currentState = enqueueConcurrentHookUpdate( - fiber, - queue, - update, - JSCompiler_OptimizeArgumentsArray_p1 - ); - null !== currentState && - (scheduleUpdateOnFiber( - currentState, - fiber, - JSCompiler_OptimizeArgumentsArray_p1 - ), - entangleTransitionUpdate( - currentState, - queue, - JSCompiler_OptimizeArgumentsArray_p1 - )); + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + return !1; } function dispatchOptimisticSetState( fiber, @@ -5301,7 +5323,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -5317,11 +5339,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -5340,7 +5362,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -5355,61 +5377,6 @@ __DEV__ && } enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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 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 warnOnInvalidCallback(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); @@ -5631,12 +5598,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -5657,15 +5621,14 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && - propagateParentContextChanges( - returnFiber, - sourceFiber, - rootRenderLanes, - !0 - )); + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); enableDebugTracing && sourceFiber.mode & 4 && ((returnFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), @@ -5953,7 +5916,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -6110,7 +6073,7 @@ __DEV__ && renderLanes ); } - if (0 !== (renderLanes & OffscreenLane)) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -6124,7 +6087,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -6175,8 +6138,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -6193,6 +6155,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -6237,11 +6200,14 @@ __DEV__ && null === current && (validateFunctionComponentInDev(workInProgress, workInProgress.type), Component.contextTypes && - error$jscomp$0( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead.", - getComponentNameFromType(Component) || "Unknown" - )); - prepareToReadContext(workInProgress, renderLanes); + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + error$jscomp$0( + "%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 + )))); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, @@ -6269,11 +6235,12 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -6327,7 +6294,7 @@ __DEV__ && ); enqueueCapturedUpdate(workInProgress, lane); } - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) { state = emptyContextObject; _instance = Component.contextType; @@ -6340,12 +6307,12 @@ __DEV__ && void 0 === _instance ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(Component) || "Component", @@ -6448,26 +6415,25 @@ __DEV__ && "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", state ); - _instance.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - state - ); _instance.contextType && error$jscomp$0( "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", state ); Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), error$jscomp$0( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead.", + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", state - ); + )); Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), error$jscomp$0( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead.", + "%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 - ); + )); "function" === typeof _instance.componentShouldUpdate && error$jscomp$0( "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", @@ -6729,8 +6695,7 @@ __DEV__ && state !== newApiName || oldState !== newState || hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies)) ? ("function" === typeof unresolvedOldProps && @@ -6752,8 +6717,7 @@ __DEV__ && newState, lane ) || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies))) ? (oldContext || @@ -7002,44 +6966,44 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - showFallback - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + showFallback + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isSuspenseInstanceFallback()) @@ -7073,8 +7037,7 @@ __DEV__ && renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, @@ -7087,18 +7050,17 @@ __DEV__ && JSCompiler_temp = workInProgressRoot; if (null !== JSCompiler_temp) { nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & SyncUpdateLanes)) - nextProps = SyncHydrationLane; + if (0 !== (nextProps & 42)) nextProps = 1; else switch (nextProps) { - case SyncLane: - nextProps = SyncHydrationLane; + case 2: + nextProps = 1; break; - case InputContinuousLane: - nextProps = InputContinuousHydrationLane; + case 8: + nextProps = 4; break; - case DefaultLane: - nextProps = DefaultHydrationLane; + case 32: + nextProps = 16; break; case 128: case 256: @@ -7119,10 +7081,10 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - nextProps = TransitionHydrationLane; + nextProps = 64; break; - case IdleLane: - nextProps = IdleHydrationLane; + case 268435456: + nextProps = 134217728; break; default: nextProps = 0; @@ -7226,16 +7188,16 @@ __DEV__ && retryQueue: null }) : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== currentOffscreenQueue + ? currentOffscreenQueue.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)); } nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, @@ -7538,7 +7500,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -7566,12 +7528,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -7615,9 +7574,10 @@ __DEV__ && case 12: 0 !== (renderLanes & workInProgress.childLanes) && (workInProgress.flags |= 4); + workInProgress.flags |= 2048; var stateNode = workInProgress.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; break; case 13: stateNode = workInProgress.memoizedState; @@ -7647,8 +7607,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -7850,9 +7809,10 @@ __DEV__ && current.$$typeof === REACT_LAZY_TYPE && (workInProgress = " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; throw Error( "Element type is invalid. Received a promise that resolves to: " + - current + + renderLanes + ". Lazy element type must resolve to a class or function." + workInProgress ); @@ -7913,7 +7873,12 @@ __DEV__ && var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== prevSibling.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); prevSibling = nextProps.element; prevSibling === returnFiber @@ -7953,16 +7918,7 @@ __DEV__ && null, renderLanes )), - (HostTransitionContext._currentValue2 = prevSibling), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== prevSibling && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = prevSibling)), markRef(current, workInProgress), reconcileChildren( current, @@ -8041,9 +7997,10 @@ __DEV__ && case 12: return ( (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = 0), - (returnFiber.passiveEffectDuration = 0), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), reconcileChildren( current, workInProgress, @@ -8053,45 +8010,27 @@ __DEV__ && workInProgress.child ); case 10: - a: { - returnFiber = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - prevSibling = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = prevSibling.value; + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, returnFiber, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if (nextProps.children === prevSibling.children) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange( - workInProgress, - returnFiber, - renderLanes - ); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, prevSibling.children, renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + ), + workInProgress.child + ); case 9: return ( enableRenderableContext @@ -8104,7 +8043,7 @@ __DEV__ && error$jscomp$0( "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." ), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (prevSibling = readContext(prevSibling)), enableSchedulingProfiler && markComponentRenderStarted(workInProgress), @@ -8183,7 +8122,7 @@ __DEV__ && ); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (returnFiber = readContext(CacheContext)), null === current ? ((prevSibling = peekCacheFromPool()), @@ -8221,10 +8160,11 @@ __DEV__ && : ((returnFiber = nextProps.cache), pushProvider(workInProgress, CacheContext, returnFiber), returnFiber !== prevSibling.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -8327,147 +8267,80 @@ __DEV__ && "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + var select = dependency.select; + if ( + null != select && + null != dependency.lastSelectedValue && + !checkIfSelectedContextValuesChanged( + dependency.lastSelectedValue, + select(dependency.context._currentValue2) + ) + ) + continue b; + list.lanes |= renderLanes; + dependency = list.alternate; null !== dependency && (dependency.lanes |= renderLanes); scheduleContextWorkOnParentPath( - fiber.return, + list.return, renderLanes, workInProgress ); - list.lanes |= renderLanes; - break; + forcePropagateEntireTree || (nextFiber = null); + break a; } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; } - fiber = nextFiber; - } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -8476,85 +8349,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + } + function checkIfSelectedContextValuesChanged( + oldComparedValue, + newComparedValue + ) { + if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { + if (oldComparedValue.length !== newComparedValue.length) return !0; + for (var i = 0; i < oldComparedValue.length; i++) + if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; + } else throw Error("Compared context values must be arrays"); + return !1; } function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -8563,9 +8441,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -8580,8 +8457,12 @@ __DEV__ && "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 }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -8628,16 +8509,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -8744,7 +8625,11 @@ __DEV__ && : null; } function containsNode() { - throw Error("Not implemented."); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = getInstanceFromScope(); @@ -8760,12 +8645,13 @@ __DEV__ && return childContextValues; } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + enableSiblingPrerendering && + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { switch (renderState.tailMode) { @@ -9174,7 +9060,7 @@ __DEV__ && 2 * now$1() - fallthroughToNormalSuspensePath.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(fallthroughToNormalSuspensePath, !1), @@ -9231,7 +9117,7 @@ __DEV__ && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), newProps - ? 0 !== (renderLanes & OffscreenLane) && + ? 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -9419,77 +9305,378 @@ __DEV__ && } } function shouldProfile(current) { - return ( - 0 !== (current.mode & 2) && - (executionContext & CommitContext) !== NoContext - ); + return 0 !== (current.mode & 2); } - function callComponentWillUnmountWithTimer(current, instance) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); } - function safelyAttachRef(current, nearestMountedAncestor) { + function commitHookLayoutUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitHookEffectListMount(flags, finishedWork) { 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; - } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) - if (shouldProfile(current)) - try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); - } finally { - recordLayoutEffectDuration(current); - } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); + 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 && + (enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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) { + error$jscomp$0( + "%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$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + } catch (error$11) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$11); } } - function safelyDetachRef(current, nearestMountedAncestor) { - var ref = current.ref, - refCleanup = current.refCleanup; + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor + ) { + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && + injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( + finishedWork + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error$12) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$12); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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$13) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } + } + } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } + } + function safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance + ) { + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordEffectDuration()) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ); + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile(finishedWork)) + try { + startEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordEffectDuration(); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + disableStringRefs && "string" === typeof ref + ? error$jscomp$0("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); + } + } + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error$17) { + captureCommitPhaseError(current, nearestMountedAncestor, error$17); + } + } + 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(); + startEffectTimer(), runWithFiberInDEV(current, refCleanup); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else refCleanup(); - } catch (error$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); + else runWithFiberInDEV(current, refCleanup); + } catch (error$18) { + captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9499,21 +9686,193 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else ref(null); - } catch (error$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + else runWithFiberInDEV(current, ref, null); + } catch (error$19) { + captureCommitPhaseError(current, nearestMountedAncestor, error$19); } else ref.current = null; } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitStartTime + ); + } + function commitProfilerPostCommitImpl( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { + var _finishedWork$memoize2 = finishedWork.memoizedProps; + finishedWork = _finishedWork$memoize2.id; + _finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize2 && + _finishedWork$memoize2( + finishedWork, + current, + passiveEffectDuration, + commitStartTime + ); + } + function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$22) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$22); + } + } + function isHostParent(fiber) { + return 5 === fiber.tag || 3 === 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 && 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) + if (((node = node.stateNode), before)) { + if (node === before) + throw Error("ReactART: Can not insert node before itself"); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) + if (((node = node.stateNode), before)) { + if (node === before) + throw Error("ReactART: Can not insert node before itself"); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) { + 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: + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && (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." + ); } } function commitBeforeMutationEffects(root, firstChild) { @@ -9530,11 +9889,67 @@ __DEV__ && (firstChild.return = root), (nextEffect = firstChild); else for (; null !== nextEffect; ) { - root = nextEffect; - try { - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$12) { - captureCommitPhaseError(root, root.return, error$12); + firstChild = root = nextEffect; + i = firstChild.alternate; + var flags = firstChild.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === firstChild.tag)) + a: { + if ( + null !== i && + ((JSCompiler_temp = i.memoizedState), + null === JSCompiler_temp || + null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = firstChild.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; + } + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(firstChild, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (firstChild.tag) { + case 0: + if ( + 0 !== (flags & 4) && + ((firstChild = firstChild.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (flags = firstChild[i]), (flags.ref.impl = flags.nextImpl); + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== i && + commitClassSnapshot(firstChild, i); + break; + case 3: + 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." + ); } firstChild = root.sibling; if (null !== firstChild) { @@ -9550,399 +9965,55 @@ __DEV__ && focusedInstanceHandle = null; return root; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - 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: - 0 !== (flags & 1024) && - null !== current && - ((flags = current.memoizedProps), - (JSCompiler_temp = current.memoizedState), - (current = finishedWork.stateNode), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (JSCompiler_temp = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== flags || - JSCompiler_temp.has(finishedWork.type) || - (JSCompiler_temp.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = flags)); - break; - case 3: - 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), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork)), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - 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) { - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - )); - var create = effect.create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\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: " + create - )); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitPassiveEffectDurations(finishedRoot, finishedWork) { - if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) - switch (finishedWork.tag) { - case 12: - finishedRoot = finishedWork.stateNode.passiveEffectDuration; - var _finishedWork$memoize = finishedWork.memoizedProps, - id = _finishedWork$memoize.id; - _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$jscomp$0 = commitTime, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize( - id, - phase, - finishedRoot, - commitTime$jscomp$0 - ); - finishedWork = finishedWork.return; - a: for (; null !== finishedWork; ) { - switch (finishedWork.tag) { - case 3: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - case 12: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - } - finishedWork = finishedWork.return; - } - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); - } - } - 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 && - error$jscomp$0( - "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 && - error$jscomp$0( - "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$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } - } - } - 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) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); - } - } - 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 - ); + case 15: + 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)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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) + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps, finishedWork.elementType === finishedWork.type ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -9956,106 +10027,109 @@ __DEV__ && "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" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startEffectTimer(), + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( - committedLanes, - prevState, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, - finishedWork.return, - error$18 + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + current = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) ) { - finishedRoot = null; + prevProps = null; if (null !== finishedWork.child) switch (finishedWork.child.tag) { case 27: case 5: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; break; case 1: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); - } catch (error$22) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$15 ); } } + finishedRoot.effectDuration += popNestedEffectDurations(current); break; case 26: case 27: case 5: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + 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); + if (flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + finishedRoot = finishedWork.stateNode; + finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(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( @@ -10063,11 +10137,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -10077,11 +10147,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -10287,64 +10353,6 @@ __DEV__ && fiber.stateNode = null; fiber.updateQueue = null; } - function isHostParent(fiber) { - return 5 === fiber.tag || 3 === 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 && 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) - if (((node = node.stateNode), before)) { - if (node === before) - throw Error("ReactART: Can not insert node before itself"); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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) - if (((node = node.stateNode), before)) { - if (node === before) - throw Error("ReactART: Can not insert node before itself"); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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, @@ -10394,16 +10402,51 @@ __DEV__ && ); hostParent = _prevHostParent; hostParentIsContainer = _prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); + if (null !== hostParent) + if (hostParentIsContainer) + try { + runWithFiberInDEV( + deletedFiber, + removeChildFromContainer, + hostParent, + deletedFiber.stateNode + ); + } catch (error$29) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$29 + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error$30) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$30 + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (_prevHostParent = finishedRoot.onDeleted) && + _prevHostParent(deletedFiber.stateNode); + } catch (error$31) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$31 + ); + } null !== hostParent && (hostParentIsContainer ? clearSuspenseBoundaryFromContainer() @@ -10426,49 +10469,19 @@ __DEV__ && case 11: case 14: case 15: - if ( - !offscreenSubtreeWasHidden && - ((_prevHostParent = deletedFiber.updateQueue), - null !== _prevHostParent && - ((_prevHostParent = _prevHostParent.lastEffect), - null !== _prevHostParent)) - ) { - _prevHostParentIsContainer = _prevHostParent = _prevHostParent.next; - do { - var tag = _prevHostParentIsContainer.tag, - inst = _prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((tag & Insertion) !== NoFlags - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )), - enableSchedulingProfiler && - markComponentLayoutEffectUnmountStopped())); - _prevHostParentIsContainer = _prevHostParentIsContainer.next; - } while (_prevHostParentIsContainer !== _prevHostParent); - } + (!enableHiddenSubtreeInsertionEffectCleanup && + offscreenSubtreeWasHidden) || + commitHookEffectListUnmount( + Insertion, + deletedFiber, + nearestMountedAncestor + ); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects( + deletedFiber, + nearestMountedAncestor, + Layout + ); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10476,21 +10489,15 @@ __DEV__ && ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), (_prevHostParent = deletedFiber.stateNode), - "function" === typeof _prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, _prevHostParent); - } catch (error$7) { - captureCommitPhaseError( + "function" === typeof _prevHostParent.componentWillUnmount && + safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - error$7 - ); - } + _prevHostParent + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -10556,10 +10563,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -10569,10 +10576,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -10595,74 +10602,53 @@ __DEV__ && 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$25) { - captureCommitPhaseError(childToDelete, parentFiber, error$25); + 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) { @@ -10670,57 +10656,23 @@ __DEV__ && 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$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$27) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$27 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout | HasEffect + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -10738,25 +10690,42 @@ __DEV__ && case 26: case 27: case 5: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - commitReconciliationEffects(finishedWork); - flags & 512 && - null !== current && - safelyDetachRef(current, current.return); - if (flags & 4) { - var _instance2 = finishedWork.stateNode; - if (null != _instance2) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; - try { - _instance2._applyProps(_instance2, newProps, current); - } catch (error$30) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$30 - ); - } + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + flags & 512 && + null !== current && + safelyDetachRef(current, current.return); + if (finishedWork.flags & 32) { + var instance = finishedWork.stateNode; + try { + runWithFiberInDEV(finishedWork, resetTextContent, instance); + } catch (error$25) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$25 + ); + } + } + if (flags & 4 && null != finishedWork.stateNode) { + instance = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : instance; + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + current, + instance, + finishedWork + ); + } catch (error$23) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$23 + ); } } flags & 1024 && @@ -10766,31 +10735,59 @@ __DEV__ && ); break; case 6: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - if (flags & 4 && 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." - ); + 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.memoizedProps; + current = null !== current ? current.memoizedProps : flags; + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + instance, + current, + flags + ); + } catch (error$24) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$24 + ); + } + } break; case 3: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); + root.effectDuration += popNestedEffectDurations(flags); break; case 4: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; + case 12: + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); + finishedWork.stateNode.effectDuration += + bubbleNestedEffectDurations(flags); break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((_instance2 = null !== finishedWork.memoizedState), + ((instance = null !== finishedWork.memoizedState), (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? _instance2 !== current && - (globalMostRecentFallbackTime = now$1()) - : _instance2 && + ? instance !== current && (globalMostRecentFallbackTime = now$1()) + : instance && !current && (globalMostRecentFallbackTime = now$1())); if (flags & 4) { @@ -10830,7 +10827,7 @@ __DEV__ && prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); @@ -10855,24 +10852,51 @@ __DEV__ && a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - current = root; + retryQueue = current = root; try { - (_instance2 = root.stateNode), + (instance = retryQueue.stateNode), suspenseCallback - ? _instance2.hide() - : ((newProps = root.memoizedProps), - (null == newProps.visible || newProps.visible) && - root.stateNode.show()); - } catch (error$23) { + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$23 + retryQueue, + retryQueue.return, + error$26 + ); + } + } + } else if (6 === root.tag) { + if (null === current) { + retryQueue = root; + try { + var instance$jscomp$0 = retryQueue.stateNode; + suspenseCallback + ? runWithFiberInDEV( + retryQueue, + hideTextInstance, + instance$jscomp$0 + ) + : runWithFiberInDEV( + retryQueue, + unhideTextInstance, + instance$jscomp$0, + retryQueue.memoizedProps + ); + } catch (error$27) { + captureCommitPhaseError( + retryQueue, + retryQueue.return, + error$27 ); } } } else if ( - 6 !== root.tag && ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || root === finishedWork) && @@ -10902,7 +10926,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -10911,7 +10935,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -10920,7 +10944,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -10928,43 +10952,9 @@ __DEV__ && var flags = finishedWork.flags; if (flags & 2) { try { - 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: - case 5: - var _parent = parentFiber.stateNode; - parentFiber.flags & 32 && (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." - ); - } - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -10973,27 +10963,13 @@ __DEV__ && 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) { @@ -11002,40 +10978,22 @@ __DEV__ && case 11: case 14: case 15: - if (shouldProfile(finishedWork)) - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); - } finally { - recordLayoutEffectDuration(finishedWork); - } - else - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(finishedWork, instance); - } catch (error$7) { - captureCommitPhaseError( - finishedWork, - nearestMountedAncestor, - error$7 - ); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -11082,28 +11040,32 @@ __DEV__ && 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(); - } catch (error$34) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$14 ); } - 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); @@ -11117,17 +11079,45 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); + includeWorkInProgressEffects && + null === current && + flags & 4 && + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects = finishedWork.stateNode; + includeWorkInProgressEffects.effectDuration += + bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + includeWorkInProgressEffects.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -11161,9 +11151,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -11171,22 +11159,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$35) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$35); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -11261,21 +11233,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -11284,9 +11241,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11315,6 +11270,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11382,6 +11338,33 @@ __DEV__ && clearTransitionsForLanes(finishedRoot, committedLanes); } } + finishedRoot.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + flags & 2048 + ? ((prevEffectDuration = pushNestedEffectDurations()), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration)), + commitProfilerPostCommit( + finishedWork, + finishedWork.alternate, + commitStartTime, + finishedRoot.passiveEffectDuration + )) + : recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); break; case 23: recursivelyTraversePassiveMountEffects( @@ -11398,9 +11381,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11408,31 +11391,29 @@ __DEV__ && committedTransitions ) : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : prevEffectDuration._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + : ((prevEffectDuration._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -11476,9 +11457,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11525,9 +11504,9 @@ __DEV__ && ); break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & 4 + ? _instance2._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11537,11 +11516,9 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11554,7 +11531,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -11581,83 +11558,59 @@ __DEV__ && includeWorkInProgressEffects && flags & 2048 && commitTracingMarkerPassiveMountEffect(finishedWork); - break; - } - default: - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - ); - } - } - function recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - parentFiber, - committedLanes, - committedTransitions - ) { - 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; + break; + } default: - recursivelyTraverseAtomicPassiveEffects( + recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, - committedTransitions + committedTransitions, + includeWorkInProgressEffects ); } } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + function recursivelyTraverseAtomicPassiveEffects( + finishedRoot$jscomp$0, + parentFiber + ) { + if (parentFiber.subtreeFlags & 10256) + 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, + finishedWork.stateNode + ); + 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) @@ -11709,25 +11662,6 @@ __DEV__ && 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)) { @@ -11744,11 +11678,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -11764,12 +11694,24 @@ __DEV__ && Passive | HasEffect ); break; + case 3: + var prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration); + break; case 22: - var instance = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState && - instance._visibility & 4 && + prevEffectDuration._visibility & 4 && (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((instance._visibility &= -5), + ? ((prevEffectDuration._visibility &= -5), recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork); break; @@ -11792,7 +11734,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -11819,116 +11761,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { 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, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } + } + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), + abortParentMarkerTransitionsForDeletedFiber( + current, + instance, + offscreenFiber, + null, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + 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; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; break a; } - nextEffect = returnFiber; - } - } - } - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) - abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } + nextEffect = offscreenFiber; } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - instance, - offscreenFiber, - null, - !1 - ))); } } function isConcurrentActEnvironment() { @@ -12024,8 +11957,8 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? OffscreenLane + 0 !== (workInProgressRootRenderLanes & 536870912) + ? 536870912 : claimNextTransitionLane()); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); @@ -12044,7 +11977,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -12101,83 +12035,102 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )); ensureRootIsScheduled(root); } } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var shouldTimeSlice = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice + var exitStatus = (forceSync = + !forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { - var renderWasConcurrent = shouldTimeSlice; + if (exitStatus !== RootInProgress) { + var renderWasConcurrent = forceSync; do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { - shouldTimeSlice = root.current.alternate; + forceSync = root.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) + !isRenderConsistentWithExternalStores(forceSync) ) { - didTimeout = renderRootSync(root, lanes); + exitStatus = renderRootSync(root, lanes); renderWasConcurrent = !1; continue; } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; + if (exitStatus === RootErrored) { + var lanesThatJustErrored = lanes; + root.errorRecoveryDisabledLanes & lanesThatJustErrored + ? (renderWasConcurrent = 0) + : ((renderWasConcurrent = root.pendingLanes & -536870913), + (renderWasConcurrent = + 0 !== renderWasConcurrent + ? renderWasConcurrent + : renderWasConcurrent & 536870912 + ? 536870912 + : 0)); + if (0 !== renderWasConcurrent) { + lanes = renderWasConcurrent; + a: { + exitStatus = root; + var originallyAttemptedLanes = lanesThatJustErrored; + lanesThatJustErrored = workInProgressRootConcurrentErrors; + renderWasConcurrent = renderRootSync( + exitStatus, + renderWasConcurrent + ); + if (renderWasConcurrent !== RootErrored) { + if (workInProgressRootDidAttachPingListener) { + exitStatus.errorRecoveryDisabledLanes |= + originallyAttemptedLanes; + workInProgressRootInterleavedUpdatedLanes |= + originallyAttemptedLanes; + exitStatus = RootSuspendedWithDelay; + break a; + } + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = lanesThatJustErrored; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = renderWasConcurrent; + } + renderWasConcurrent = !1; + if (exitStatus !== RootErrored) continue; + } } - if (didTimeout === RootFatalErrored) { + if (exitStatus === RootFatalErrored) { prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; - switch (didTimeout) { + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -12191,53 +12144,93 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) { + lanes = renderWasConcurrent; + forceSync = workInProgressRootRecoverableErrors; + exitStatus = workInProgressTransitions; + renderWasConcurrent = + workInProgressRootDidIncludeRecursiveRenderUpdate; + lanesThatJustErrored = workInProgressDeferredLane; + originallyAttemptedLanes = + workInProgressRootInterleavedUpdatedLanes; + var suspendedRetryLanes = workInProgressSuspendedRetryLanes, + suspendedCommitReason = IMMEDIATE_COMMIT, + prevTransition = ReactSharedInternals.T, + previousUpdateLanePriority = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + lanes, + forceSync, + exitStatus, + renderWasConcurrent, + previousUpdateLanePriority, + lanesThatJustErrored, + originallyAttemptedLanes, + suspendedRetryLanes, + suspendedCommitReason, + -0, + 0 + ); + } finally { + (ReactSharedInternals.T = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + } else { if ( - (lanes & RetryLanes) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < didTimeout) + 10 < exitStatus) ) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + -0, + 0 ), - didTimeout + exitStatus ); break a; } commitRootWhenReady( renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + -0, + 0 ); } } @@ -12246,33 +12239,6 @@ __DEV__ && } while (1); } ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -12289,41 +12255,62 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { lanes = finishedWork.subtreeFlags; (lanes & 8192 || 16785408 === (lanes & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); + finishedWork = ReactSharedInternals.T; + lanes = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ); + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = lanes); + } } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$37) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error$33) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -12338,8 +12325,10 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -12347,73 +12336,32 @@ __DEV__ && (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; - - ) { + enableSiblingPrerendering && + !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 && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork() { return (executionContext & (RenderContext | CommitContext)) === NoContext - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -12448,9 +12396,16 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -12458,9 +12413,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -12484,20 +12437,28 @@ __DEV__ && resetCurrentFiber(); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); - var handler = suspenseHandlerStackCursor.current; + var JSCompiler_temp; + if ((JSCompiler_temp = !enableSiblingPrerendering)) + (JSCompiler_temp = suspenseHandlerStackCursor.current), + (JSCompiler_temp = + null === JSCompiler_temp + ? !0 + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? JSCompiler_temp === shellBoundary + : !1); workInProgressSuspendedReason = - (null !== handler && - ((workInProgressRootRenderLanes & TransitionLanes) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & RetryLanes) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & OffscreenLane)) || - handler !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? SuspendedOnImmediate - : SuspendedOnData; + JSCompiler_temp && + 0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? SuspendedOnData + : SuspendedOnImmediate; } else thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), @@ -12506,21 +12467,21 @@ __DEV__ && thrownValue === SelectiveHydrationException ? SuspendedOnHydration : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; - handler = workInProgress; - if (null === handler) + JSCompiler_temp = workInProgress; + if (null === JSCompiler_temp) (workInProgressRootExitStatus = RootFatalErrored), logUncaughtError( root, createCapturedValueAtFiber(thrownValue, root.current) ); else if ( - (handler.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(handler, !0), + (JSCompiler_temp.mode & 2 && + stopProfilerTimerIfRunningAndRecordDuration(JSCompiler_temp), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -12530,7 +12491,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentErrored && injectedProfilingHooks.markComponentErrored( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12544,7 +12505,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentSuspended && injectedProfilingHooks.markComponentSuspended( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12562,13 +12523,17 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + 0 !== (workInProgressRootRenderLanes & 60) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -12612,15 +12577,21 @@ __DEV__ && null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$38) { - handleThrow(root, thrownValue$38); + } catch (thrownValue$34) { + handleThrow(root, thrownValue$34); } while (1); lanes && root.shellSuspendCounter++; @@ -12661,7 +12632,13 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering && + (workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes)); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -12678,7 +12655,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -12710,7 +12692,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -12742,12 +12729,22 @@ __DEV__ && } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -12762,8 +12759,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$39) { - handleThrow(root, thrownValue$39); + } catch (thrownValue$35) { + handleThrow(root, thrownValue$35); } while (1); resetContextDependencies(); @@ -12801,7 +12798,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -12809,7 +12806,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -12817,7 +12814,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -12876,10 +12873,15 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } - function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { + function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason + ) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); thenableState$1 = null; @@ -12903,9 +12905,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$40) { + } catch (error$36) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$40); + throw ((workInProgress = returnFiber), error$36); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -12914,62 +12916,52 @@ __DEV__ && 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 = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (suspendedReason === SuspendedOnError) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else { + if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + suspendedReason === SuspendedOnData || + suspendedReason === SuspendedOnImmediate || + suspendedReason === SuspendedOnDeprecatedThrowPromise) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + } + else root = !0; + unwindUnitOfWork(unitOfWork, root); + } else completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - error$jscomp$0( - "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; - 0 === (completedWork.mode & 2) - ? (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )) - : (startProfilerTimer(completedWork), - (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + startProfilerTimer(completedWork); + current = runWithFiberInDEV( + completedWork, + completeWork, + current, + completedWork, + entangledRenderLanes + ); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); if (null !== current) { workInProgress = current; return; @@ -12984,31 +12976,37 @@ __DEV__ && workInProgressRootExitStatus === RootInProgress && (workInProgressRootExitStatus = RootCompleted); } - function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - return null; + 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)) { + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); + 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 commitRootImpl( root, @@ -13016,7 +13014,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -13029,7 +13029,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c commit%c (" + formatLanes(lanes) + ")", + "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -13060,7 +13060,14 @@ __DEV__ && root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -13072,48 +13079,48 @@ __DEV__ && (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitBeforeMutationEffects(root, finishedWork); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - root.current = finishedWork; - enableDebugTracing && + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = currentUpdatePriority), + (currentUpdatePriority = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffects(root, finishedWork, lanes), + (root.current = finishedWork), enableDebugTracing && - group( - "%c\u269b\ufe0f%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - enableSchedulingProfiler && + enableDebugTracing && + group( + "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "", + "font-weight: normal;" + ), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableDebugTracing && enableDebugTracing && groupEnd(); - enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -13141,18 +13148,17 @@ __DEV__ && remainingLanes.value, transitions ); - 0 !== (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) && - flushPassiveEffects(); + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; @@ -13174,7 +13180,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -13190,7 +13196,7 @@ __DEV__ && return ( (currentUpdatePriority = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -13200,15 +13206,6 @@ __DEV__ && } return !1; } - function enqueuePendingPassiveProfilerEffect(fiber) { - pendingPassiveProfilerEffects.push(fiber); - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); - return null; - })); - } function flushPassiveEffectsImpl() { if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; @@ -13224,7 +13221,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c passive effects%c (" + formatLanes(lanes) + ")", + "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -13237,12 +13234,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); - transitions = pendingPassiveProfilerEffects; - pendingPassiveProfilerEffects = []; - for (lanes = 0; lanes < transitions.length; lanes++) - commitPassiveEffectDurations(root, transitions[lanes]); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && @@ -13252,7 +13245,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -13290,22 +13283,17 @@ __DEV__ && err )); } - root = root.current.stateNode; - root.effectDuration = 0; - root.passiveEffectDuration = 0; + transitions = root.current.stateNode; + transitions.effectDuration = 0; + transitions.passiveEffectDuration = 0; return !0; } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -13335,12 +13323,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -13348,7 +13332,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -13382,6 +13366,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -13397,12 +13382,14 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -13677,9 +13664,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -13694,83 +13680,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -13794,9 +13703,9 @@ __DEV__ && this.deletions = null; this.childLanes = this.lanes = 0; this.alternate = null; - this.actualDuration = 0; - this.actualStartTime = -1; - this.treeBaseDuration = this.selfBaseDuration = 0; + this.actualDuration = -0; + this.actualStartTime = -1.1; + this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; this._debugNeedsRemount = !1; this._debugHookTypes = null; @@ -13804,9 +13713,48 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { + function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function createFiberImplObject(tag, pendingProps, key, mode) { + tag = { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, + _debugInfo: null, + _debugOwner: null, + _debugNeedsRemount: !1, + _debugHookTypes: null + }; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(tag); + return tag; + } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -13832,8 +13780,8 @@ __DEV__ && (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null), - (workInProgress.actualDuration = 0), - (workInProgress.actualStartTime = -1)); + (workInProgress.actualDuration = -0), + (workInProgress.actualStartTime = -1.1)); workInProgress.flags = current.flags & 31457280; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; @@ -13847,7 +13795,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13900,7 +13849,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -14038,21 +13988,21 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); fiberTag = owner ? "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null + ? owner.name + : null : null; fiberTag && (resolvedType += @@ -14181,6 +14131,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -14201,14 +14152,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], tag = 0; - tag < TotalLanes; + 31 > tag; tag++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for (tag = 0; tag < TotalLanes; tag++) containerInfo.push(new Set()); + for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; } function updateContainerSync( @@ -14219,7 +14170,6 @@ __DEV__ && ) { 0 === container.tag && flushPassiveEffects(); parentComponent = container.current; - var lane = SyncLane; if ( injectedHook && "function" === typeof injectedHook.onScheduleFiberRoot @@ -14238,7 +14188,7 @@ __DEV__ && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markRenderScheduled && - injectedProfilingHooks.markRenderScheduled(lane); + injectedProfilingHooks.markRenderScheduled(2); var context = emptyContextObject; null === container.context ? (container.context = context) @@ -14251,7 +14201,7 @@ __DEV__ && "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s.", getComponentNameFromFiber(current) || "Unknown" )); - container = createUpdate(lane); + container = createUpdate(2); container.payload = { element: element }; callback = void 0 === callback ? null : callback; null !== callback && @@ -14261,23 +14211,26 @@ __DEV__ && callback ), (container.callback = callback)); - element = enqueueUpdate(parentComponent, container, lane); + element = enqueueUpdate(parentComponent, container, 2); null !== element && - (scheduleUpdateOnFiber(element, parentComponent, lane), - entangleTransitions(element, parentComponent, lane)); - return SyncLane; - } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; + (scheduleUpdateOnFiber(element, parentComponent, 2), + entangleTransitions(element, parentComponent, 2)); + return 2; } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && @@ -14291,31 +14244,32 @@ __DEV__ && suppressWarning = !1, assign = Object.assign, dynamicFeatureFlags = require("ReactFeatureFlags"), + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + disableDefaultPropsExceptForClasses = + dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableSchedulerTimeoutInWorkLoop = + dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, - disableSchedulerTimeoutInWorkLoop = - dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableUseDeferredValueInitialArg = - dynamicFeatureFlags.enableUseDeferredValueInitialArg, - retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, - syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, - transitionLaneExpirationMs = - dynamicFeatureFlags.transitionLaneExpirationMs, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - disableDefaultPropsExceptForClasses = - dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, + syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, + transitionLaneExpirationMs = + dynamicFeatureFlags.transitionLaneExpirationMs, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -14353,6 +14307,7 @@ __DEV__ && prevGroupEnd; disabledLog.__reactDisabledLog = !0; var prefix, + suffix, reentry = !1; var componentFrameCache = new ( "function" === typeof WeakMap ? WeakMap : Map @@ -14393,30 +14348,12 @@ __DEV__ && clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log$1 = Math.log, LN2 = Math.LN2, - TotalLanes = 31, - SyncHydrationLane = 1, - SyncLane = 2, - InputContinuousHydrationLane = 4, - InputContinuousLane = 8, - DefaultHydrationLane = 16, - DefaultLane = 32, - SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane, - TransitionHydrationLane = 64, - TransitionLanes = 4194176, - RetryLanes = 62914560, - SelectiveHydrationLane = 67108864, - IdleHydrationLane = 134217728, - IdleLane = 268435456, - OffscreenLane = 536870912, - DeferredLane = 1073741824, - UpdateLanes = - SyncLane | InputContinuousLane | DefaultLane | TransitionLanes, nextTransitionLane = 128, nextRetryLane = 4194304, - DiscreteEventPriority = SyncLane, - ContinuousEventPriority = InputContinuousLane, - DefaultEventPriority = DefaultLane, - IdleEventPriority = IdleLane, + DiscreteEventPriority = 2, + ContinuousEventPriority = 8, + DefaultEventPriority = 32, + IdleEventPriority = 268435456, isSuspenseInstancePending = shim$2, isSuspenseInstanceFallback = shim$2, getSuspenseInstanceFallbackErrorDetails = shim$2, @@ -14433,6 +14370,14 @@ __DEV__ && var scheduleTimeout = setTimeout, cancelTimeout = clearTimeout, currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = []; var fiberStack = []; var index$jscomp$0 = -1, @@ -14450,20 +14395,18 @@ __DEV__ && contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }, - needsEscaping = /["'&<>\n\t]/, + needsEscaping = /["'&<>\n\t]|^\s|\s$/, hydrationDiffRootDEV = null, hydrationErrors = null, concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0, + now = Scheduler.unstable_now, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -14693,6 +14636,120 @@ __DEV__ && }, suspendedThenable = null, needsToResetSuspendedThenableDEV = !1, + callComponent = { + "react-stack-bottom-frame": function (Component, props, secondArg) { + var wasRendering = isRendering; + isRendering = !0; + try { + return Component(props, secondArg); + } finally { + isRendering = wasRendering; + } + } + }, + callComponentInDEV = + callComponent["react-stack-bottom-frame"].bind(callComponent), + callRender = { + "react-stack-bottom-frame": function (instance) { + var wasRendering = isRendering; + isRendering = !0; + try { + return instance.render(); + } finally { + isRendering = wasRendering; + } + } + }, + callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender), + callComponentDidMount = { + "react-stack-bottom-frame": function (finishedWork, instance) { + try { + instance.componentDidMount(); + } catch (error$2) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$2); + } + } + }, + callComponentDidMountInDEV = callComponentDidMount[ + "react-stack-bottom-frame" + ].bind(callComponentDidMount), + callComponentDidUpdate = { + "react-stack-bottom-frame": function ( + finishedWork, + instance, + prevProps, + prevState, + snapshot + ) { + try { + instance.componentDidUpdate(prevProps, prevState, snapshot); + } catch (error$3) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$3); + } + } + }, + callComponentDidUpdateInDEV = callComponentDidUpdate[ + "react-stack-bottom-frame" + ].bind(callComponentDidUpdate), + callComponentDidCatch = { + "react-stack-bottom-frame": function (instance, errorInfo) { + var stack = errorInfo.stack; + instance.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + } + }, + callComponentDidCatchInDEV = callComponentDidCatch[ + "react-stack-bottom-frame" + ].bind(callComponentDidCatch), + callComponentWillUnmount = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + instance + ) { + try { + instance.componentWillUnmount(); + } catch (error$4) { + captureCommitPhaseError(current, nearestMountedAncestor, error$4); + } + } + }, + callComponentWillUnmountInDEV = callComponentWillUnmount[ + "react-stack-bottom-frame" + ].bind(callComponentWillUnmount), + callCreate = { + "react-stack-bottom-frame": function (effect) { + var create = effect.create; + effect = effect.inst; + create = create(); + return (effect.destroy = create); + } + }, + callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate), + callDestroy = { + "react-stack-bottom-frame": function ( + current, + nearestMountedAncestor, + destroy + ) { + try { + destroy(); + } catch (error$5) { + captureCommitPhaseError(current, nearestMountedAncestor, error$5); + } + } + }, + callDestroyInDEV = + callDestroy["react-stack-bottom-frame"].bind(callDestroy), + callLazyInit = { + "react-stack-bottom-frame": function (lazy) { + var init = lazy._init; + return init(lazy._payload); + } + }, + callLazyInitInDEV = + callLazyInit["react-stack-bottom-frame"].bind(callLazyInit), thenableState$1 = null, thenableIndexCounter$1 = 0, currentDebugInfo = null, @@ -14815,6 +14872,8 @@ __DEV__ && ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; + ContextOnlyDispatcher.unstable_useContextWithBailout = + throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -14942,6 +15001,7 @@ __DEV__ && HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { currentHookNameInDev = "useFormState"; mountHookTypesDev(); + warnOnUseFormStateInDev(); return mountActionState(action, initialState); }; HooksDispatcherOnMountInDEV.useActionState = function ( @@ -14957,6 +15017,14 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15094,6 +15162,12 @@ __DEV__ && updateHookTypesDev(); return mountOptimistic(passthrough); }; + HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15224,6 +15298,14 @@ __DEV__ && updateHookTypesDev(); return updateOptimistic(passthrough, reducer); }; + HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -15354,6 +15436,14 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; + HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function ( + context, + select + ) { + currentHookNameInDev = "useContext"; + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15514,6 +15604,13 @@ __DEV__ && mountHookTypesDev(); return mountOptimistic(passthrough); }; + InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15671,6 +15768,13 @@ __DEV__ && updateHookTypesDev(); return updateOptimistic(passthrough, reducer); }; + InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -15830,20 +15934,22 @@ __DEV__ && updateHookTypesDev(); return rerenderOptimistic(passthrough, reducer); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = + function (context, select) { + currentHookNameInDev = "useContext"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return unstable_useContextWithBailout(context, select); + }; + 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$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); var didWarnAboutInvalidateContextType = new Set(); var didWarnOnInvalidCallback = new Set(); Object.freeze(fakeInternalInstance); @@ -15859,9 +15965,20 @@ __DEV__ && ); instance._warnedAboutRefsInRender = !0; } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + component = component._reactInternals; + if (!component) return !1; + instance = owner = component; + if (component.alternate) for (; owner.return; ) owner = owner.return; + else { + var nextNode = owner; + do + (owner = nextNode), + 0 !== (owner.flags & 4098) && (instance = owner.return), + (nextNode = owner.return); + while (nextNode); + } + owner = 3 === owner.tag ? instance : null; + return owner === component; }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; @@ -15917,7 +16034,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -15971,6 +16088,7 @@ __DEV__ && didReceiveUpdate = !1; var didWarnAboutBadClass = {}; var didWarnAboutContextTypeOnFunctionComponent = {}; + var didWarnAboutContextTypes = {}; var didWarnAboutGetDerivedStateOnFunctionComponent = {}; var didWarnAboutReassigningProps = !1; var didWarnAboutRevealOrder = {}; @@ -16088,6 +16206,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -16095,6 +16215,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -16110,7 +16231,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -16122,6 +16242,8 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16136,6 +16258,9 @@ __DEV__ && } catch (e) { hasBadMapPolyfill = !0; } + var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; var didWarnAboutNestedUpdates = !1; var overrideHookState = null, overrideHookStateDeletePath = null, @@ -16153,8 +16278,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateDeletePath = function (fiber, id, path) { id = findHook(fiber, id); @@ -16163,8 +16288,8 @@ __DEV__ && (id.memoizedState = path), (id.baseState = path), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (path = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane)); + (path = enqueueConcurrentRenderForLane(fiber, 2)), + null !== path && scheduleUpdateOnFiber(path, fiber, 2)); }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { id = findHook(fiber, id); @@ -16173,20 +16298,20 @@ __DEV__ && (id.memoizedState = oldPath), (id.baseState = oldPath), (fiber.memoizedProps = assign({}, fiber.memoizedProps)), - (oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane)); + (oldPath = enqueueConcurrentRenderForLane(fiber, 2)), + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2)); }; overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSetImpl(fiber.memoizedProps, path, 0, value); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDeleteImpl(fiber.memoizedProps, path, 0); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - path = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== path && scheduleUpdateOnFiber(path, fiber, SyncLane); + path = enqueueConcurrentRenderForLane(fiber, 2); + null !== path && scheduleUpdateOnFiber(path, fiber, 2); }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename( @@ -16195,12 +16320,12 @@ __DEV__ && newPath ); fiber.alternate && (fiber.alternate.pendingProps = fiber.pendingProps); - oldPath = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, SyncLane); + oldPath = enqueueConcurrentRenderForLane(fiber, 2); + null !== oldPath && scheduleUpdateOnFiber(oldPath, fiber, 2); }; scheduleUpdate = function (fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; @@ -16339,41 +16464,33 @@ __DEV__ && }; return Text; })(React.Component); - (function (devToolsConfig) { - return injectInternals({ - bundleType: devToolsConfig.bundleType, - version: devToolsConfig.version, - rendererPackageName: devToolsConfig.rendererPackageName, - rendererConfig: devToolsConfig.rendererConfig, - overrideHookState: overrideHookState, - overrideHookStateDeletePath: overrideHookStateDeletePath, - overrideHookStateRenamePath: overrideHookStateRenamePath, - overrideProps: overrideProps, - overridePropsDeletePath: overridePropsDeletePath, - overridePropsRenamePath: overridePropsRenamePath, - setErrorHandler: setErrorHandler, - setSuspenseHandler: setSuspenseHandler, - scheduleUpdate: scheduleUpdate, + (function () { + var internals = { + bundleType: 1, + version: "19.0.0-www-modern-13411e45-20241014", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: findHostInstanceByFiber, - findFiberByHostInstance: - devToolsConfig.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: findHostInstancesForRefresh, - scheduleRefresh: scheduleRefresh, - scheduleRoot: scheduleRoot, - setRefreshHandler: setRefreshHandler, - getCurrentFiber: getCurrentFiberForDevTools, - reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627" - }); - })({ - findFiberByHostInstance: function () { - return null; - }, - bundleType: 1, - version: "19.0.0-www-modern-e02baf6c92-20240627", - rendererPackageName: "react-art" - }); + findFiberByHostInstance: getInstanceFromNode, + reconcilerVersion: "19.0.0-www-modern-13411e45-20241014" + }; + internals.overrideHookState = overrideHookState; + internals.overrideHookStateDeletePath = overrideHookStateDeletePath; + internals.overrideHookStateRenamePath = overrideHookStateRenamePath; + internals.overrideProps = overrideProps; + internals.overridePropsDeletePath = overridePropsDeletePath; + internals.overridePropsRenamePath = overridePropsRenamePath; + internals.scheduleUpdate = scheduleUpdate; + internals.setErrorHandler = setErrorHandler; + internals.setSuspenseHandler = setSuspenseHandler; + internals.scheduleRefresh = scheduleRefresh; + internals.scheduleRoot = scheduleRoot; + internals.setRefreshHandler = setRefreshHandler; + internals.getCurrentFiber = getCurrentFiberForDevTools; + enableSchedulingProfiler && + ((internals.getLaneLabelMap = getLaneLabelMap), + (internals.injectProfilingHooks = injectProfilingHooks)); + return injectInternals(internals); + })(); var ClippingRectangle = TYPES.CLIPPING_RECTANGLE, Group = TYPES.GROUP, Shape = TYPES.SHAPE, @@ -16388,6 +16505,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; + exports.version = "19.0.0-www-modern-13411e45-20241014"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index ed44c5c44ad2f..39956ea098fc9 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -60,30 +60,33 @@ function formatProdErrorMessage(code) { ); } var dynamicFeatureFlags = require("ReactFeatureFlags"), + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + disableDefaultPropsExceptForClasses = + dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableLegacyContextForFunctionComponents = + dynamicFeatureFlags.disableLegacyContextForFunctionComponents, + disableSchedulerTimeoutInWorkLoop = + dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, - disableSchedulerTimeoutInWorkLoop = - dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableUseDeferredValueInitialArg = - dynamicFeatureFlags.enableUseDeferredValueInitialArg, - retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, - syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, - transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - disableDefaultPropsExceptForClasses = - dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, + syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, + transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, disableLegacyMode = dynamicFeatureFlags.disableLegacyMode, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol @@ -243,7 +246,8 @@ function getComponentNameFromFiber(fiber) { } var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - prefix; + prefix, + suffix; function describeBuiltInComponentFrame(name) { if (void 0 === prefix) try { @@ -251,8 +255,14 @@ function describeBuiltInComponentFrame(name) { } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } var reentry = !1; function describeNativeComponentFrame(fn, construct) { @@ -438,88 +448,6 @@ function getNearestMountedFiber(fiber) { } return 3 === node.tag ? nearestMounted : null; } -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$3 = parentA.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) { - for (child$3 = parentB.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -560,8 +488,8 @@ function childrenAsString(children) { ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, @@ -661,30 +589,44 @@ 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, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; 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)) + : enableSiblingPrerendering && + !root && + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : enableSiblingPrerendering && + !root && + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { @@ -729,14 +671,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} -function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60); -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -753,25 +687,34 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$7 = 31 - clz32(noLongerPendingLanes), + var index$7 = 31 - clz32(remainingLanes), lane = 1 << index$7; - remainingLanes[index$7] = 0; + entanglements[index$7] = 0; expirationTimes[index$7] = -1; var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) @@ -783,9 +726,15 @@ function markRootFinished(root, remainingLanes, spawnedLane) { var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + !enableSiblingPrerendering || + 0 === suspendedRetryLanes || + 0 !== updatedLanes || + (disableLegacyMode && 0 === root.tag) || + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -985,12 +934,12 @@ function applyTextProps(instance, props) { JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -1009,6 +958,14 @@ function shouldSetTextContent(type, props) { ); } var currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -1119,15 +1076,7 @@ function createCapturedValueAtFiber(value, source) { var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; + hostTransitionProviderCursor = createCursor(null); function pushHostContainer(fiber, nextRootInstance) { push(rootInstanceStackCursor, nextRootInstance); push(contextFiberStackCursor, fiber); @@ -1251,22 +1200,42 @@ function ensureRootIsScheduled(root) { enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } -function flushSyncWorkAcrossRoots_impl(onlyLegacy) { +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { - var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$13 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 - ); - 0 !== (workInProgressRootRenderLanes$13 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); - } + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + JSCompiler_inline_result = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + JSCompiler_inline_result &= + pendingLanes & ~(suspendedLanes & ~pingedLanes); + JSCompiler_inline_result = + JSCompiler_inline_result & 201326677 + ? (JSCompiler_inline_result & 201326677) | 1 + : JSCompiler_inline_result + ? JSCompiler_inline_result | 2 + : 0; + } + 0 !== JSCompiler_inline_result && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root, + root === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 !== (JSCompiler_inline_result & 3) && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); root = root.next; } } while (didPerformSomeWork); @@ -1275,6 +1244,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now(), prev = null, root = firstScheduledRoot; null !== root; @@ -1290,8 +1260,7 @@ function processRootScheduleInMicrotask() { 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -1361,12 +1330,36 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + !disableSchedulerTimeoutInWorkLoop && didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} function requestTransitionLane() { 0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane()); @@ -1395,8 +1388,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -1555,20 +1548,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$15 = workInProgress$jscomp$0.alternate; - null !== current$15 && - ((current$15 = current$15.updateQueue), - (pendingQueue = current$15.lastBaseUpdate), + var current$16 = workInProgress$jscomp$0.alternate; + null !== current$16 && + ((current$16 = current$16.updateQueue), + (pendingQueue = current$16.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$15.firstBaseUpdate = firstPendingUpdate) + ? (current$16.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$15.lastBaseUpdate = lastPendingUpdate))); + (current$16.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$15 = firstPendingUpdate = lastPendingUpdate = null; + current$16 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1581,8 +1574,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$15 && - (current$15 = current$15.next = + null !== current$16 && + (current$16 = current$16.next = { lane: 0, tag: pendingQueue.tag, @@ -1635,10 +1628,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$15 - ? ((firstPendingUpdate = current$15 = isHiddenUpdate), + null === current$16 + ? ((firstPendingUpdate = current$16 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$15 = current$15.next = isHiddenUpdate), + : (current$16 = current$16.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1651,10 +1644,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$15 && (lastPendingUpdate = newState); + null === current$16 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$15; + queue.lastBaseUpdate = current$16; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -1986,7 +1979,7 @@ function createChildReconciler(shouldTrackSideEffects) { if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2035,7 +2028,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2105,7 +2098,7 @@ function createChildReconciler(shouldTrackSideEffects) { existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2429,7 +2422,7 @@ function createChildReconciler(shouldTrackSideEffects) { return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2516,8 +2509,8 @@ function pushPrimaryTreeSuspenseHandler(handler) { ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler) - : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); + ? push(suspenseHandlerStackCursor, handler) + : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -2526,9 +2519,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$44 = fiber.alternate; - null !== current$44 && - null !== current$44.memoizedState && + var current$45 = fiber.alternate; + null !== current$45 && + null !== current$45.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2624,9 +2617,8 @@ function finishRenderingHooks(current) { thenableIndexCounter = 0; thenableState = null; if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -2642,9 +2634,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -2731,6 +2729,31 @@ function updateWorkInProgressHook() { } return workInProgressHook; } +function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + null === lastContextDependency) + ) { + if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; +} var createFunctionComponentUpdateQueue; createFunctionComponentUpdateQueue = function () { return { lastEffect: null, events: null, stores: null, memoCache: null }; @@ -2764,16 +2787,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$46 = currentlyRenderingFiber$1.alternate; - null !== current$46 && - ((current$46 = current$46.updateQueue), - null !== current$46 && - ((current$46 = current$46.memoCache), - null != current$46 && + var current$47 = currentlyRenderingFiber$1.alternate; + null !== current$47 && + ((current$47 = current$47.updateQueue), + null !== current$47 && + ((current$47 = current$47.memoCache), + null != current$47 && (memoCache = { data: enableNoCloningMemoCache - ? current$46.data - : current$46.data.map(function (array) { + ? current$47.data + : current$47.data.map(function (array) { return array.slice(); }), index: 0 @@ -2788,11 +2811,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$46 = 0; - current$46 < size; - current$46++ + current$47 = 0; + current$47 < size; + current$47++ ) - updateQueue[current$46] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$47] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2825,7 +2848,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$47 = !1; + didReadFromEntangledAsyncAction$48 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2846,11 +2869,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$48 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$48 = !0); continue; } else (updateLane = { @@ -2896,7 +2919,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$47 && + didReadFromEntangledAsyncAction$48 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2954,9 +2977,8 @@ function updateSyncExternalStore(subscribe, getSnapshot) { { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(subscribe, renderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -3084,8 +3106,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$51) { - onActionError(actionQueue, node, error$51); + } catch (error$52) { + onActionError(actionQueue, node, error$52); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3228,17 +3250,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -3345,15 +3366,13 @@ function updateMemo(nextCreate, deps) { return prevState; } function mountDeferredValueImpl(hook, value, initialValue) { - return enableUseDeferredValueInitialArg && - void 0 !== initialValue && - 0 === (renderLanes & 1073741824) - ? ((hook.memoizedState = initialValue), - (hook = requestDeferredLane()), - (currentlyRenderingFiber$1.lanes |= hook), - (workInProgressRootSkippedLanes |= hook), - initialValue) - : (hook.memoizedState = value); + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber$1.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (objectIs(value, prevValue)) return value; @@ -3404,22 +3423,33 @@ function startTransition( returnValue, finishedState ); - dispatchSetState(fiber, queue, thenableForFinishedState); - } else dispatchSetState(fiber, queue, finishedState); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); } catch (error) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition); } } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function updateId() { return updateWorkInProgressHook().memoizedState; @@ -3467,15 +3497,18 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(fiber), - update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; + var lane = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); else { var alternate = fiber.alternate; @@ -3489,19 +3522,24 @@ function dispatchSetState(fiber, queue, action) { eagerState = alternate(currentState, action); update.hasEagerState = !0; update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) { - enqueueUpdate$1(fiber, queue, update, 0); - null === workInProgressRoot && finishQueueingConcurrentUpdates(); - return; - } + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 + ); } catch (error) { } finally { } action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane)); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } + return !1; } function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { action = { @@ -3575,6 +3613,7 @@ ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; +ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3671,20 +3710,19 @@ var HooksDispatcherOnMount = { var fiber = currentlyRenderingFiber$1, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); - var root = workInProgressRoot; - if (null === root) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root, workInProgressRootRenderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; - root = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = root; - mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [ + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ subscribe ]); fiber.flags |= 2048; pushEffect( 9, - updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), { destroy: void 0 }, null ); @@ -3738,6 +3776,8 @@ HooksDispatcherOnMount.useOptimistic = function (passthrough) { queue.dispatch = hook; return [passthrough, hook]; }; +HooksDispatcherOnMount.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3786,6 +3826,8 @@ HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { var hook = updateWorkInProgressHook(); return updateOptimisticImpl(hook, currentHook, passthrough, reducer); }; +HooksDispatcherOnUpdate.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3839,6 +3881,8 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +HooksDispatcherOnRerender.unstable_useContextWithBailout = + unstable_useContextWithBailout; function applyDerivedStateFromProps( workInProgress, ctor, @@ -3909,8 +3953,8 @@ function checkShouldComponentUpdate( return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = !1, @@ -4004,9 +4048,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$54 in Component) + void 0 === newProps[propName$54] && + (newProps[propName$54] = Component[propName$54]); } return newProps; } @@ -4126,16 +4170,14 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || 0 !== (sourceFiber.mode & 1) || @@ -4163,20 +4205,20 @@ function throwException( ? ((currentSourceFiber.flags |= 65536), (currentSourceFiber.lanes = rootRenderLanes)) : currentSourceFiber === returnFiber - ? (currentSourceFiber.flags |= 65536) - : ((currentSourceFiber.flags |= 128), - (sourceFiber.flags |= 131072), - (sourceFiber.flags &= -52805), - 1 === sourceFiber.tag - ? null === sourceFiber.alternate - ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(2)), - (returnFiber.tag = 2), - enqueueUpdate(sourceFiber, returnFiber, 2)) - : 0 === sourceFiber.tag && - null === sourceFiber.alternate && - (sourceFiber.tag = 28), - (sourceFiber.lanes |= 2)); + ? (currentSourceFiber.flags |= 65536) + : ((currentSourceFiber.flags |= 128), + (sourceFiber.flags |= 131072), + (sourceFiber.flags &= -52805), + 1 === sourceFiber.tag + ? null === sourceFiber.alternate + ? (sourceFiber.tag = 17) + : ((returnFiber = createUpdate(2)), + (returnFiber.tag = 2), + enqueueUpdate(sourceFiber, returnFiber, 2)) + : 0 === sourceFiber.tag && + null === sourceFiber.alternate && + (sourceFiber.tag = 28), + (sourceFiber.lanes |= 2)); value === noopSuspenseyCommitThenable ? (currentSourceFiber.flags |= 16384) : ((returnFiber = currentSourceFiber.updateQueue), @@ -4436,7 +4478,7 @@ function updateForwardRef( for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooks( current, workInProgress, @@ -4636,8 +4678,7 @@ function deferHiddenOffscreenComponent( null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -4652,6 +4693,7 @@ function markRef(current, workInProgress) { throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -4675,11 +4717,13 @@ function updateFunctionComponent( nextProps, renderLanes ) { - var context = isContextProvider(Component) - ? previousContext - : contextStackCursor$1.current; - context = getMaskedContext(workInProgress, context); - prepareToReadContext(workInProgress, renderLanes); + if (!disableLegacyContextForFunctionComponents) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor$1.current; + context = getMaskedContext(workInProgress, context); + } + prepareToReadContext(workInProgress); Component = renderWithHooks( current, workInProgress, @@ -4705,7 +4749,8 @@ function replayFunctionComponent( secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4733,7 +4778,7 @@ function updateClassComponent( var hasContext = !0; pushContextProvider(workInProgress); } else hasContext = !1; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -4862,8 +4907,7 @@ function updateClassComponent( unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -4885,8 +4929,7 @@ function updateClassComponent( newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -4957,7 +5000,7 @@ function finishClassComponent( ) ); shouldUpdate = workInProgress.stateNode; - current = workInProgress; + disableStringRefs || (current = workInProgress); var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null @@ -5100,46 +5143,47 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = createFiberFromOffscreen( - { mode: "visible", children: nextProps.children }, - showFallback, - 0, - null - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = createFiberFromOffscreen( + { mode: "visible", children: nextProps.children }, + showFallback, + 0, + null + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2())) (JSCompiler_temp = shim$2().digest), (nextProps = Error(formatProdErrorMessage(419))), @@ -5155,8 +5199,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges(current, workInProgress, renderLanes, !1), (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), didReceiveUpdate || JSCompiler_temp) @@ -5305,14 +5348,16 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { retryQueue: null }) : currentFallbackChildFragment === primaryChildProps - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== primaryChildProps ? primaryChildProps.retryQueue : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)))); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== primaryChildProps + ? primaryChildProps.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)))); nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, JSCompiler_temp, @@ -5525,7 +5570,7 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { null !== current && (workInProgress.dependencies = current.dependencies); workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -5553,12 +5598,9 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -5617,8 +5659,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( case 19: var didSuspendBefore = 0 !== (current.flags & 128); state = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !state && + state || (propagateParentContextChanges( current, workInProgress, @@ -5748,7 +5789,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - throw Error(formatProdErrorMessage(306, current, "")); + workInProgress = getComponentNameFromType(current) || current; + throw Error(formatProdErrorMessage(306, workInProgress, "")); } } return workInProgress; @@ -5800,7 +5842,12 @@ function beginWork(current, workInProgress, renderLanes) { var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== elementType.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); elementType = nextProps.element; elementType === props @@ -5835,16 +5882,7 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = elementType), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== elementType && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = elementType)), markRef(current, workInProgress), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5918,44 +5956,25 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.child ); case 10: - a: { - props = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - elementType = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = elementType.value; - pushProvider(workInProgress, props, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if ( - nextProps.children === elementType.children && - !didPerformWorkStackCursor.current - ) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren( - current, + return ( + (props = workInProgress.pendingProps), + pushProvider( workInProgress, - elementType.children, - renderLanes - ); - workInProgress = workInProgress.child; - } - return workInProgress; + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context, + props.value + ), + reconcileChildren(current, workInProgress, props.children, renderLanes), + workInProgress.child + ); case 9: return ( (elementType = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (elementType = readContext(elementType)), (props = props(elementType)), (workInProgress.flags |= 1), @@ -6001,7 +6020,7 @@ function beginWork(current, workInProgress, renderLanes) { isContextProvider(props) ? ((current = !0), pushContextProvider(workInProgress)) : (current = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); constructClassInstance(workInProgress, props, elementType); mountClassInstance(workInProgress, props, elementType, renderLanes); return finishClassComponent( @@ -6044,7 +6063,7 @@ function beginWork(current, workInProgress, renderLanes) { return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (props = readContext(CacheContext)), null === current ? ((elementType = peekCacheFromPool()), @@ -6079,10 +6098,11 @@ function beginWork(current, workInProgress, renderLanes) { : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== elementType.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -6159,133 +6179,73 @@ function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { parent = parent.return; } } -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} function propagateContextChanges( workInProgress, contexts, renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + var select = dependency.select; + if ( + null != select && + null != dependency.lastSelectedValue && + !checkIfSelectedContextValuesChanged( + dependency.lastSelectedValue, + select(dependency.context._currentValue2) + ) + ) + continue b; + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; } - nextFiber = nextFiber.return; + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - fiber = nextFiber; - } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -6294,83 +6254,92 @@ function propagateParentContextChanges( renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; +} +function checkIfSelectedContextValuesChanged( + oldComparedValue, + newComparedValue +) { + if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { + if (oldComparedValue.length !== newComparedValue.length) return !0; + for (var i = 0; i < oldComparedValue.length; i++) + if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; + } else throw Error(formatProdErrorMessage(541)); + return !1; } function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } -function prepareToReadContext(workInProgress, renderLanes) { +function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { return readContextForConsumer(currentlyRenderingFiber, context); } -function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -6383,7 +6352,7 @@ function readContextForConsumer(consumer, context) { if (null === consumer) throw Error(formatProdErrorMessage(308)); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -6458,8 +6427,11 @@ function pushTransition( (null === transitionStack.current ? push(transitionStack, newTransitions) : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); + ? push(transitionStack, transitionStack.current) + : push( + transitionStack, + transitionStack.current.concat(newTransitions) + )); } function popTransition(workInProgress, current) { null !== current && @@ -6561,7 +6533,11 @@ function DO_NOT_USE_queryFirstNode(fn) { : null; } function containsNode() { - throw Error(formatProdErrorMessage(248)); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = shim$1(); @@ -6573,12 +6549,13 @@ function getChildContextValues(context) { return childContextValues; } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + enableSiblingPrerendering && + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { switch (renderState.tailMode) { @@ -6594,14 +6571,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$100 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$100 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$100 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$100.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6611,19 +6588,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags & 31457280), - (subtreeFlags |= child$101.flags & 31457280), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (var child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags & 31457280), + (subtreeFlags |= child$102.flags & 31457280), + (child$102.return = completedWork), + (child$102 = child$102.sibling); else - for (child$101 = completedWork.child; null !== child$101; ) - (newChildLanes |= child$101.lanes | child$101.childLanes), - (subtreeFlags |= child$101.subtreeFlags), - (subtreeFlags |= child$101.flags), - (child$101.return = completedWork), - (child$101 = child$101.sibling); + for (child$102 = completedWork.child; null !== child$102; ) + (newChildLanes |= child$102.lanes | child$102.childLanes), + (subtreeFlags |= child$102.subtreeFlags), + (subtreeFlags |= child$102.flags), + (child$102.return = completedWork), + (child$102 = child$102.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6802,11 +6779,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$105 = null; + var cache$106 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$105 = newProps.memoizedState.cachePool.pool); - cache$105 !== instance && (newProps.flags |= 2048); + (cache$106 = newProps.memoizedState.cachePool.pool); + cache$106 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6839,8 +6816,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$105 = instance.rendering; - if (null === cache$105) + cache$106 = instance.rendering; + if (null === cache$106) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6848,11 +6825,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$105 = findFirstSuspended(current); - if (null !== cache$105) { + cache$106 = findFirstSuspended(current); + if (null !== cache$106) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$105.updateQueue; + current = cache$106.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6877,7 +6854,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$105)), null !== current)) { + if (((current = findFirstSuspended(cache$106)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6887,7 +6864,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$105.alternate) + !cache$106.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6899,13 +6876,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$105.sibling = workInProgress.child), - (workInProgress.child = cache$105)) + ? ((cache$106.sibling = workInProgress.child), + (workInProgress.child = cache$106)) : ((current = instance.last), null !== current - ? (current.sibling = cache$105) - : (workInProgress.child = cache$105), - (instance.last = cache$105)); + ? (current.sibling = cache$106) + : (workInProgress.child = cache$106), + (instance.last = cache$106)); } if (null !== instance.tail) return ( @@ -7126,18 +7103,92 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; -function callComponentWillUnmountWithTimer(current, instance) { +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 commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor$jscomp$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; + if (void 0 !== destroy) { + inst.destroy = void 0; + lastEffect = finishedWork; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + try { + destroy(); + } catch (error) { + captureCommitPhaseError( + lastEffect, + nearestMountedAncestor, + error + ); + } + } + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } 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 safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance +) { instance.props = resolveClassComponentProps( current.type, current.memoizedProps, current.elementType === current.type ); instance.state = current.memoizedState; - instance.componentWillUnmount(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -7179,19 +7230,91 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$123) { - captureCommitPhaseError(current, nearestMountedAncestor, error$123); + } catch (error$125) { + captureCommitPhaseError(current, nearestMountedAncestor, error$125); } else ref.current = null; } -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { +function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration +) { try { - destroy(); + var _finishedWork$memoize2 = finishedWork.memoizedProps, + id = _finishedWork$memoize2.id, + onPostCommit = _finishedWork$memoize2.onPostCommit; + "function" === typeof onPostCommit && + onPostCommit( + id, + null === current ? "mount" : "update", + passiveEffectDuration, + commitStartTime + ); } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return 5 === fiber.tag || 3 === 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 && 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; } } -var focusedInstanceHandle = null, +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; @@ -7208,81 +7331,85 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { root = nextEffect; - try { - var current = root.alternate, - flags = root.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === root.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = root.memoizedState; - JSCompiler_temp = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(root, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - switch (root.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = root.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for ( - firstChild = 0; - firstChild < eventPayloads.length; - firstChild++ - ) { - var _eventPayloads$ii = eventPayloads[firstChild]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } + firstChild = root.alternate; + i = root.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === root.tag)) + a: { + if ( + null !== firstChild && + ((JSCompiler_temp = firstChild.memoizedState), + null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = root.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = root.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - root.type, - current.memoizedProps, - root.elementType === root.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(root, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (root.tag) { + case 0: + if ( + 0 !== (i & 4) && + ((firstChild = root.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (JSCompiler_temp = firstChild[i]), + (JSCompiler_temp.ref.impl = JSCompiler_temp.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (i & 1024) && null !== firstChild) { + i = void 0; + JSCompiler_temp = root; + var prevProps = firstChild.memoizedProps; + firstChild = firstChild.memoizedState; + var instance = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + prevProps, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + firstChild + ); + instance.__reactInternalSnapshotBeforeUpdate = i; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 3: - 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(root, root.return, error); + } + break; + case 3: + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (i & 1024)) throw Error(formatProdErrorMessage(163)); } firstChild = root.sibling; if (null !== firstChild) { @@ -7293,65 +7420,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - 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 create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; - } - 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); - } - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7360,7 +7432,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); @@ -7661,60 +7733,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return 5 === fiber.tag || 3 === 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 && 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) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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( @@ -7752,21 +7770,46 @@ function commitDeletionEffectsOnFiber( ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); + if (null !== hostParent) + if (hostParentIsContainer) + try { + var child = deletedFiber.stateNode; + destroyEventListeners(child); + child.eject(); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + var child$jscomp$0 = deletedFiber.stateNode; + destroyEventListeners(child$jscomp$0); + child$jscomp$0.eject(); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && shim$2(); break; case 4: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + child = hostParent; + child$jscomp$0 = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = !0; recursivelyTraverseDeletionEffects( @@ -7774,43 +7817,18 @@ function commitDeletionEffectsOnFiber( nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; + hostParent = child; + hostParentIsContainer = child$jscomp$0; break; case 0: case 11: case 14: case 15: - if ( - !offscreenSubtreeWasHidden && - ((prevHostParent = deletedFiber.updateQueue), - null !== prevHostParent && - ((prevHostParent = prevHostParent.lastEffect), - null !== prevHostParent)) - ) { - prevHostParentIsContainer = prevHostParent = prevHostParent.next; - do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - (0 !== (tag & 2) - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : 0 !== (tag & 4) && - ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ))); - prevHostParentIsContainer = prevHostParentIsContainer.next; - } while (prevHostParentIsContainer !== prevHostParent); - } + (!enableHiddenSubtreeInsertionEffectCleanup && + offscreenSubtreeWasHidden) || + commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor); + offscreenSubtreeWasHidden || + commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7818,17 +7836,15 @@ function commitDeletionEffectsOnFiber( ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); - } + (child = deletedFiber.stateNode), + "function" === typeof child.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + child + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7847,14 +7863,14 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); disableLegacyMode || deletedFiber.mode & 1 ? ((offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || + (child = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState), recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ), - (offscreenSubtreeWasHidden = prevHostParent)) + (offscreenSubtreeWasHidden = child)) : recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7921,39 +7937,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; ) @@ -7970,19 +7982,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$132) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$132); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -7990,15 +7993,19 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - flags & 64 && + if ( + flags & 64 && offscreenSubtreeIsHidden && ((finishedWork = finishedWork.updateQueue), null !== finishedWork && - ((flags = finishedWork.callbacks), - null !== flags && - ((current = finishedWork.shared.hiddenCallbacks), - (finishedWork.shared.hiddenCallbacks = - null === current ? flags : current.concat(flags))))); + ((flags = finishedWork.callbacks), null !== flags)) + ) { + var existingHiddenCallbacks = finishedWork.shared.hiddenCallbacks; + finishedWork.shared.hiddenCallbacks = + null === existingHiddenCallbacks + ? flags + : existingHiddenCallbacks.concat(flags); + } break; case 26: case 27: @@ -8008,13 +8015,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; + if (flags & 4 && null != finishedWork.stateNode) { + flags = finishedWork.memoizedProps; + existingHiddenCallbacks = + null !== current ? current.memoizedProps : flags; try { - flags._applyProps(flags, newProps, current); - } catch (error$135) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$135); + var instance = finishedWork.stateNode; + instance._applyProps(instance, flags, existingHiddenCallbacks); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -8032,15 +8041,24 @@ function commitMutationEffectsOnFiber(finishedWork, root) { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; + case 12: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; case 13: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((newProps = null !== finishedWork.memoizedState), - (current = null !== current && null !== current.memoizedState), + if (finishedWork.child.flags & 8192) { + existingHiddenCallbacks = null !== finishedWork.memoizedState; + var wasShowingFallback = + null !== current && null !== current.memoizedState; alwaysThrottleRetries - ? newProps !== current && (globalMostRecentFallbackTime = now()) - : newProps && !current && (globalMostRecentFallbackTime = now())); + ? existingHiddenCallbacks !== wasShowingFallback && + (globalMostRecentFallbackTime = now()) + : existingHiddenCallbacks && + !wasShowingFallback && + (globalMostRecentFallbackTime = now()); + } if (flags & 4) { try { if (null !== finishedWork.memoizedState) { @@ -8050,8 +8068,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$137) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$137); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -8063,17 +8081,17 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - suspenseCallback = null !== finishedWork.memoizedState; - retryQueue = null !== current && null !== current.memoizedState; + instance = null !== finishedWork.memoizedState; + suspenseCallback = null !== current && null !== current.memoizedState; if (disableLegacyMode || finishedWork.mode & 1) { - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; + retryQueue = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = retryQueue || instance; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || suspenseCallback; recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = retryQueue; } else recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; @@ -8082,13 +8100,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = suspenseCallback + ((root._visibility = instance ? root._visibility & -2 : root._visibility | 1), - suspenseCallback && + instance && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - retryQueue || + suspenseCallback || root || ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), @@ -8098,19 +8116,19 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - current = root; + suspenseCallback = current = root; try { - if (((newProps = root.stateNode), suspenseCallback)) - newProps.hide(); - else { - var props = root.memoizedProps; - (null == props.visible || props.visible) && - root.stateNode.show(); - } + (existingHiddenCallbacks = suspenseCallback.stateNode), + instance + ? existingHiddenCallbacks.hide() + : ((wasShowingFallback = suspenseCallback.memoizedProps), + (null == wasShowingFallback.visible || + wasShowingFallback.visible) && + suspenseCallback.stateNode.show()); } catch (error) { captureCommitPhaseError( - finishedWork, - finishedWork.return, + suspenseCallback, + suspenseCallback.return, error ); } @@ -8139,10 +8157,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 4 && ((flags = finishedWork.updateQueue), null !== flags && - ((current = flags.retryQueue), - null !== current && + ((existingHiddenCallbacks = flags.retryQueue), + null !== existingHiddenCallbacks && ((flags.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, current)))); + attachSuspenseRetryListeners( + finishedWork, + existingHiddenCallbacks + )))); break; case 19: recursivelyTraverseMutationEffects(root, finishedWork); @@ -8191,12 +8212,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$127 = JSCompiler_inline_result.stateNode.containerInfo, - before$128 = getHostSibling(finishedWork); + var parent$126 = JSCompiler_inline_result.stateNode.containerInfo, + before$127 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$128, - parent$127 + before$127, + parent$126 ); break; default: @@ -8229,15 +8250,12 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(current, instance); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -8277,7 +8295,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8285,23 +8303,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - var instance = finishedWork.stateNode; + finishedRoot = finishedWork; + var instance = finishedRoot.stateNode; if ("function" === typeof instance.componentDidMount) try { instance.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(finishedRoot, finishedRoot.return, error); + } + finishedRoot = finishedWork; + instance = finishedRoot.updateQueue; + if (null !== instance) { + var instance$jscomp$0 = finishedRoot.stateNode; + try { + var hiddenCallbacks = instance.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + instance.shared.hiddenCallbacks = null, instance = 0; + instance < hiddenCallbacks.length; + instance++ + ) + callCallback(hiddenCallbacks[instance], instance$jscomp$0); + } catch (error) { + captureCommitPhaseError(finishedRoot, finishedRoot.return, error); } - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], instance); } includeWorkInProgressEffects && flags & 64 && @@ -8351,13 +8376,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, instance) { var previousCache = null; null !== current && @@ -8461,7 +8479,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -8524,6 +8542,27 @@ function commitPassiveMountOnFiber( } } break; + case 12: + flags & 2048 + ? (recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ), + commitProfilerPostCommit( + finishedWork, + finishedWork.alternate, + -0, + finishedWork.stateNode.passiveEffectDuration + )) + : recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -8549,29 +8588,32 @@ function commitPassiveMountOnFiber( committedTransitions ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((nextCache._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : nextCache._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -8635,7 +8677,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -8654,9 +8696,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$147 = finishedWork.stateNode; + var instance$140 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$147._visibility & 4 + ? instance$140._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8665,19 +8707,19 @@ function recursivelyTraverseReconnectPassiveEffects( includeWorkInProgressEffects ) : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork - ) - : ((instance$147._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((instance$147._visibility |= 4), + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((instance$140._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((instance$140._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8690,7 +8732,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$147 + instance$140 ); break; case 24: @@ -8784,12 +8826,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$152 = fiber.alternate; - null !== current$152 && null !== current$152.memoizedState - ? ((current$152 = suspenseyCommitFlag), + var current$145 = fiber.alternate; + null !== current$145 && null !== current$145.memoizedState + ? ((current$145 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$152)) + (suspenseyCommitFlag = current$145)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8839,6 +8881,12 @@ function commitPassiveUnmountOnFiber(finishedWork) { finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return); break; + case 3: + recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + case 12: + recursivelyTraversePassiveUnmountEffects(finishedWork); + break; case 22: var instance = finishedWork.stateNode; null !== finishedWork.memoizedState && @@ -8987,25 +9035,28 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - }, - getOwner: function () { - return current; - } - }, - PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } +}; +disableStringRefs || + (DefaultAsyncDispatcher.getOwner = function () { + return current; + }); +var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -9013,6 +9064,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -9097,9 +9149,9 @@ function requestUpdateLane(fiber) { ? 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes : null !== ReactSharedInternals.T - ? ((fiber = currentEntangledLane), - 0 !== fiber ? fiber : requestTransitionLane()) - : currentUpdatePriority || 32 + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : currentUpdatePriority || 32 : 2; } function requestDeferredLane() { @@ -9121,7 +9173,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -9148,7 +9201,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )); ensureRootIsScheduled(root); 2 !== lane || @@ -9156,67 +9210,93 @@ function scheduleUpdateOnFiber(root, fiber, lane) { disableLegacyMode || 0 !== (fiber.mode & 1) || ((workInProgressRootRenderTargetTime = now() + 500), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } -function performConcurrentWorkOnRoot(root, didTimeout) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); + var exitStatus = (forceSync = + !forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes); if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; + var renderWasConcurrent = forceSync; do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); + if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { - didTimeout = root.current.alternate; + forceSync = root$jscomp$0.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) + !isRenderConsistentWithExternalStores(forceSync) ) { - exitStatus = renderRootSync(root, lanes); + exitStatus = renderRootSync(root$jscomp$0, lanes); renderWasConcurrent = !1; continue; } - if (2 === exitStatus) { + if ( + (disableLegacyMode || 0 !== root$jscomp$0.tag) && + 2 === exitStatus + ) { renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = + root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + JSCompiler_inline_result = renderRootSync( + root, + JSCompiler_inline_result + ); + if (2 !== JSCompiler_inline_result) { + if (workInProgressRootDidAttachPingListener) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; + break a; + } + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; + } + renderWasConcurrent = !1; + if (2 !== exitStatus) continue; + } } if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; a: { - renderWasConcurrent = root; + renderWasConcurrent = root$jscomp$0; switch (exitStatus) { case 0: case 1: @@ -9226,7 +9306,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -9240,6 +9321,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === exitStatus) && @@ -9249,19 +9332,26 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, renderWasConcurrent, - didTimeout, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 ), exitStatus ); @@ -9269,45 +9359,25 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } commitRootWhenReady( renderWasConcurrent, - didTimeout, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 ); } } break; } while (1); } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -9324,41 +9394,61 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { lanes = finishedWork.subtreeFlags; (lanes & 8192 || 16785408 === (lanes & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); + finishedWork = ReactSharedInternals.T; + lanes = currentUpdatePriority; + try { + (currentUpdatePriority = 2), + (ReactSharedInternals.T = null), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ); + } finally { + (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); + } } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -9374,77 +9464,39 @@ 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)); enableInfiniteRenderLoopDetection && (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; - - ) { + enableSiblingPrerendering && + !didSkipSuspendedSiblings && + (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index$6 = 31 - clz32(lanes), lane = 1 << index$6; - expirationTimes[index$6] = -1; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - var exitStatus = renderRootSync(root, lanes); - if ((disableLegacyMode || 0 !== root.tag) && 2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -9479,8 +9531,13 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -9489,7 +9546,7 @@ function prepareFreshStack(root, lanes) { workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -9509,23 +9566,31 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); - var handler = suspenseHandlerStackCursor.current; + var JSCompiler_temp; + if ((JSCompiler_temp = !enableSiblingPrerendering)) + (JSCompiler_temp = suspenseHandlerStackCursor.current), + (JSCompiler_temp = + null === JSCompiler_temp + ? !0 + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? JSCompiler_temp === shellBoundary + : !1); workInProgressSuspendedReason = - (null !== handler && - ((workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - handler !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 3 - : 2; + JSCompiler_temp && + 0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? 2 + : 3; } else thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), @@ -9534,10 +9599,10 @@ function handleThrow(root, thrownValue) { thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); workInProgressThrownValue = thrownValue; null === workInProgress && ((workInProgressRootExitStatus = 1), @@ -9558,13 +9623,17 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + 0 !== (workInProgressRootRenderLanes & 60) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -9592,15 +9661,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$158) { - handleThrow(root, thrownValue$158); + } catch (thrownValue$151) { + handleThrow(root, thrownValue$151); } while (1); lanes && root.shellSuspendCounter++; @@ -9622,10 +9692,16 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes + ? ((workInProgressTransitions = getTransitionsForLanes(root, lanes)), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); + prepareFreshStack(root, lanes)) + : workInProgressRootIsPrerendering && + (workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes)); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9635,7 +9711,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: var thenable = thrownValue; @@ -9666,7 +9742,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: thenable = null; @@ -9692,12 +9768,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); break; case 8: resetWorkInProgressStack(); @@ -9709,8 +9785,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$160) { - handleThrow(root, thrownValue$160); + } catch (thrownValue$153) { + handleThrow(root, thrownValue$153); } while (1); resetContextDependencies(); @@ -9729,7 +9805,7 @@ function workLoopConcurrent() { } function performUnitOfWork(unitOfWork) { var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -9782,11 +9858,16 @@ function replaySuspendedUnitOfWork(unitOfWork) { resetWorkInProgress(next, entangledRenderLanes)), (next = beginWork(current$jscomp$0, next, entangledRenderLanes)); } - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } -function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { +function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason +) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); thenableState$1 = null; @@ -9820,31 +9901,40 @@ 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); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (1 === suspendedReason) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else { + if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + 2 === suspendedReason || + 3 === suspendedReason || + 6 === suspendedReason) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + } + else root = !0; + unwindUnitOfWork(unitOfWork, root); + } else 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, @@ -9864,31 +9954,28 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - return null; +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 commitRootImpl( root, @@ -9896,7 +9983,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -9912,7 +10001,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -9924,26 +10020,26 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = currentUpdatePriority), + (currentUpdatePriority = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffectsOnFiber(finishedWork, root), + (root.current = finishedWork), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + requestPaint(), + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -9974,7 +10070,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); return null; } function releaseRootPooledCache(root, remainingLanes) { @@ -9983,7 +10079,7 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -9995,7 +10091,7 @@ function flushPassiveEffects() { return ( (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -10019,7 +10115,7 @@ function flushPassiveEffectsImpl() { commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -10108,6 +10204,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -10121,7 +10218,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -10200,9 +10299,39 @@ function FiberNode(tag, pendingProps, key, mode) { this.childLanes = this.lanes = 0; this.alternate = null; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -10493,6 +10622,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -10574,9 +10704,6 @@ function updateContainerSync(element, container, parentComponent, callback) { entangleTransitions(element, current, 2)); return 2; } -function emptyFindFiberByHostInstance() { - return null; -} Mode$1.setCurrent(FastNoSideEffects); var slice = Array.prototype.slice, LinearGradient = (function () { @@ -10705,56 +10832,28 @@ var slice = Array.prototype.slice, ); }; return Text; - })(React.Component), - devToolsConfig$jscomp$inline_1174 = { - findFiberByHostInstance: function () { - return null; - }, - bundleType: 0, - version: "19.0.0-www-classic-e02baf6c92-20240627", - rendererPackageName: "react-art" - }; -var internals$jscomp$inline_1386 = { - bundleType: devToolsConfig$jscomp$inline_1174.bundleType, - version: devToolsConfig$jscomp$inline_1174.version, - rendererPackageName: devToolsConfig$jscomp$inline_1174.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1174.rendererConfig, - overrideHookState: null, - overrideHookStateDeletePath: null, - overrideHookStateRenamePath: null, - overrideProps: null, - overridePropsDeletePath: null, - overridePropsRenamePath: null, - setErrorHandler: null, - setSuspenseHandler: null, - scheduleUpdate: null, + })(React.Component); +var internals$jscomp$inline_1467 = { + bundleType: 0, + version: "19.0.0-www-classic-13411e45-20241014", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: function (fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; + findFiberByHostInstance: function () { + return null; }, - findFiberByHostInstance: - devToolsConfig$jscomp$inline_1174.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: null, - scheduleRefresh: null, - scheduleRoot: null, - setRefreshHandler: null, - getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-e02baf6c92-20240627" + reconcilerVersion: "19.0.0-www-classic-13411e45-20241014" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1468 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1387.isDisabled && - hook$jscomp$inline_1387.supportsFiber + !hook$jscomp$inline_1468.isDisabled && + hook$jscomp$inline_1468.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1387.inject( - internals$jscomp$inline_1386 + (rendererID = hook$jscomp$inline_1468.inject( + internals$jscomp$inline_1467 )), - (injectedHook = hook$jscomp$inline_1387); + (injectedHook = hook$jscomp$inline_1468); } catch (err) {} } var Path = Mode$1.Path; @@ -10768,3 +10867,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; +exports.version = "19.0.0-www-classic-13411e45-20241014"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index d7d2631c808c5..62770475d546a 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -60,30 +60,31 @@ function formatProdErrorMessage(code) { ); } var dynamicFeatureFlags = require("ReactFeatureFlags"), + alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, + disableDefaultPropsExceptForClasses = + dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableSchedulerTimeoutInWorkLoop = + dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, - enableLazyContextPropagation = - dynamicFeatureFlags.enableLazyContextPropagation, - enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, - enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, - alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, - disableSchedulerTimeoutInWorkLoop = - dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, - enableUseDeferredValueInitialArg = - dynamicFeatureFlags.enableUseDeferredValueInitialArg, - retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, - syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, - transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, - enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, - disableDefaultPropsExceptForClasses = - dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, + enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, + enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, + enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, + enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, + retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, + syncLaneExpirationMs = dynamicFeatureFlags.syncLaneExpirationMs, + transitionLaneExpirationMs = dynamicFeatureFlags.transitionLaneExpirationMs, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = renameElementSymbol ? Symbol.for("react.transitional.element") @@ -114,10 +115,70 @@ function getIteratorFn(maybeIterable) { maybeIterable["@@iterator"]; return "function" === typeof maybeIterable ? maybeIterable : null; } -Symbol.for("react.client.reference"); +var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, - prefix; + prefix, + suffix; function describeBuiltInComponentFrame(name) { if (void 0 === prefix) try { @@ -125,8 +186,14 @@ function describeBuiltInComponentFrame(name) { } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } var reentry = !1; function describeNativeComponentFrame(fn, construct) { @@ -298,102 +365,6 @@ function getStackByFiberInDevAndProd(workInProgress) { } } var current = null; -function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$3 = parentA.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) { - for (child$3 = parentB.child; child$3; ) { - if (child$3 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$3 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$3 = child$3.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} function isFiberSuspenseAndTimedOut(fiber) { var memoizedState = fiber.memoizedState; return ( @@ -434,8 +405,8 @@ function childrenAsString(children) { ? "string" === typeof children ? children : children.length - ? children.join("") - : "" + ? children.join("") + : "" : ""; } var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, @@ -535,30 +506,44 @@ 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, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; 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)) + : enableSiblingPrerendering && + !root && + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : enableSiblingPrerendering && + !root && + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (32 === suspendedLanes && 0 !== (root & 4194176))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { @@ -603,14 +588,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} -function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60); -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -627,25 +604,34 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; +function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes +) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index$7 = 31 - clz32(noLongerPendingLanes), + var index$7 = 31 - clz32(remainingLanes), lane = 1 << index$7; - remainingLanes[index$7] = 0; + entanglements[index$7] = 0; expirationTimes[index$7] = -1; var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) @@ -657,9 +643,15 @@ function markRootFinished(root, remainingLanes, spawnedLane) { var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + enableSiblingPrerendering && + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -859,12 +851,12 @@ function applyTextProps(instance, props) { JSCompiler_temp === newFont ? !0 : "string" === typeof newFont || "string" === typeof JSCompiler_temp - ? !1 - : newFont.fontSize === JSCompiler_temp.fontSize && - newFont.fontStyle === JSCompiler_temp.fontStyle && - newFont.fontVariant === JSCompiler_temp.fontVariant && - newFont.fontWeight === JSCompiler_temp.fontWeight && - newFont.fontFamily === JSCompiler_temp.fontFamily; + ? !1 + : newFont.fontSize === JSCompiler_temp.fontSize && + newFont.fontStyle === JSCompiler_temp.fontStyle && + newFont.fontVariant === JSCompiler_temp.fontVariant && + newFont.fontWeight === JSCompiler_temp.fontWeight && + newFont.fontFamily === JSCompiler_temp.fontFamily; JSCompiler_temp = !JSCompiler_temp; } if ( @@ -883,6 +875,14 @@ function shouldSetTextContent(type, props) { ); } var currentUpdatePriority = 0, + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }, valueStack = [], index = -1; function createCursor(defaultValue) { @@ -915,15 +915,7 @@ function createCapturedValueAtFiber(value, source) { var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; + hostTransitionProviderCursor = createCursor(null); function pushHostContainer(fiber, nextRootInstance) { push(rootInstanceStackCursor, nextRootInstance); push(contextFiberStackCursor, fiber); @@ -1047,22 +1039,42 @@ function ensureRootIsScheduled(root) { enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } -function flushSyncWorkAcrossRoots_impl(onlyLegacy) { +function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy) { - var workInProgressRootRenderLanes$13 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$13 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$13 : 0 - ); - 0 !== (workInProgressRootRenderLanes$13 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$13)); - } + if (!onlyLegacy) + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + JSCompiler_inline_result = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + JSCompiler_inline_result &= + pendingLanes & ~(suspendedLanes & ~pingedLanes); + JSCompiler_inline_result = + JSCompiler_inline_result & 201326677 + ? (JSCompiler_inline_result & 201326677) | 1 + : JSCompiler_inline_result + ? JSCompiler_inline_result | 2 + : 0; + } + 0 !== JSCompiler_inline_result && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root, + root === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 !== (JSCompiler_inline_result & 3) && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); root = root.next; } } while (didPerformSomeWork); @@ -1071,6 +1083,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now(), prev = null, root = firstScheduledRoot; null !== root; @@ -1086,8 +1099,7 @@ function processRootScheduleInMicrotask() { 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -1157,12 +1169,36 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + !disableSchedulerTimeoutInWorkLoop && didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} function requestTransitionLane() { 0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane()); @@ -1191,8 +1227,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -1351,20 +1387,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$15 = workInProgress$jscomp$0.alternate; - null !== current$15 && - ((current$15 = current$15.updateQueue), - (pendingQueue = current$15.lastBaseUpdate), + var current$16 = workInProgress$jscomp$0.alternate; + null !== current$16 && + ((current$16 = current$16.updateQueue), + (pendingQueue = current$16.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$15.firstBaseUpdate = firstPendingUpdate) + ? (current$16.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$15.lastBaseUpdate = lastPendingUpdate))); + (current$16.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$15 = firstPendingUpdate = lastPendingUpdate = null; + current$16 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1377,8 +1413,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$15 && - (current$15 = current$15.next = + null !== current$16 && + (current$16 = current$16.next = { lane: 0, tag: pendingQueue.tag, @@ -1431,10 +1467,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$15 - ? ((firstPendingUpdate = current$15 = isHiddenUpdate), + null === current$16 + ? ((firstPendingUpdate = current$16 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$15 = current$15.next = isHiddenUpdate), + : (current$16 = current$16.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1447,10 +1483,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$15 && (lastPendingUpdate = newState); + null === current$16 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$15; + queue.lastBaseUpdate = current$16; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -1782,7 +1818,7 @@ function createChildReconciler(shouldTrackSideEffects) { if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -1831,7 +1867,7 @@ function createChildReconciler(shouldTrackSideEffects) { return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -1901,7 +1937,7 @@ function createChildReconciler(shouldTrackSideEffects) { existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2225,7 +2261,7 @@ function createChildReconciler(shouldTrackSideEffects) { return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -2304,8 +2340,8 @@ function pushPrimaryTreeSuspenseHandler(handler) { ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler) - : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); + ? push(suspenseHandlerStackCursor, handler) + : push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -2314,9 +2350,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$44 = fiber.alternate; - null !== current$44 && - null !== current$44.memoizedState && + var current$45 = fiber.alternate; + null !== current$45 && + null !== current$45.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2412,9 +2448,8 @@ function finishRenderingHooks(current) { thenableIndexCounter = 0; thenableState = null; if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -2430,9 +2465,15 @@ function renderWithHooksAgain(workInProgress, Component, props, secondArg) { if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); numberOfReRenders += 1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } ReactSharedInternals.H = HooksDispatcherOnRerender; - var children = Component(props, secondArg); + children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -2519,6 +2560,31 @@ function updateWorkInProgressHook() { } return workInProgressHook; } +function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue2; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + null === lastContextDependency) + ) { + if (null === JSCompiler_temp) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; +} var createFunctionComponentUpdateQueue; createFunctionComponentUpdateQueue = function () { return { lastEffect: null, events: null, stores: null, memoCache: null }; @@ -2552,16 +2618,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$46 = currentlyRenderingFiber$1.alternate; - null !== current$46 && - ((current$46 = current$46.updateQueue), - null !== current$46 && - ((current$46 = current$46.memoCache), - null != current$46 && + var current$47 = currentlyRenderingFiber$1.alternate; + null !== current$47 && + ((current$47 = current$47.updateQueue), + null !== current$47 && + ((current$47 = current$47.memoCache), + null != current$47 && (memoCache = { data: enableNoCloningMemoCache - ? current$46.data - : current$46.data.map(function (array) { + ? current$47.data + : current$47.data.map(function (array) { return array.slice(); }), index: 0 @@ -2576,11 +2642,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$46 = 0; - current$46 < size; - current$46++ + current$47 = 0; + current$47 < size; + current$47++ ) - updateQueue[current$46] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$47] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2613,7 +2679,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$47 = !1; + didReadFromEntangledAsyncAction$48 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2634,11 +2700,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$48 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$47 = !0); + (didReadFromEntangledAsyncAction$48 = !0); continue; } else (updateLane = { @@ -2684,7 +2750,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$47 && + didReadFromEntangledAsyncAction$48 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2742,9 +2808,8 @@ function updateSyncExternalStore(subscribe, getSnapshot) { { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(subscribe, renderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } return nextSnapshot; @@ -2872,8 +2937,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$51) { - onActionError(actionQueue, node, error$51); + } catch (error$52) { + onActionError(actionQueue, node, error$52); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3016,17 +3081,16 @@ function rerenderActionState(action) { function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function updateRef() { @@ -3133,15 +3197,13 @@ function updateMemo(nextCreate, deps) { return prevState; } function mountDeferredValueImpl(hook, value, initialValue) { - return enableUseDeferredValueInitialArg && - void 0 !== initialValue && - 0 === (renderLanes & 1073741824) - ? ((hook.memoizedState = initialValue), - (hook = requestDeferredLane()), - (currentlyRenderingFiber$1.lanes |= hook), - (workInProgressRootSkippedLanes |= hook), - initialValue) - : (hook.memoizedState = value); + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber$1.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (objectIs(value, prevValue)) return value; @@ -3192,22 +3254,33 @@ function startTransition( returnValue, finishedState ); - dispatchSetState(fiber, queue, thenableForFinishedState); - } else dispatchSetState(fiber, queue, finishedState); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); } catch (error) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition); } } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : null; + return readContext(HostTransitionContext); } function updateId() { return updateWorkInProgressHook().memoizedState; @@ -3255,15 +3328,18 @@ function dispatchReducerAction(fiber, queue, action) { entangleTransitionUpdate(action, queue, lane))); } function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(), - update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); else { var alternate = fiber.alternate; @@ -3277,19 +3353,24 @@ function dispatchSetState(fiber, queue, action) { eagerState = alternate(currentState, action); update.hasEagerState = !0; update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) { - enqueueUpdate$1(fiber, queue, update, 0); - null === workInProgressRoot && finishQueueingConcurrentUpdates(); - return; - } + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 + ); } catch (error) { } finally { } action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane)); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } + return !1; } function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { action = { @@ -3363,6 +3444,7 @@ ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; ContextOnlyDispatcher.useFormState = throwInvalidHookError; ContextOnlyDispatcher.useActionState = throwInvalidHookError; ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; +ContextOnlyDispatcher.unstable_useContextWithBailout = throwInvalidHookError; var HooksDispatcherOnMount = { readContext: readContext, use: use, @@ -3459,20 +3541,19 @@ var HooksDispatcherOnMount = { var fiber = currentlyRenderingFiber$1, hook = mountWorkInProgressHook(); var nextSnapshot = getSnapshot(); - var root = workInProgressRoot; - if (null === root) throw Error(formatProdErrorMessage(349)); - includesBlockingLane(root, workInProgressRootRenderLanes) || + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); hook.memoizedState = nextSnapshot; - root = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = root; - mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [ + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ subscribe ]); fiber.flags |= 2048; pushEffect( 9, - updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), { destroy: void 0 }, null ); @@ -3526,6 +3607,8 @@ HooksDispatcherOnMount.useOptimistic = function (passthrough) { queue.dispatch = hook; return [passthrough, hook]; }; +HooksDispatcherOnMount.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnUpdate = { readContext: readContext, use: use, @@ -3574,6 +3657,8 @@ HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { var hook = updateWorkInProgressHook(); return updateOptimisticImpl(hook, currentHook, passthrough, reducer); }; +HooksDispatcherOnUpdate.unstable_useContextWithBailout = + unstable_useContextWithBailout; var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3627,6 +3712,8 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { hook.baseState = passthrough; return [passthrough, hook.queue.dispatch]; }; +HooksDispatcherOnRerender.unstable_useContextWithBailout = + unstable_useContextWithBailout; function applyDerivedStateFromProps( workInProgress, ctor, @@ -3645,9 +3732,25 @@ function applyDerivedStateFromProps( } var classComponentUpdater = { isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; + component = component._reactInternals; + if (!component) return !1; + var JSCompiler_inline_result; + var nearestMounted = (JSCompiler_inline_result = component); + if (component.alternate) + for (; JSCompiler_inline_result.return; ) + JSCompiler_inline_result = JSCompiler_inline_result.return; + else { + var nextNode = JSCompiler_inline_result; + do + (JSCompiler_inline_result = nextNode), + 0 !== (JSCompiler_inline_result.flags & 4098) && + (nearestMounted = JSCompiler_inline_result.return), + (nextNode = JSCompiler_inline_result.return); + while (nextNode); + } + JSCompiler_inline_result = + 3 === JSCompiler_inline_result.tag ? nearestMounted : null; + return JSCompiler_inline_result === component; }, enqueueSetState: function (inst, payload, callback) { inst = inst._reactInternals; @@ -3697,8 +3800,8 @@ function checkShouldComponentUpdate( return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } function callComponentWillReceiveProps( workInProgress, @@ -3730,9 +3833,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$53 in Component) - void 0 === newProps[propName$53] && - (newProps[propName$53] = Component[propName$53]); + for (var propName$54 in Component) + void 0 === newProps[propName$54] && + (newProps[propName$54] = Component[propName$54]); } return newProps; } @@ -3852,15 +3955,14 @@ function throwException( "object" === typeof value && "function" === typeof value.then ) { - enableLazyContextPropagation && - ((returnFiber = sourceFiber.alternate), - null !== returnFiber && - propagateParentContextChanges( - returnFiber, - sourceFiber, - rootRenderLanes, - !0 - )); + returnFiber = sourceFiber.alternate; + null !== returnFiber && + propagateParentContextChanges( + returnFiber, + sourceFiber, + rootRenderLanes, + !0 + ); returnFiber = suspenseHandlerStackCursor.current; if (null !== returnFiber) { switch (returnFiber.tag) { @@ -4123,7 +4225,7 @@ function updateForwardRef( for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); nextProps = renderWithHooks( current, workInProgress, @@ -4315,8 +4417,7 @@ function deferHiddenOffscreenComponent( null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -4331,6 +4432,7 @@ function markRef(current, workInProgress) { throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -4354,7 +4456,7 @@ function updateFunctionComponent( nextProps, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); Component = renderWithHooks( current, workInProgress, @@ -4380,7 +4482,8 @@ function replayFunctionComponent( secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4404,7 +4507,7 @@ function updateClassComponent( nextProps, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) { var context = emptyContextObject, contextType = Component.contextType; @@ -4569,8 +4672,7 @@ function updateClassComponent( contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies)) ? ("function" === typeof unresolvedOldProps && @@ -4592,8 +4694,7 @@ function updateClassComponent( newState, oldProps ) || - (enableLazyContextPropagation && - null !== current$jscomp$0 && + (null !== current$jscomp$0 && null !== current$jscomp$0.dependencies && checkIfContextChanged(current$jscomp$0.dependencies))) ? (oldContext || @@ -4640,7 +4741,7 @@ function updateClassComponent( nextProps = 0 !== (workInProgress.flags & 128); context || nextProps ? ((context = workInProgress.stateNode), - (current = workInProgress), + disableStringRefs || (current = workInProgress), (Component = nextProps && "function" !== typeof Component.getDerivedStateFromError ? null @@ -4776,43 +4877,44 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (nextPrimaryChildren = nextProps.fallback), - (showFallback = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - showFallback - )), - (nextPrimaryChildren = createFiberFromFragment( - nextPrimaryChildren, - showFallback, - renderLanes, - null - )), - (nextPrimaryChildren.flags |= 2), - (nextProps.return = workInProgress), - (nextPrimaryChildren.return = workInProgress), - (nextProps.sibling = nextPrimaryChildren), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = nextPrimaryChildren)); + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (nextPrimaryChildren = nextProps.fallback), + (showFallback = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + showFallback + )), + (nextPrimaryChildren = createFiberFromFragment( + nextPrimaryChildren, + showFallback, + renderLanes, + null + )), + (nextPrimaryChildren.flags |= 2), + (nextProps.return = workInProgress), + (nextPrimaryChildren.return = workInProgress), + (nextProps.sibling = nextPrimaryChildren), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = nextPrimaryChildren)); else if ((pushPrimaryTreeSuspenseHandler(workInProgress), shim$2())) (JSCompiler_temp = shim$2().digest), (nextProps = Error(formatProdErrorMessage(419))), @@ -4828,8 +4930,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { renderLanes )); else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges(current, workInProgress, renderLanes, !1), (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), didReceiveUpdate || JSCompiler_temp) @@ -4973,16 +5074,16 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { retryQueue: null }) : currentFallbackChildFragment === currentOffscreenQueue - ? (nextPrimaryChildren.updateQueue = { - transitions: showFallback, - markerInstances: didSuspend, - retryQueue: - null !== currentOffscreenQueue - ? currentOffscreenQueue.retryQueue - : null - }) - : ((currentFallbackChildFragment.transitions = showFallback), - (currentFallbackChildFragment.markerInstances = didSuspend)); + ? (nextPrimaryChildren.updateQueue = { + transitions: showFallback, + markerInstances: didSuspend, + retryQueue: + null !== currentOffscreenQueue + ? currentOffscreenQueue.retryQueue + : null + }) + : ((currentFallbackChildFragment.transitions = showFallback), + (currentFallbackChildFragment.markerInstances = didSuspend)); } nextPrimaryChildren.childLanes = getRemainingWorkInPrimaryTree( current, @@ -5176,7 +5277,7 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { null !== current && (workInProgress.dependencies = current.dependencies); workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -5204,12 +5305,9 @@ function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -5264,8 +5362,7 @@ function attemptEarlyBailoutIfNoScheduledUpdate( case 19: var didSuspendBefore = 0 !== (current.flags & 128); state = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !state && + state || (propagateParentContextChanges( current, workInProgress, @@ -5388,7 +5485,8 @@ function beginWork(current, workInProgress, renderLanes) { ); break a; } - throw Error(formatProdErrorMessage(306, current, "")); + workInProgress = getComponentNameFromType(current) || current; + throw Error(formatProdErrorMessage(306, workInProgress, "")); } } return workInProgress; @@ -5434,7 +5532,12 @@ function beginWork(current, workInProgress, renderLanes) { var nextCache = nextProps.cache; pushProvider(workInProgress, CacheContext, nextCache); nextCache !== init.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); init = nextProps.element; init === props @@ -5469,16 +5572,7 @@ function beginWork(current, workInProgress, renderLanes) { null, renderLanes )), - (HostTransitionContext._currentValue2 = init), - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== init && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - ))), + (HostTransitionContext._currentValue2 = init)), markRef(current, workInProgress), reconcileChildren(current, workInProgress, props, renderLanes), workInProgress.child @@ -5546,36 +5640,25 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress.child ); case 10: - a: { - props = enableRenderableContext - ? workInProgress.type - : workInProgress.type._context; - init = workInProgress.pendingProps; - nextProps = workInProgress.memoizedProps; - nextCache = init.value; - pushProvider(workInProgress, props, nextCache); - if (!enableLazyContextPropagation && null !== nextProps) - if (objectIs(nextProps.value, nextCache)) { - if (nextProps.children === init.children) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else propagateContextChange(workInProgress, props, renderLanes); - reconcileChildren(current, workInProgress, init.children, renderLanes); - workInProgress = workInProgress.child; - } - return workInProgress; + return ( + (props = workInProgress.pendingProps), + pushProvider( + workInProgress, + enableRenderableContext + ? workInProgress.type + : workInProgress.type._context, + props.value + ), + reconcileChildren(current, workInProgress, props.children, renderLanes), + workInProgress.child + ); case 9: return ( (init = enableRenderableContext ? workInProgress.type._context : workInProgress.type), (props = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (init = readContext(init)), (props = props(init)), (workInProgress.flags |= 1), @@ -5617,7 +5700,7 @@ function beginWork(current, workInProgress, renderLanes) { return updateOffscreenComponent(current, workInProgress, renderLanes); case 24: return ( - prepareToReadContext(workInProgress, renderLanes), + prepareToReadContext(workInProgress), (props = readContext(CacheContext)), null === current ? ((init = peekCacheFromPool()), @@ -5648,10 +5731,11 @@ function beginWork(current, workInProgress, renderLanes) { : ((props = nextProps.cache), pushProvider(workInProgress, CacheContext, props), props !== init.cache && - propagateContextChange( + propagateContextChanges( workInProgress, - CacheContext, - renderLanes + [CacheContext], + renderLanes, + !0 ))), reconcileChildren( current, @@ -5728,133 +5812,73 @@ function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { parent = parent.return; } } -function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = 2; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } -} function propagateContextChanges( workInProgress, contexts, renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + var select = dependency.select; + if ( + null != select && + null != dependency.lastSelectedValue && + !checkIfSelectedContextValuesChanged( + dependency.lastSelectedValue, + select(dependency.context._currentValue2) + ) + ) + continue b; + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; } - nextFiber = nextFiber.return; + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - fiber = nextFiber; - } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -5863,83 +5887,92 @@ function propagateParentContextChanges( renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; +} +function checkIfSelectedContextValuesChanged( + oldComparedValue, + newComparedValue +) { + if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { + if (oldComparedValue.length !== newComparedValue.length) return !0; + for (var i = 0; i < oldComparedValue.length; i++) + if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; + } else throw Error(formatProdErrorMessage(541)); + return !1; } function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue2, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue2, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } -function prepareToReadContext(workInProgress, renderLanes) { +function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { return readContextForConsumer(currentlyRenderingFiber, context); } -function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -5952,7 +5985,7 @@ function readContextForConsumer(consumer, context) { if (null === consumer) throw Error(formatProdErrorMessage(308)); lastContextDependency = context; consumer.dependencies = { lanes: 0, firstContext: context }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -6027,8 +6060,11 @@ function pushTransition( (null === transitionStack.current ? push(transitionStack, newTransitions) : null === newTransitions - ? push(transitionStack, transitionStack.current) - : push(transitionStack, transitionStack.current.concat(newTransitions))); + ? push(transitionStack, transitionStack.current) + : push( + transitionStack, + transitionStack.current.concat(newTransitions) + )); } function popTransition(workInProgress, current) { null !== current && @@ -6130,7 +6166,11 @@ function DO_NOT_USE_queryFirstNode(fn) { : null; } function containsNode() { - throw Error(formatProdErrorMessage(248)); + for (var fiber = null; null !== fiber; ) { + if (21 === fiber.tag && fiber.stateNode === this) return !0; + fiber = fiber.return; + } + return !1; } function getChildContextValues(context) { var currentFiber = shim$1(); @@ -6142,12 +6182,13 @@ function getChildContextValues(context) { return childContextValues; } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + enableSiblingPrerendering && + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { switch (renderState.tailMode) { @@ -6163,14 +6204,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$92 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$92 = lastTailNode), + for (var lastTailNode$93 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$93 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$92 + null === lastTailNode$93 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$92.sibling = null); + : (lastTailNode$93.sibling = null); } } function bubbleProperties(completedWork) { @@ -6180,19 +6221,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags & 31457280), - (subtreeFlags |= child$93.flags & 31457280), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (var child$94 = completedWork.child; null !== child$94; ) + (newChildLanes |= child$94.lanes | child$94.childLanes), + (subtreeFlags |= child$94.subtreeFlags & 31457280), + (subtreeFlags |= child$94.flags & 31457280), + (child$94.return = completedWork), + (child$94 = child$94.sibling); else - for (child$93 = completedWork.child; null !== child$93; ) - (newChildLanes |= child$93.lanes | child$93.childLanes), - (subtreeFlags |= child$93.subtreeFlags), - (subtreeFlags |= child$93.flags), - (child$93.return = completedWork), - (child$93 = child$93.sibling); + for (child$94 = completedWork.child; null !== child$94; ) + (newChildLanes |= child$94.lanes | child$94.childLanes), + (subtreeFlags |= child$94.subtreeFlags), + (subtreeFlags |= child$94.flags), + (child$94.return = completedWork), + (child$94 = child$94.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -6363,11 +6404,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$97 = null; + var cache$98 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$97 = newProps.memoizedState.cachePool.pool); - cache$97 !== instance && (newProps.flags |= 2048); + (cache$98 = newProps.memoizedState.cachePool.pool); + cache$98 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6395,8 +6436,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$97 = instance.rendering; - if (null === cache$97) + cache$98 = instance.rendering; + if (null === cache$98) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6404,11 +6445,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$97 = findFirstSuspended(current); - if (null !== cache$97) { + cache$98 = findFirstSuspended(current); + if (null !== cache$98) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$97.updateQueue; + current = cache$98.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6433,7 +6474,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$97)), null !== current)) { + if (((current = findFirstSuspended(cache$98)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6443,7 +6484,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$97.alternate) + !cache$98.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6455,13 +6496,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$97.sibling = workInProgress.child), - (workInProgress.child = cache$97)) + ? ((cache$98.sibling = workInProgress.child), + (workInProgress.child = cache$98)) : ((current = instance.last), null !== current - ? (current.sibling = cache$97) - : (workInProgress.child = cache$97), - (instance.last = cache$97)); + ? (current.sibling = cache$98) + : (workInProgress.child = cache$98), + (instance.last = cache$98)); } if (null !== instance.tail) return ( @@ -6671,18 +6712,92 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; -function callComponentWillUnmountWithTimer(current, instance) { +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 commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor$jscomp$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; + if (void 0 !== destroy) { + inst.destroy = void 0; + lastEffect = finishedWork; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + try { + destroy(); + } catch (error) { + captureCommitPhaseError( + lastEffect, + nearestMountedAncestor, + error + ); + } + } + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } 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 safelyCallComponentWillUnmount( + current, + nearestMountedAncestor, + instance +) { instance.props = resolveClassComponentProps( current.type, current.memoizedProps, current.elementType === current.type ); instance.state = current.memoizedState; - instance.componentWillUnmount(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } } function safelyAttachRef(current, nearestMountedAncestor) { try { @@ -6724,19 +6839,91 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$114) { - captureCommitPhaseError(current, nearestMountedAncestor, error$114); + } catch (error$116) { + captureCommitPhaseError(current, nearestMountedAncestor, error$116); } else ref.current = null; } -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { +function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration +) { try { - destroy(); + var _finishedWork$memoize2 = finishedWork.memoizedProps, + id = _finishedWork$memoize2.id, + onPostCommit = _finishedWork$memoize2.onPostCommit; + "function" === typeof onPostCommit && + onPostCommit( + id, + null === current ? "mount" : "update", + passiveEffectDuration, + commitStartTime + ); } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } -var focusedInstanceHandle = null, +function isHostParent(fiber) { + return 5 === fiber.tag || 3 === 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 && 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) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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) + if (((node = node.stateNode), before)) { + if (node === before) throw Error(formatProdErrorMessage(218)); + node.injectBefore(before); + } else node.parentNode === parent && node.eject(), node.inject(parent); + else if (4 !== 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, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; @@ -6753,81 +6940,85 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { root = nextEffect; - try { - var current = root.alternate, - flags = root.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === root.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = root.memoizedState; - JSCompiler_temp = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(root, focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - } - switch (root.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = root.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for ( - firstChild = 0; - firstChild < eventPayloads.length; - firstChild++ - ) { - var _eventPayloads$ii = eventPayloads[firstChild]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } + firstChild = root.alternate; + i = root.flags; + if ( + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle + ) { + var JSCompiler_temp; + if ((JSCompiler_temp = 13 === root.tag)) + a: { + if ( + null !== firstChild && + ((JSCompiler_temp = firstChild.memoizedState), + null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) + ) { + JSCompiler_temp = root.memoizedState; + JSCompiler_temp = + null !== JSCompiler_temp && + null === JSCompiler_temp.dehydrated; + break a; } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = root.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - root.type, - current.memoizedProps, - root.elementType === root.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + JSCompiler_temp = !1; + } + JSCompiler_temp && + doesFiberContain(root, focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + } + switch (root.tag) { + case 0: + if ( + 0 !== (i & 4) && + ((firstChild = root.updateQueue), + (firstChild = null !== firstChild ? firstChild.events : null), + null !== firstChild) + ) + for (i = 0; i < firstChild.length; i++) + (JSCompiler_temp = firstChild[i]), + (JSCompiler_temp.ref.impl = JSCompiler_temp.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (i & 1024) && null !== firstChild) { + i = void 0; + JSCompiler_temp = root; + var prevProps = firstChild.memoizedProps; + firstChild = firstChild.memoizedState; + var instance = JSCompiler_temp.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + JSCompiler_temp.type, + prevProps, + JSCompiler_temp.elementType === JSCompiler_temp.type + ); + i = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + firstChild + ); + instance.__reactInternalSnapshotBeforeUpdate = i; + } catch (error) { + captureCommitPhaseError( + JSCompiler_temp, + JSCompiler_temp.return, + error + ); } - break; - case 3: - 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(root, root.return, error); + } + break; + case 3: + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (i & 1024)) throw Error(formatProdErrorMessage(163)); } firstChild = root.sibling; if (null !== firstChild) { @@ -6838,65 +7029,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - current = shouldFireAfterActiveInstanceBlur; + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - 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 create = effect.create, - inst = effect.inst; - create = create(); - inst.destroy = create; - } - 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); - } - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -6905,7 +7041,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); @@ -7201,60 +7337,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return 5 === fiber.tag || 3 === 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 && 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) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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) - if (((node = node.stateNode), before)) { - if (node === before) throw Error(formatProdErrorMessage(218)); - node.injectBefore(before); - } else node.parentNode === parent && node.eject(), node.inject(parent); - else if (4 !== 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( @@ -7292,21 +7374,46 @@ function commitDeletionEffectsOnFiber( ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - ((deletedFiber = deletedFiber.stateNode), - destroyEventListeners(deletedFiber), - deletedFiber.eject()); + if (null !== hostParent) + if (hostParentIsContainer) + try { + var child = deletedFiber.stateNode; + destroyEventListeners(child); + child.eject(); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + var child$jscomp$0 = deletedFiber.stateNode; + destroyEventListeners(child$jscomp$0); + child$jscomp$0.eject(); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && shim$2(); break; case 4: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + child = hostParent; + child$jscomp$0 = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = !0; recursivelyTraverseDeletionEffects( @@ -7314,43 +7421,18 @@ function commitDeletionEffectsOnFiber( nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; + hostParent = child; + hostParentIsContainer = child$jscomp$0; break; case 0: case 11: case 14: case 15: - if ( - !offscreenSubtreeWasHidden && - ((prevHostParent = deletedFiber.updateQueue), - null !== prevHostParent && - ((prevHostParent = prevHostParent.lastEffect), - null !== prevHostParent)) - ) { - prevHostParentIsContainer = prevHostParent = prevHostParent.next; - do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - (0 !== (tag & 2) - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : 0 !== (tag & 4) && - ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ))); - prevHostParentIsContainer = prevHostParentIsContainer.next; - } while (prevHostParentIsContainer !== prevHostParent); - } + (!enableHiddenSubtreeInsertionEffectCleanup && + offscreenSubtreeWasHidden) || + commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor); + offscreenSubtreeWasHidden || + commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7358,17 +7440,15 @@ function commitDeletionEffectsOnFiber( ); break; case 1: - if ( - !offscreenSubtreeWasHidden && + offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount) - ) - try { - callComponentWillUnmountWithTimer(deletedFiber, prevHostParent); - } catch (error) { - captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); - } + (child = deletedFiber.stateNode), + "function" === typeof child.componentWillUnmount && + safelyCallComponentWillUnmount( + deletedFiber, + nearestMountedAncestor, + child + )); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -7386,14 +7466,14 @@ function commitDeletionEffectsOnFiber( case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); offscreenSubtreeWasHidden = - (prevHostParent = offscreenSubtreeWasHidden) || + (child = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - offscreenSubtreeWasHidden = prevHostParent; + offscreenSubtreeWasHidden = child; break; default: recursivelyTraverseDeletionEffects( @@ -7449,45 +7529,41 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); retryCache.has(wakeable) || (retryCache.add(wakeable), wakeable.then(retry, retry)); - }); -} -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; + }); +} +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], + 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; ) @@ -7504,19 +7580,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); @@ -7524,15 +7591,19 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - flags & 64 && + if ( + flags & 64 && offscreenSubtreeIsHidden && ((finishedWork = finishedWork.updateQueue), null !== finishedWork && - ((flags = finishedWork.callbacks), - null !== flags && - ((current = finishedWork.shared.hiddenCallbacks), - (finishedWork.shared.hiddenCallbacks = - null === current ? flags : current.concat(flags))))); + ((flags = finishedWork.callbacks), null !== flags)) + ) { + var existingHiddenCallbacks = finishedWork.shared.hiddenCallbacks; + finishedWork.shared.hiddenCallbacks = + null === existingHiddenCallbacks + ? flags + : existingHiddenCallbacks.concat(flags); + } break; case 26: case 27: @@ -7542,13 +7613,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) { - var newProps = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : newProps; + if (flags & 4 && null != finishedWork.stateNode) { + flags = finishedWork.memoizedProps; + existingHiddenCallbacks = + null !== current ? current.memoizedProps : flags; try { - flags._applyProps(flags, newProps, current); - } catch (error$126) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$126); + var instance = finishedWork.stateNode; + instance._applyProps(instance, flags, existingHiddenCallbacks); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -7566,15 +7639,24 @@ function commitMutationEffectsOnFiber(finishedWork, root) { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); break; + case 12: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; case 13: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - finishedWork.child.flags & 8192 && - ((newProps = null !== finishedWork.memoizedState), - (current = null !== current && null !== current.memoizedState), + if (finishedWork.child.flags & 8192) { + existingHiddenCallbacks = null !== finishedWork.memoizedState; + var wasShowingFallback = + null !== current && null !== current.memoizedState; alwaysThrottleRetries - ? newProps !== current && (globalMostRecentFallbackTime = now()) - : newProps && !current && (globalMostRecentFallbackTime = now())); + ? existingHiddenCallbacks !== wasShowingFallback && + (globalMostRecentFallbackTime = now()) + : existingHiddenCallbacks && + !wasShowingFallback && + (globalMostRecentFallbackTime = now()); + } if (flags & 4) { try { if (null !== finishedWork.memoizedState) { @@ -7584,8 +7666,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$128) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$128); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -7597,16 +7679,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - suspenseCallback = null !== finishedWork.memoizedState; - retryQueue = null !== current && null !== current.memoizedState; - var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, - prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = - prevOffscreenSubtreeIsHidden || suspenseCallback; - offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; + instance = null !== finishedWork.memoizedState; + suspenseCallback = null !== current && null !== current.memoizedState; + retryQueue = offscreenSubtreeIsHidden; + var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = retryQueue || instance; + offscreenSubtreeWasHidden = + prevOffscreenSubtreeWasHidden || suspenseCallback; recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; + offscreenSubtreeIsHidden = retryQueue; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -7614,13 +7696,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = suspenseCallback + ((root._visibility = instance ? root._visibility & -2 : root._visibility | 1), - suspenseCallback && + instance && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - retryQueue || + suspenseCallback || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -7629,19 +7711,19 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag) { if (null === current) { - current = root; + suspenseCallback = current = root; try { - if (((newProps = root.stateNode), suspenseCallback)) - newProps.hide(); - else { - var props = root.memoizedProps; - (null == props.visible || props.visible) && - root.stateNode.show(); - } + (existingHiddenCallbacks = suspenseCallback.stateNode), + instance + ? existingHiddenCallbacks.hide() + : ((wasShowingFallback = suspenseCallback.memoizedProps), + (null == wasShowingFallback.visible || + wasShowingFallback.visible) && + suspenseCallback.stateNode.show()); } catch (error) { captureCommitPhaseError( - finishedWork, - finishedWork.return, + suspenseCallback, + suspenseCallback.return, error ); } @@ -7670,10 +7752,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 4 && ((flags = finishedWork.updateQueue), null !== flags && - ((current = flags.retryQueue), - null !== current && + ((existingHiddenCallbacks = flags.retryQueue), + null !== existingHiddenCallbacks && ((flags.retryQueue = null), - attachSuspenseRetryListeners(finishedWork, current)))); + attachSuspenseRetryListeners( + finishedWork, + existingHiddenCallbacks + )))); break; case 19: recursivelyTraverseMutationEffects(root, finishedWork); @@ -7722,12 +7807,12 @@ function commitReconciliationEffects(finishedWork) { break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$117 = JSCompiler_inline_result.stateNode.containerInfo, + before$118 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$118, + parent$117 ); break; default: @@ -7760,15 +7845,12 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 1: safelyDetachRef(finishedWork, finishedWork.return); var instance = finishedWork.stateNode; - if ("function" === typeof instance.componentWillUnmount) { - var current = finishedWork, - nearestMountedAncestor = finishedWork.return; - try { - callComponentWillUnmountWithTimer(current, instance); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - } + "function" === typeof instance.componentWillUnmount && + safelyCallComponentWillUnmount( + finishedWork, + finishedWork.return, + instance + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 26: @@ -7808,7 +7890,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -7816,23 +7898,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - var instance = finishedWork.stateNode; + finishedRoot = finishedWork; + var instance = finishedRoot.stateNode; if ("function" === typeof instance.componentDidMount) try { instance.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(finishedRoot, finishedRoot.return, error); + } + finishedRoot = finishedWork; + instance = finishedRoot.updateQueue; + if (null !== instance) { + var instance$jscomp$0 = finishedRoot.stateNode; + try { + var hiddenCallbacks = instance.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + instance.shared.hiddenCallbacks = null, instance = 0; + instance < hiddenCallbacks.length; + instance++ + ) + callCallback(hiddenCallbacks[instance], instance$jscomp$0); + } catch (error) { + captureCommitPhaseError(finishedRoot, finishedRoot.return, error); } - finishedRoot = finishedWork.updateQueue; - if (null !== finishedRoot) { - var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; - finishedRoot < hiddenCallbacks.length; - finishedRoot++ - ) - callCallback(hiddenCallbacks[finishedRoot], instance); } includeWorkInProgressEffects && flags & 64 && @@ -7882,13 +7971,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, instance) { var previousCache = null; null !== current && @@ -7992,7 +8074,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -8055,6 +8137,27 @@ function commitPassiveMountOnFiber( } } break; + case 12: + flags & 2048 + ? (recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ), + commitProfilerPostCommit( + finishedWork, + finishedWork.alternate, + -0, + finishedWork.stateNode.passiveEffectDuration + )) + : recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -8081,20 +8184,20 @@ function commitPassiveMountOnFiber( ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ? recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ) + : ((nextCache._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, @@ -8158,7 +8261,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -8177,9 +8280,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$138 = finishedWork.stateNode; + var instance$131 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$138._visibility & 4 + ? instance$131._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8191,7 +8294,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$138._visibility |= 4), + : ((instance$131._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8204,7 +8307,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$138 + instance$131 ); break; case 24: @@ -8298,12 +8401,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$143 = fiber.alternate; - null !== current$143 && null !== current$143.memoizedState - ? ((current$143 = suspenseyCommitFlag), + var current$136 = fiber.alternate; + null !== current$136 && null !== current$136.memoizedState + ? ((current$136 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$143)) + (suspenseyCommitFlag = current$136)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8353,6 +8456,12 @@ function commitPassiveUnmountOnFiber(finishedWork) { finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return); break; + case 3: + recursivelyTraversePassiveUnmountEffects(finishedWork); + break; + case 12: + recursivelyTraversePassiveUnmountEffects(finishedWork); + break; case 22: var instance = finishedWork.stateNode; null !== finishedWork.memoizedState && @@ -8501,25 +8610,28 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( } } var DefaultAsyncDispatcher = { - getCacheForType: function (resourceType) { - var cache = readContext(CacheContext), - cacheForType = cache.data.get(resourceType); - void 0 === cacheForType && - ((cacheForType = resourceType()), - cache.data.set(resourceType, cacheForType)); - return cacheForType; - }, - getOwner: function () { - return current; - } - }, - PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, + getCacheForType: function (resourceType) { + var cache = readContext(CacheContext), + cacheForType = cache.data.get(resourceType); + void 0 === cacheForType && + ((cacheForType = resourceType()), + cache.data.set(resourceType, cacheForType)); + return cacheForType; + } +}; +disableStringRefs || + (DefaultAsyncDispatcher.getOwner = function () { + return current; + }); +var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -8527,6 +8639,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -8633,7 +8746,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -8659,69 +8773,93 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )); ensureRootIsScheduled(root); } } -function performConcurrentWorkOnRoot(root, didTimeout) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var exitStatus = (didTimeout = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); + var exitStatus = (forceSync = + !forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes); if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; + var renderWasConcurrent = forceSync; do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); + if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { - didTimeout = root.current.alternate; + forceSync = root$jscomp$0.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) + !isRenderConsistentWithExternalStores(forceSync) ) { - exitStatus = renderRootSync(root, lanes); + exitStatus = renderRootSync(root$jscomp$0, lanes); renderWasConcurrent = !1; continue; } if (2 === exitStatus) { renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = + root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + JSCompiler_inline_result = renderRootSync( + root, + JSCompiler_inline_result + ); + if (2 !== JSCompiler_inline_result) { + if (workInProgressRootDidAttachPingListener) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; + break a; + } + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; + } + renderWasConcurrent = !1; + if (2 !== exitStatus) continue; + } } if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended( + root$jscomp$0, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); break; } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; a: { - renderWasConcurrent = root; + renderWasConcurrent = root$jscomp$0; switch (exitStatus) { case 0: case 1: @@ -8731,7 +8869,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -8745,6 +8884,8 @@ function performConcurrentWorkOnRoot(root, didTimeout) { default: throw Error(formatProdErrorMessage(329)); } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === exitStatus) && @@ -8754,19 +8895,26 @@ function performConcurrentWorkOnRoot(root, didTimeout) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, renderWasConcurrent, - didTimeout, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 ), exitStatus ); @@ -8774,45 +8922,25 @@ function performConcurrentWorkOnRoot(root, didTimeout) { } commitRootWhenReady( renderWasConcurrent, - didTimeout, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 ); } } break; } while (1); } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -8829,41 +8957,61 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { lanes = finishedWork.subtreeFlags; (lanes & 8192 || 16785408 === (lanes & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane - ); + finishedWork = ReactSharedInternals.T; + lanes = currentUpdatePriority; + try { + (currentUpdatePriority = 2), + (ReactSharedInternals.T = null), + commitRootImpl( + root, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + lanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime + ); + } finally { + (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); + } } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -8879,77 +9027,39 @@ 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)); enableInfiniteRenderLoopDetection && (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; - - ) { + enableSiblingPrerendering && + !didSkipSuspendedSiblings && + (root.warmLanes |= suspendedLanes); + didSkipSuspendedSiblings = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index$6 = 31 - clz32(lanes), lane = 1 << index$6; - expirationTimes[index$6] = -1; + didSkipSuspendedSiblings[index$6] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -8984,8 +9094,13 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & ~(root.suspendedLanes & ~root.pingedLanes) & lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -8994,7 +9109,7 @@ function prepareFreshStack(root, lanes) { workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -9014,23 +9129,31 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); if (thrownValue === SuspenseException) { thrownValue = getSuspendedThenable(); - var handler = suspenseHandlerStackCursor.current; + var JSCompiler_temp; + if ((JSCompiler_temp = !enableSiblingPrerendering)) + (JSCompiler_temp = suspenseHandlerStackCursor.current), + (JSCompiler_temp = + null === JSCompiler_temp + ? !0 + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? JSCompiler_temp === shellBoundary + : !1); workInProgressSuspendedReason = - (null !== handler && - ((workInProgressRootRenderLanes & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - handler !== shellBoundary)) || - 0 !== (workInProgressRootSkippedLanes & 134217727) || - 0 !== (workInProgressRootInterleavedUpdatedLanes & 134217727) - ? 3 - : 2; + JSCompiler_temp && + 0 === (workInProgressRootSkippedLanes & 134217727) && + 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) + ? 2 + : 3; } else thrownValue === SuspenseyCommitException ? ((thrownValue = getSuspendedThenable()), @@ -9039,10 +9162,10 @@ function handleThrow(root, thrownValue) { thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? 6 - : 1); + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? 6 + : 1); workInProgressThrownValue = thrownValue; null === workInProgress && ((workInProgressRootExitStatus = 1), @@ -9063,13 +9186,17 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + 0 !== (workInProgressRootRenderLanes & 60) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -9097,15 +9224,16 @@ function renderRootSync(root, lanes) { null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = 0), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); break; - } catch (thrownValue$149) { - handleThrow(root, thrownValue$149); + } catch (thrownValue$142) { + handleThrow(root, thrownValue$142); } while (1); lanes && root.shellSuspendCounter++; @@ -9127,10 +9255,16 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = getTransitionsForLanes(root, lanes)), + workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes + ? ((workInProgressTransitions = getTransitionsForLanes(root, lanes)), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); + prepareFreshStack(root, lanes)) + : workInProgressRootIsPrerendering && + (workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes)); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9140,7 +9274,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: var thenable = thrownValue; @@ -9171,7 +9305,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: thenable = null; @@ -9197,12 +9331,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 6); break; case 8: resetWorkInProgressStack(); @@ -9214,8 +9348,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$151) { - handleThrow(root, thrownValue$151); + } catch (thrownValue$144) { + handleThrow(root, thrownValue$144); } while (1); resetContextDependencies(); @@ -9234,7 +9368,7 @@ function workLoopConcurrent() { } function performUnitOfWork(unitOfWork) { var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes); - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -9283,11 +9417,16 @@ function replaySuspendedUnitOfWork(unitOfWork) { resetWorkInProgress(next, entangledRenderLanes)), (next = beginWork(current$jscomp$0, next, entangledRenderLanes)); } - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } -function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { +function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason +) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); thenableState$1 = null; @@ -9321,31 +9460,40 @@ 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); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (1 === suspendedReason) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else { + if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + 2 === suspendedReason || + 3 === suspendedReason || + 6 === suspendedReason) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + } + else root = !0; + unwindUnitOfWork(unitOfWork, root); + } else 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, @@ -9365,31 +9513,28 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } -function commitRoot( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - spawnedLane -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - return null; +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 commitRootImpl( root, @@ -9397,7 +9542,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -9413,7 +9560,14 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -9425,26 +9579,26 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - commitBeforeMutationEffects(root, finishedWork); - commitMutationEffectsOnFiber(finishedWork, root); - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = currentUpdatePriority), + (currentUpdatePriority = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + commitBeforeMutationEffects(root, finishedWork), + commitMutationEffectsOnFiber(finishedWork, root), + (root.current = finishedWork), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + requestPaint(), + (executionContext = updatedLanes), + (currentUpdatePriority = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -9473,7 +9627,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); return null; } function releaseRootPooledCache(root, remainingLanes) { @@ -9482,7 +9636,7 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -9494,7 +9648,7 @@ function flushPassiveEffects() { return ( (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -9518,7 +9672,7 @@ function flushPassiveEffectsImpl() { commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -9607,6 +9761,7 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & 2 ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -9620,7 +9775,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -9696,9 +9853,39 @@ function FiberNode(tag, pendingProps, key, mode) { this.childLanes = this.lanes = 0; this.alternate = null; } -function createFiber(tag, pendingProps, key, mode) { +function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } +function createFiberImplObject(tag, pendingProps, key, mode) { + return { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode + }; +} +var createFiber = enableObjectFiber + ? createFiberImplObject + : createFiberImplClass; function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -9987,6 +10174,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -10028,9 +10216,6 @@ function updateContainerSync(element, container, parentComponent, callback) { entangleTransitions(element, parentComponent, 2)); return 2; } -function emptyFindFiberByHostInstance() { - return null; -} Mode$1.setCurrent(FastNoSideEffects); var slice = Array.prototype.slice, LinearGradient = (function () { @@ -10158,56 +10343,28 @@ var slice = Array.prototype.slice, ); }; return Text; - })(React.Component), - devToolsConfig$jscomp$inline_1138 = { - findFiberByHostInstance: function () { - return null; - }, - bundleType: 0, - version: "19.0.0-www-modern-e02baf6c92-20240627", - rendererPackageName: "react-art" - }; -var internals$jscomp$inline_1372 = { - bundleType: devToolsConfig$jscomp$inline_1138.bundleType, - version: devToolsConfig$jscomp$inline_1138.version, - rendererPackageName: devToolsConfig$jscomp$inline_1138.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1138.rendererConfig, - overrideHookState: null, - overrideHookStateDeletePath: null, - overrideHookStateRenamePath: null, - overrideProps: null, - overridePropsDeletePath: null, - overridePropsRenamePath: null, - setErrorHandler: null, - setSuspenseHandler: null, - scheduleUpdate: null, + })(React.Component); +var internals$jscomp$inline_1460 = { + bundleType: 0, + version: "19.0.0-www-modern-13411e45-20241014", + rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - findHostInstanceByFiber: function (fiber) { - fiber = findCurrentFiberUsingSlowPath(fiber); - fiber = null !== fiber ? findCurrentHostFiberImpl(fiber) : null; - return null === fiber ? null : fiber.stateNode; + findFiberByHostInstance: function () { + return null; }, - findFiberByHostInstance: - devToolsConfig$jscomp$inline_1138.findFiberByHostInstance || - emptyFindFiberByHostInstance, - findHostInstancesForRefresh: null, - scheduleRefresh: null, - scheduleRoot: null, - setRefreshHandler: null, - getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-e02baf6c92-20240627" + reconcilerVersion: "19.0.0-www-modern-13411e45-20241014" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1461 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1373.isDisabled && - hook$jscomp$inline_1373.supportsFiber + !hook$jscomp$inline_1461.isDisabled && + hook$jscomp$inline_1461.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1373.inject( - internals$jscomp$inline_1372 + (rendererID = hook$jscomp$inline_1461.inject( + internals$jscomp$inline_1460 )), - (injectedHook = hook$jscomp$inline_1373); + (injectedHook = hook$jscomp$inline_1461); } catch (err) {} } var Path = Mode$1.Path; @@ -10221,3 +10378,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; +exports.version = "19.0.0-www-modern-13411e45-20241014"; diff --git a/compiled/facebook-www/ReactCacheOld-dev.classic.js b/compiled/facebook-www/ReactCacheOld-dev.classic.js index bb79bca9ecc8e..0210580bd5cc7 100644 --- a/compiled/facebook-www/ReactCacheOld-dev.classic.js +++ b/compiled/facebook-www/ReactCacheOld-dev.classic.js @@ -23,12 +23,11 @@ __DEV__ && ) args[_key2 - 1] = arguments[_key2]; _len2 = format; - _key2 = Error("react-stack-top-frame"); - var ReactSharedInternals = + _key2 = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - null != ReactSharedInternals && - ReactSharedInternals.getCurrentStack && - ((_key2 = ReactSharedInternals.getCurrentStack(_key2)), + null != _key2 && + _key2.getCurrentStack && + ((_key2 = _key2.getCurrentStack()), "" !== _key2 && ((_len2 += "%s"), args.push(_key2))); args.unshift(_len2); args.unshift(!1); diff --git a/compiled/facebook-www/ReactCacheOld-dev.modern.js b/compiled/facebook-www/ReactCacheOld-dev.modern.js index bb79bca9ecc8e..0210580bd5cc7 100644 --- a/compiled/facebook-www/ReactCacheOld-dev.modern.js +++ b/compiled/facebook-www/ReactCacheOld-dev.modern.js @@ -23,12 +23,11 @@ __DEV__ && ) args[_key2 - 1] = arguments[_key2]; _len2 = format; - _key2 = Error("react-stack-top-frame"); - var ReactSharedInternals = + _key2 = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - null != ReactSharedInternals && - ReactSharedInternals.getCurrentStack && - ((_key2 = ReactSharedInternals.getCurrentStack(_key2)), + null != _key2 && + _key2.getCurrentStack && + ((_key2 = _key2.getCurrentStack()), "" !== _key2 && ((_len2 += "%s"), args.push(_key2))); args.unshift(_len2); args.unshift(!1); diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index a80a977969a54..a4adad1ce2885 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -75,20 +75,6 @@ __DEV__ && function shouldErrorImpl() { return null; } - function findHostInstancesForRefresh(root, families) { - var hostInstances = new Set(); - families = new Set( - families.map(function (family) { - return family.current; - }) - ); - findHostInstancesForMatchingFibersRecursively( - root.current, - families, - hostInstances - ); - return hostInstances; - } function scheduleRoot(root, element) { root.context === emptyContextObject && (updateContainerSync(element, root, null, null), flushSyncWork$1()); @@ -138,7 +124,7 @@ __DEV__ && _key++ ) args[_key - 1] = arguments[_key]; - printWarning("warn", format, args, Error("react-stack-top-frame")); + printWarning("warn", format, args); } } function error$jscomp$0(format) { @@ -151,16 +137,16 @@ __DEV__ && _key2++ ) args[_key2 - 1] = arguments[_key2]; - printWarning("error", format, args, Error("react-stack-top-frame")); + printWarning("error", format, args); } } - function printWarning(level, format, args, currentStack) { + function printWarning(level, format, args) { level = require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; null != level && level.getCurrentStack && - ((currentStack = level.getCurrentStack(currentStack)), - "" !== currentStack && ((format += "%s"), args.push(currentStack))); + ((level = level.getCurrentStack()), + "" !== level && ((format += "%s"), args.push(level))); args.unshift(format); args.unshift(!1); warningWWW.apply(null, args); @@ -242,8 +228,8 @@ __DEV__ && return "number" === typeof owner.tag ? getComponentNameFromFiber(owner) : "string" === typeof owner.name - ? owner.name - : null; + ? owner.name + : null; } function getComponentNameFromFiber(fiber) { var type = fiber.type; @@ -372,8 +358,14 @@ __DEV__ && } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = (match && match[1]) || ""; + suffix = + -1 < x.stack.indexOf("\n at") + ? " ()" + : -1 < x.stack.indexOf("@") + ? "@unknown:0:0" + : ""; } - return "\n" + prefix + name; + return "\n" + prefix + name + suffix; } function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) return ""; @@ -527,28 +519,6 @@ __DEV__ && "function" === typeof fn && componentFrameCache.set(fn, sampleLines); return sampleLines; } - function callComponentInDEV(Component, props, secondArg) { - var wasRendering = isRendering; - isRendering = !0; - try { - return Component(props, secondArg); - } finally { - isRendering = wasRendering; - } - } - function callRenderInDEV(instance) { - var wasRendering = isRendering; - isRendering = !0; - try { - return instance.render(); - } finally { - isRendering = wasRendering; - } - } - function callLazyInitInDEV(lazy) { - var init = lazy._init; - return init(lazy._payload); - } function describeFiber(fiber) { switch (fiber.tag) { case 26: @@ -587,7 +557,7 @@ __DEV__ && var JSCompiler_temp_const = info, env = entry.env; var JSCompiler_inline_result = describeBuiltInComponentFrame( - entry.name + (env ? " (" + env + ")" : "") + entry.name + (env ? " [" + env + "]" : "") ); info = JSCompiler_temp_const + JSCompiler_inline_result; } @@ -604,9 +574,6 @@ __DEV__ && var owner = current._debugOwner; return null != owner ? getComponentNameFromOwner(owner) : null; } - function getCurrentParentStackInDev() { - return null === current ? "" : getStackByFiberInDevAndProd(current); - } function getCurrentFiberStackInDev() { return null === current ? "" : getStackByFiberInDevAndProd(current); } @@ -793,13 +760,7 @@ __DEV__ && !0 ); try { - enableSchedulingProfiler && - (internals = assign({}, internals, { - getLaneLabelMap: getLaneLabelMap, - injectProfilingHooks: injectProfilingHooks - })), - (rendererID = hook.inject(internals)), - (injectedHook = hook); + (rendererID = hook.inject(internals)), (injectedHook = hook); } catch (err) { error$jscomp$0("React instrumentation encountered an error: %s.", err); } @@ -859,21 +820,6 @@ __DEV__ && function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } - function getLaneLabelMap() { - if (enableSchedulingProfiler) { - for ( - var map = new Map(), lane = 1, index = 0; - index < TotalLanes; - index++ - ) { - var label = getLabelForLane(lane); - map.set(lane, label); - lane *= 2; - } - return map; - } - return null; - } function markCommitStopped() { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -894,20 +840,6 @@ __DEV__ && typeof injectedProfilingHooks.markComponentRenderStopped && injectedProfilingHooks.markComponentRenderStopped(); } - function markComponentLayoutEffectUnmountStarted(fiber) { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && - injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); - } - function markComponentLayoutEffectUnmountStopped() { - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); - } function markRenderStarted(lanes) { enableSchedulingProfiler && null !== injectedProfilingHooks && @@ -932,41 +864,40 @@ __DEV__ && } function getLabelForLane(lane) { if (enableSchedulingProfiler) { - if (lane & SyncHydrationLane) return "SyncHydrationLane"; - if (lane & SyncLane) return "Sync"; - if (lane & InputContinuousHydrationLane) - return "InputContinuousHydration"; - if (lane & InputContinuousLane) return "InputContinuous"; - if (lane & DefaultHydrationLane) return "DefaultHydration"; - if (lane & DefaultLane) return "Default"; - if (lane & TransitionHydrationLane) return "TransitionHydration"; - if (lane & TransitionLanes) return "Transition"; - if (lane & RetryLanes) return "Retry"; - if (lane & SelectiveHydrationLane) return "SelectiveHydration"; - if (lane & IdleHydrationLane) return "IdleHydration"; - if (lane & IdleLane) return "Idle"; - if (lane & OffscreenLane) return "Offscreen"; - if (lane & DeferredLane) return "Deferred"; + if (lane & 1) return "SyncHydrationLane"; + if (lane & 2) return "Sync"; + if (lane & 4) return "InputContinuousHydration"; + if (lane & 8) return "InputContinuous"; + if (lane & 16) return "DefaultHydration"; + if (lane & 32) return "Default"; + if (lane & 64) return "TransitionHydration"; + if (lane & 4194176) return "Transition"; + if (lane & 62914560) return "Retry"; + if (lane & 67108864) return "SelectiveHydration"; + if (lane & 134217728) return "IdleHydration"; + if (lane & 268435456) return "Idle"; + if (lane & 536870912) return "Offscreen"; + if (lane & 1073741824) return "Deferred"; } } function getHighestPriorityLanes(lanes) { - var pendingSyncLanes = lanes & SyncUpdateLanes; + var pendingSyncLanes = lanes & 42; if (0 !== pendingSyncLanes) return pendingSyncLanes; switch (lanes & -lanes) { - case SyncHydrationLane: - return SyncHydrationLane; - case SyncLane: - return SyncLane; - case InputContinuousHydrationLane: - return InputContinuousHydrationLane; - case InputContinuousLane: - return InputContinuousLane; - case DefaultHydrationLane: - return DefaultHydrationLane; - case DefaultLane: - return DefaultLane; - case TransitionHydrationLane: - return TransitionHydrationLane; + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + return 64; case 128: case 256: case 512: @@ -982,21 +913,21 @@ __DEV__ && case 524288: case 1048576: case 2097152: - return lanes & TransitionLanes; + return lanes & 4194176; case 4194304: case 8388608: case 16777216: case 33554432: - return lanes & RetryLanes; - case SelectiveHydrationLane: - return SelectiveHydrationLane; - case IdleHydrationLane: - return IdleHydrationLane; - case IdleLane: - return IdleLane; - case OffscreenLane: - return OffscreenLane; - case DeferredLane: + return lanes & 62914560; + case 67108864: + return 67108864; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: return 0; default: return ( @@ -1011,41 +942,55 @@ __DEV__ && var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes; - root = root.pingedLanes; + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + warmLanes = root.warmLanes; + root = 0 !== root.finishedLanes; 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)) + : enableSiblingPrerendering && + !root && + ((warmLanes = nonIdlePendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes))))) + : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), + 0 !== nonIdlePendingLanes + ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) + : 0 !== pingedLanes + ? (nextLanes = getHighestPriorityLanes(pingedLanes)) + : enableSiblingPrerendering && + !root && + ((warmLanes = pendingLanes & ~warmLanes), + 0 !== warmLanes && + (nextLanes = getHighestPriorityLanes(warmLanes)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && - wipLanes !== nextLanes && - 0 === (wipLanes & suspendedLanes) && - ((suspendedLanes = nextLanes & -nextLanes), - (root = wipLanes & -wipLanes), - suspendedLanes >= root || - (suspendedLanes === DefaultLane && 0 !== (root & TransitionLanes))) - ? wipLanes - : nextLanes; + wipLanes !== nextLanes && + 0 === (wipLanes & suspendedLanes) && + ((suspendedLanes = nextLanes & -nextLanes), + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + ? wipLanes + : nextLanes; } function computeExpirationTime(lane, currentTime) { switch (lane) { - case SyncHydrationLane: - case SyncLane: - case InputContinuousHydrationLane: - case InputContinuousLane: + case 1: + case 2: + case 4: + case 8: return currentTime + syncLaneExpirationMs; - case DefaultHydrationLane: - case DefaultLane: - case TransitionHydrationLane: + case 16: + case 32: + case 64: case 128: case 256: case 512: @@ -1069,11 +1014,11 @@ __DEV__ && return enableRetryLaneExpiration ? currentTime + retryLaneExpirationMs : -1; - case SelectiveHydrationLane: - case IdleHydrationLane: - case IdleLane: - case OffscreenLane: - case DeferredLane: + case 67108864: + case 134217728: + case 268435456: + case 536870912: + case 1073741824: return -1; default: return ( @@ -1084,60 +1029,50 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & ~OffscreenLane; - return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0; - } - function includesBlockingLane(root, lanes) { - return 0 !== (root.current.mode & 32) - ? !1 - : 0 !== - (lanes & - (InputContinuousHydrationLane | - InputContinuousLane | - DefaultHydrationLane | - DefaultLane)); - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; - 0 === (nextTransitionLane & TransitionLanes) && - (nextTransitionLane = 128); + 0 === (nextTransitionLane & 4194176) && (nextTransitionLane = 128); return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; - 0 === (nextRetryLane & RetryLanes) && (nextRetryLane = 4194304); + 0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304); return lane; } function createLaneMap(initial) { - for (var laneMap = [], i = 0; i < TotalLanes; i++) laneMap.push(initial); + for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } - function markRootFinished(root, remainingLanes, spawnedLane) { - var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + function markRootFinished( + root, + finishedLanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ) { + var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; root.pingedLanes = 0; + root.warmLanes = 0; root.expiredLanes &= remainingLanes; root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - remainingLanes = root.entanglements; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; for ( - var expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - 0 < noLongerPendingLanes; + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; ) { - var index = 31 - clz32(noLongerPendingLanes), + var index = 31 - clz32(remainingLanes), lane = 1 << index; - remainingLanes[index] = 0; + entanglements[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1147,11 +1082,17 @@ __DEV__ && index++ ) { var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= ~OffscreenLane); + null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + remainingLanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + !enableSiblingPrerendering || + 0 === suspendedRetryLanes || + 0 !== updatedLanes || + (disableLegacyMode && 0 === root.tag) || + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1160,8 +1101,8 @@ __DEV__ && root.entangledLanes |= spawnedLane; root.entanglements[spawnedLaneIndex] = root.entanglements[spawnedLaneIndex] | - DeferredLane | - (entangledLanes & UpdateLanes); + 1073741824 | + (entangledLanes & 4194218); } function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); @@ -1246,6 +1187,38 @@ __DEV__ && ); return dispatcher; } + function bindToConsole(methodName, args, badgeName) { + var offset = 0; + switch (methodName) { + case "dir": + case "dirxml": + case "groupEnd": + case "table": + return bind.apply(console[methodName], [console].concat(args)); + case "assert": + offset = 1; + } + args = args.slice(0); + "string" === typeof args[offset] + ? args.splice( + offset, + 1, + "%c%s%c " + args[offset], + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ) + : args.splice( + offset, + 0, + "%c%s%c ", + "background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px", + " " + badgeName + " ", + "" + ); + args.unshift(console); + return bind.apply(console[methodName], args); + } function createCursor(defaultValue) { return { current: defaultValue }; } @@ -1349,7 +1322,7 @@ __DEV__ && (pop(contextStackCursor$1, fiber), pop(contextFiberStackCursor, fiber)); hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor, fiber), - (HostTransitionContext._currentValue = null)); + (HostTransitionContext._currentValue = NotPendingTransition)); } function typeName(value) { return ( @@ -1706,8 +1679,8 @@ __DEV__ && null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue - ? setDefaultValue(element, type, getToStringValue(defaultValue)) - : null != lastDefaultValue && element.removeAttribute("value"); + ? setDefaultValue(element, type, getToStringValue(defaultValue)) + : null != lastDefaultValue && element.removeAttribute("value"); null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked); @@ -1909,1562 +1882,1612 @@ __DEV__ && null !== children && (element.value = children); } - function updatedAncestorInfoDev(oldInfo, tag) { - oldInfo = assign({}, oldInfo || emptyAncestorInfoDev); - var info = { tag: tag }; - -1 !== inScopeTags.indexOf(tag) && - ((oldInfo.aTagInScope = null), - (oldInfo.buttonTagInScope = null), - (oldInfo.nobrTagInScope = null)); - -1 !== buttonScopeTags.indexOf(tag) && (oldInfo.pTagInButtonScope = null); - -1 !== specialTags.indexOf(tag) && - "address" !== tag && - "div" !== tag && - "p" !== tag && - ((oldInfo.listItemTagAutoclosing = null), - (oldInfo.dlItemTagAutoclosing = null)); - oldInfo.current = info; - "form" === tag && (oldInfo.formTag = info); - "a" === tag && (oldInfo.aTagInScope = info); - "button" === tag && (oldInfo.buttonTagInScope = info); - "nobr" === tag && (oldInfo.nobrTagInScope = info); - "p" === tag && (oldInfo.pTagInButtonScope = info); - "li" === tag && (oldInfo.listItemTagAutoclosing = info); - if ("dd" === tag || "dt" === tag) oldInfo.dlItemTagAutoclosing = info; - "#document" === tag || "html" === tag - ? (oldInfo.containerTagInScope = null) - : oldInfo.containerTagInScope || (oldInfo.containerTagInScope = info); - return oldInfo; + function findNotableNode(node, indent) { + return void 0 === node.serverProps && + 0 === node.serverTail.length && + 1 === node.children.length && + 3 < node.distanceFromLeaf && + node.distanceFromLeaf > 15 - indent + ? findNotableNode(node.children[0], indent) + : node; } - function isTagValidWithParent(tag, parentTag) { - switch (parentTag) { - case "select": - return ( - "hr" === tag || - "option" === tag || - "optgroup" === tag || - "#text" === tag - ); - case "optgroup": - return "option" === tag || "#text" === tag; - case "option": - return "#text" === tag; - case "tr": - return ( - "th" === tag || - "td" === tag || - "style" === tag || - "script" === tag || - "template" === tag - ); - case "tbody": - case "thead": - case "tfoot": - return ( - "tr" === tag || - "style" === tag || - "script" === tag || - "template" === tag - ); - case "colgroup": - return "col" === tag || "template" === tag; - case "table": - return ( - "caption" === tag || - "colgroup" === tag || - "tbody" === tag || - "tfoot" === tag || - "thead" === tag || - "style" === tag || - "script" === tag || - "template" === tag - ); - case "head": - return ( - "base" === tag || - "basefont" === tag || - "bgsound" === tag || - "link" === tag || - "meta" === tag || - "title" === tag || - "noscript" === tag || - "noframes" === tag || - "style" === tag || - "script" === tag || - "template" === tag - ); - case "html": - return "head" === tag || "body" === tag || "frameset" === tag; - case "frameset": - return "frame" === tag; - case "#document": - return "html" === tag; - } - switch (tag) { - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": + function indentation(indent) { + return " " + " ".repeat(indent); + } + function added(indent) { + return "+ " + " ".repeat(indent); + } + function removed(indent) { + return "- " + " ".repeat(indent); + } + function describeFiberType(fiber) { + switch (fiber.tag) { + case 26: + case 27: + case 5: + return fiber.type; + case 16: + return "Lazy"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 0: + case 15: + return (fiber = fiber.type), fiber.displayName || fiber.name || null; + case 11: return ( - "h1" !== parentTag && - "h2" !== parentTag && - "h3" !== parentTag && - "h4" !== parentTag && - "h5" !== parentTag && - "h6" !== parentTag + (fiber = fiber.type.render), fiber.displayName || fiber.name || null ); - case "rp": - case "rt": - return -1 === impliedEndTags.indexOf(parentTag); - case "body": - case "caption": - case "col": - case "colgroup": - case "frameset": - case "frame": - case "head": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return null == parentTag; + case 1: + return (fiber = fiber.type), fiber.displayName || fiber.name || null; + default: + return null; } - return !0; } - function findInvalidAncestorForTag(tag, ancestorInfo) { - switch (tag) { - case "address": - case "article": - case "aside": - case "blockquote": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "main": - case "menu": - case "nav": - case "ol": - case "p": - case "section": - case "summary": - case "ul": - case "pre": - case "listing": - case "table": - case "hr": - case "xmp": - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - return ancestorInfo.pTagInButtonScope; - case "form": - return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; - case "li": - return ancestorInfo.listItemTagAutoclosing; - case "dd": - case "dt": - return ancestorInfo.dlItemTagAutoclosing; - case "button": - return ancestorInfo.buttonTagInScope; - case "a": - return ancestorInfo.aTagInScope; - case "nobr": - return ancestorInfo.nobrTagInScope; + function describeTextNode(content, maxLength) { + return needsEscaping.test(content) + ? ((content = JSON.stringify(content)), + content.length > maxLength - 2 + ? 8 > maxLength + ? '{"..."}' + : "{" + content.slice(0, maxLength - 7) + '..."}' + : "{" + content + "}") + : content.length > maxLength + ? 5 > maxLength + ? '{"..."}' + : content.slice(0, maxLength - 3) + "..." + : content; + } + function describeTextDiff(clientText, serverProps, indent) { + var maxLength = 120 - 2 * indent; + if (null === serverProps) + return added(indent) + describeTextNode(clientText, maxLength) + "\n"; + if ("string" === typeof serverProps) { + for ( + var firstDiff = 0; + firstDiff < serverProps.length && + firstDiff < clientText.length && + serverProps.charCodeAt(firstDiff) === + clientText.charCodeAt(firstDiff); + firstDiff++ + ); + firstDiff > maxLength - 8 && + 10 < firstDiff && + ((clientText = "..." + clientText.slice(firstDiff - 8)), + (serverProps = "..." + serverProps.slice(firstDiff - 8))); + return ( + added(indent) + + describeTextNode(clientText, maxLength) + + "\n" + + removed(indent) + + describeTextNode(serverProps, maxLength) + + "\n" + ); } - return null; + return ( + indentation(indent) + describeTextNode(clientText, maxLength) + "\n" + ); } - function validateDOMNesting(childTag, ancestorInfo) { - ancestorInfo = ancestorInfo || emptyAncestorInfoDev; - var parentInfo = ancestorInfo.current; - ancestorInfo = (parentInfo = isTagValidWithParent( - childTag, - parentInfo && parentInfo.tag - ) - ? null - : parentInfo) - ? null - : findInvalidAncestorForTag(childTag, ancestorInfo); - ancestorInfo = parentInfo || ancestorInfo; - if (!ancestorInfo) return !0; - ancestorInfo = ancestorInfo.tag; - var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - warnKey = "<" + childTag + ">"; - parentInfo - ? ((parentInfo = ""), - "table" === ancestorInfo && - "tr" === childTag && - (parentInfo += - " Add a , or to your code to match the DOM tree generated by the browser."), - console.error( - "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", - warnKey, - ancestorInfo, - parentInfo, - getCurrentParentStackInDev() - )) - : console.error( - "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", - warnKey, - ancestorInfo, - getCurrentParentStackInDev() - ); - return !1; + function objectName(object) { + return Object.prototype.toString + .call(object) + .replace(/^\[object (.*)\]$/, function (m, p0) { + return p0; + }); } - function validateTextNesting(childText, parentTag) { - if (isTagValidWithParent("#text", parentTag)) return !0; - var warnKey = "#text|" + parentTag; - if (didWarn[warnKey]) return !1; - didWarn[warnKey] = !0; - /\S/.test(childText) - ? console.error( - "In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.%s", - parentTag, - getCurrentParentStackInDev() - ) - : console.error( - "In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.%s", - parentTag, - getCurrentParentStackInDev() + function describeValue(value, maxLength) { + switch (typeof value) { + case "string": + return ( + (value = JSON.stringify(value)), + value.length > maxLength + ? 5 > maxLength + ? '"..."' + : value.slice(0, maxLength - 4) + '..."' + : value ); - return !1; - } - function setTextContent(node, text) { - if (text) { - var firstChild = node.firstChild; - if ( - firstChild && - firstChild === node.lastChild && - 3 === firstChild.nodeType - ) { - firstChild.nodeValue = text; - return; - } + case "object": + if (null === value) return "null"; + if (isArrayImpl(value)) return "[...]"; + if (value.$$typeof === REACT_ELEMENT_TYPE) + return (maxLength = getComponentNameFromType(value.type)) + ? "<" + maxLength + ">" + : "<...>"; + var name = objectName(value); + if ("Object" === name) { + name = ""; + maxLength -= 2; + for (var propName in value) + if (value.hasOwnProperty(propName)) { + var jsonPropName = JSON.stringify(propName); + jsonPropName !== '"' + propName + '"' && + (propName = jsonPropName); + maxLength -= propName.length - 2; + jsonPropName = describeValue( + value[propName], + 15 > maxLength ? maxLength : 15 + ); + maxLength -= jsonPropName.length; + if (0 > maxLength) { + name += "" === name ? "..." : ", ..."; + break; + } + name += + ("" === name ? "" : ",") + propName + ":" + jsonPropName; + } + return "{" + name + "}"; + } + return name; + case "function": + return (maxLength = value.displayName || value.name) + ? "function " + maxLength + : "function"; + default: + return String(value); } - node.textContent = text; } - function camelize(string) { - return string.replace(hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); + function describePropValue(value, maxLength) { + return "string" !== typeof value || needsEscaping.test(value) + ? "{" + describeValue(value, maxLength - 2) + "}" + : value.length > maxLength - 2 + ? 5 > maxLength + ? '"..."' + : '"' + value.slice(0, maxLength - 5) + '..."' + : '"' + value + '"'; } - function setValueForStyle(style, styleName, value) { - var isCustomProperty = 0 === styleName.indexOf("--"); - isCustomProperty || - (-1 < styleName.indexOf("-") - ? (warnedStyleNames.hasOwnProperty(styleName) && - warnedStyleNames[styleName]) || - ((warnedStyleNames[styleName] = !0), - error$jscomp$0( - "Unsupported style property %s. Did you mean %s?", - styleName, - camelize(styleName.replace(msPattern, "ms-")) - )) - : badVendoredStyleNamePattern.test(styleName) - ? (warnedStyleNames.hasOwnProperty(styleName) && - warnedStyleNames[styleName]) || - ((warnedStyleNames[styleName] = !0), - error$jscomp$0( - "Unsupported vendor-prefixed style property %s. Did you mean %s?", - styleName, - styleName.charAt(0).toUpperCase() + styleName.slice(1) - )) - : !badStyleValueWithSemicolonPattern.test(value) || - (warnedStyleValues.hasOwnProperty(value) && - warnedStyleValues[value]) || - ((warnedStyleValues[value] = !0), - error$jscomp$0( - 'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.', - styleName, - value.replace(badStyleValueWithSemicolonPattern, "") - )), - "number" === typeof value && - (isNaN(value) - ? warnedForNaNValue || - ((warnedForNaNValue = !0), - error$jscomp$0( - "`NaN` is an invalid value for the `%s` css style property.", - styleName - )) - : isFinite(value) || - warnedForInfinityValue || - ((warnedForInfinityValue = !0), - error$jscomp$0( - "`Infinity` is an invalid value for the `%s` css style property.", - styleName - )))); - null == value || "boolean" === typeof value || "" === value - ? isCustomProperty - ? style.setProperty(styleName, "") - : "float" === styleName - ? (style.cssFloat = "") - : (style[styleName] = "") - : isCustomProperty - ? style.setProperty(styleName, value) - : "number" !== typeof value || - 0 === value || - unitlessNumbers.has(styleName) - ? "float" === styleName - ? (style.cssFloat = value) - : (checkCSSPropertyStringCoercion(value, styleName), - (style[styleName] = ("" + value).trim())) - : (style[styleName] = value + "px"); + function describeExpandedElement(type, props, rowPrefix) { + var remainingRowLength = 120 - rowPrefix.length - type.length, + properties = [], + propName; + for (propName in props) + if (props.hasOwnProperty(propName) && "children" !== propName) { + var propValue = describePropValue( + props[propName], + 120 - rowPrefix.length - propName.length - 1 + ); + remainingRowLength -= propName.length + propValue.length + 2; + properties.push(propName + "=" + propValue); + } + return 0 === properties.length + ? rowPrefix + "<" + type + ">\n" + : 0 < remainingRowLength + ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" + : rowPrefix + + "<" + + type + + "\n" + + rowPrefix + + " " + + properties.join("\n" + rowPrefix + " ") + + "\n" + + rowPrefix + + ">\n"; } - function setValueForStyles(node, styles, prevStyles) { - if (null != styles && "object" !== typeof styles) - throw Error( - "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." - ); - styles && Object.freeze(styles); - node = node.style; - if (null != prevStyles) { - if (styles) { - var expandedUpdates = {}; - if (prevStyles) - for (var key in prevStyles) - if (prevStyles.hasOwnProperty(key) && !styles.hasOwnProperty(key)) - for ( - var longhands = shorthandToLonghand[key] || [key], i = 0; - i < longhands.length; - i++ - ) - expandedUpdates[longhands[i]] = key; - for (var _key in styles) - if ( - styles.hasOwnProperty(_key) && - (!prevStyles || prevStyles[_key] !== styles[_key]) - ) - for ( - key = shorthandToLonghand[_key] || [_key], longhands = 0; - longhands < key.length; - longhands++ - ) - expandedUpdates[key[longhands]] = _key; - _key = {}; - for (var key$jscomp$0 in styles) - for ( - key = shorthandToLonghand[key$jscomp$0] || [key$jscomp$0], - longhands = 0; - longhands < key.length; - longhands++ - ) - _key[key[longhands]] = key$jscomp$0; - key$jscomp$0 = {}; - for (var _key2 in expandedUpdates) - (key = expandedUpdates[_key2]), - (longhands = _key[_key2]) && - key !== longhands && - ((i = key + "," + longhands), - key$jscomp$0[i] || - ((key$jscomp$0[i] = !0), - (i = styles[key]), - error$jscomp$0( - "%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", - null == i || "boolean" === typeof i || "" === i - ? "Removing" - : "Updating", - key, - longhands - ))); + function describePropertiesDiff(clientObject, serverObject, indent) { + var properties = "", + remainingServerProperties = assign({}, serverObject), + propName; + for (propName in clientObject) + if (clientObject.hasOwnProperty(propName)) { + delete remainingServerProperties[propName]; + var maxLength = 120 - 2 * indent - propName.length - 2, + clientPropValue = describeValue(clientObject[propName], maxLength); + serverObject.hasOwnProperty(propName) + ? ((maxLength = describeValue(serverObject[propName], maxLength)), + (properties += + added(indent) + propName + ": " + clientPropValue + "\n"), + (properties += + removed(indent) + propName + ": " + maxLength + "\n")) + : (properties += + added(indent) + propName + ": " + clientPropValue + "\n"); } - for (var styleName in prevStyles) - !prevStyles.hasOwnProperty(styleName) || - (null != styles && styles.hasOwnProperty(styleName)) || - (0 === styleName.indexOf("--") - ? node.setProperty(styleName, "") - : "float" === styleName - ? (node.cssFloat = "") - : (node[styleName] = "")); - for (var _styleName in styles) - (_key2 = styles[_styleName]), - styles.hasOwnProperty(_styleName) && - prevStyles[_styleName] !== _key2 && - setValueForStyle(node, _styleName, _key2); - } else - for (expandedUpdates in styles) - styles.hasOwnProperty(expandedUpdates) && - setValueForStyle(node, expandedUpdates, styles[expandedUpdates]); + for (var _propName in remainingServerProperties) + remainingServerProperties.hasOwnProperty(_propName) && + ((clientObject = describeValue( + remainingServerProperties[_propName], + 120 - 2 * indent - _propName.length - 2 + )), + (properties += + removed(indent) + _propName + ": " + clientObject + "\n")); + return properties; } - function isCustomElement(tagName) { - if (-1 === tagName.indexOf("-")) return !1; - switch (tagName) { - case "annotation-xml": - case "color-profile": - case "font-face": - case "font-face-src": - case "font-face-uri": - case "font-face-format": - case "font-face-name": - case "missing-glyph": - return !1; - default: - return !0; + function describeElementDiff(type, clientProps, serverProps, indent) { + var content = "", + serverPropNames = new Map(); + for (propName$jscomp$0 in serverProps) + serverProps.hasOwnProperty(propName$jscomp$0) && + serverPropNames.set( + propName$jscomp$0.toLowerCase(), + propName$jscomp$0 + ); + if (1 === serverPropNames.size && serverPropNames.has("children")) + content += describeExpandedElement( + type, + clientProps, + indentation(indent) + ); + else { + for (var _propName2 in clientProps) + if ( + clientProps.hasOwnProperty(_propName2) && + "children" !== _propName2 + ) { + var maxLength$jscomp$0 = + 120 - 2 * (indent + 1) - _propName2.length - 1, + serverPropName = serverPropNames.get(_propName2.toLowerCase()); + if (void 0 !== serverPropName) { + serverPropNames.delete(_propName2.toLowerCase()); + var propName$jscomp$0 = clientProps[_propName2]; + serverPropName = serverProps[serverPropName]; + var clientPropValue = describePropValue( + propName$jscomp$0, + maxLength$jscomp$0 + ); + maxLength$jscomp$0 = describePropValue( + serverPropName, + maxLength$jscomp$0 + ); + "object" === typeof propName$jscomp$0 && + null !== propName$jscomp$0 && + "object" === typeof serverPropName && + null !== serverPropName && + "Object" === objectName(propName$jscomp$0) && + "Object" === objectName(serverPropName) && + (2 < Object.keys(propName$jscomp$0).length || + 2 < Object.keys(serverPropName).length || + -1 < clientPropValue.indexOf("...") || + -1 < maxLength$jscomp$0.indexOf("...")) + ? (content += + indentation(indent + 1) + + _propName2 + + "={{\n" + + describePropertiesDiff( + propName$jscomp$0, + serverPropName, + indent + 2 + ) + + indentation(indent + 1) + + "}}\n") + : ((content += + added(indent + 1) + + _propName2 + + "=" + + clientPropValue + + "\n"), + (content += + removed(indent + 1) + + _propName2 + + "=" + + maxLength$jscomp$0 + + "\n")); + } else + content += + indentation(indent + 1) + + _propName2 + + "=" + + describePropValue(clientProps[_propName2], maxLength$jscomp$0) + + "\n"; + } + serverPropNames.forEach(function (propName) { + if ("children" !== propName) { + var maxLength = 120 - 2 * (indent + 1) - propName.length - 1; + content += + removed(indent + 1) + + propName + + "=" + + describePropValue(serverProps[propName], maxLength) + + "\n"; + } + }); + content = + "" === content + ? indentation(indent) + "<" + type + ">\n" + : indentation(indent) + + "<" + + type + + "\n" + + content + + indentation(indent) + + ">\n"; } + type = serverProps.children; + clientProps = clientProps.children; + if ( + "string" === typeof type || + "number" === typeof type || + "bigint" === typeof type + ) { + serverPropNames = ""; + if ( + "string" === typeof clientProps || + "number" === typeof clientProps || + "bigint" === typeof clientProps + ) + serverPropNames = "" + clientProps; + content += describeTextDiff(serverPropNames, "" + type, indent + 1); + } else if ( + "string" === typeof clientProps || + "number" === typeof clientProps || + "bigint" === typeof clientProps + ) + content = + null == type + ? content + describeTextDiff("" + clientProps, null, indent + 1) + : content + describeTextDiff("" + clientProps, void 0, indent + 1); + return content; } - function getAttributeAlias(name) { - return aliases.get(name) || name; + function describeSiblingFiber(fiber, indent) { + var type = describeFiberType(fiber); + if (null === type) { + type = ""; + for (fiber = fiber.child; fiber; ) + (type += describeSiblingFiber(fiber, indent)), + (fiber = fiber.sibling); + return type; + } + return indentation(indent) + "<" + type + ">\n"; } - function validateProperty$1(tagName, name) { + function describeNode(node, indent) { + var skipToNode = findNotableNode(node, indent); if ( - hasOwnProperty.call(warnedProperties$1, name) && - warnedProperties$1[name] + skipToNode !== node && + (1 !== node.children.length || node.children[0] !== skipToNode) ) - return !0; - if (rARIACamel$1.test(name)) { - tagName = "aria-" + name.slice(4).toLowerCase(); - tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null; - if (null == tagName) - return ( - error$jscomp$0( - "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", - name - ), - (warnedProperties$1[name] = !0) - ); - if (name !== tagName) - return ( - error$jscomp$0( - "Invalid ARIA attribute `%s`. Did you mean `%s`?", - name, - tagName - ), - (warnedProperties$1[name] = !0) - ); - } - if (rARIA$1.test(name)) { - tagName = name.toLowerCase(); - tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null; - if (null == tagName) return (warnedProperties$1[name] = !0), !1; - name !== tagName && - (error$jscomp$0( - "Unknown ARIA attribute `%s`. Did you mean `%s`?", - name, - tagName - ), - (warnedProperties$1[name] = !0)); - } - return !0; - } - function validateProperties$2(type, props) { - var invalidProps = [], - key; - for (key in props) - validateProperty$1(type, key) || invalidProps.push(key); - props = invalidProps - .map(function (prop) { - return "`" + prop + "`"; - }) - .join(", "); - 1 === invalidProps.length - ? error$jscomp$0( - "Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props", - props, - type - ) - : 1 < invalidProps.length && - error$jscomp$0( - "Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props", - props, - type - ); - } - function validateProperty(tagName, name, value, eventRegistry) { - if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) - return !0; - var lowerCasedName = name.toLowerCase(); - if ("onfocusin" === lowerCasedName || "onfocusout" === lowerCasedName) return ( - error$jscomp$0( - "React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React." - ), - (warnedProperties[name] = !0) + indentation(indent) + "...\n" + describeNode(skipToNode, indent + 1) ); - if ( - "function" === typeof value && - (("form" === tagName && "action" === name) || - ("input" === tagName && "formAction" === name) || - ("button" === tagName && "formAction" === name)) + skipToNode = ""; + var debugInfo = node.fiber._debugInfo; + if (debugInfo) + for (var i = 0; i < debugInfo.length; i++) { + var serverComponentName = debugInfo[i].name; + "string" === typeof serverComponentName && + ((skipToNode += + indentation(indent) + "<" + serverComponentName + ">\n"), + indent++); + } + debugInfo = ""; + i = node.fiber.pendingProps; + if (6 === node.fiber.tag) + (debugInfo = describeTextDiff(i, node.serverProps, indent)), indent++; + else if ( + ((serverComponentName = describeFiberType(node.fiber)), + null !== serverComponentName) ) - return !0; - if (null != eventRegistry) { - tagName = eventRegistry.possibleRegistrationNames; - if (eventRegistry.registrationNameDependencies.hasOwnProperty(name)) - return !0; - eventRegistry = tagName.hasOwnProperty(lowerCasedName) - ? tagName[lowerCasedName] - : null; - if (null != eventRegistry) + if (void 0 === node.serverProps) { + debugInfo = indent; + var maxLength = 120 - 2 * debugInfo - serverComponentName.length - 2, + content = ""; + for (propName in i) + if (i.hasOwnProperty(propName) && "children" !== propName) { + var propValue = describePropValue(i[propName], 15); + maxLength -= propName.length + propValue.length + 2; + if (0 > maxLength) { + content += " ..."; + break; + } + content += " " + propName + "=" + propValue; + } + debugInfo = + indentation(debugInfo) + + "<" + + serverComponentName + + content + + ">\n"; + indent++; + } else + null === node.serverProps + ? ((debugInfo = describeExpandedElement( + serverComponentName, + i, + added(indent) + )), + indent++) + : "string" === typeof node.serverProps + ? error$jscomp$0( + "Should not have matched a non HostText fiber to a Text node. This is a bug in React." + ) + : ((debugInfo = describeElementDiff( + serverComponentName, + i, + node.serverProps, + indent + )), + indent++); + var propName = ""; + i = node.fiber.child; + for ( + serverComponentName = 0; + i && serverComponentName < node.children.length; + + ) + (maxLength = node.children[serverComponentName]), + maxLength.fiber === i + ? ((propName += describeNode(maxLength, indent)), + serverComponentName++) + : (propName += describeSiblingFiber(i, indent)), + (i = i.sibling); + i && + 0 < node.children.length && + (propName += indentation(indent) + "...\n"); + i = node.serverTail; + null === node.serverProps && indent--; + for (node = 0; node < i.length; node++) + (serverComponentName = i[node]), + (propName = + "string" === typeof serverComponentName + ? propName + + (removed(indent) + + describeTextNode(serverComponentName, 120 - 2 * indent) + + "\n") + : propName + + describeExpandedElement( + serverComponentName.type, + serverComponentName.props, + removed(indent) + )); + return skipToNode + debugInfo + propName; + } + function describeDiff(rootNode) { + try { + return "\n\n" + describeNode(rootNode, 0); + } catch (x) { + return ""; + } + } + function describeAncestors(ancestor, child, props) { + for (var fiber = child, node = null, distanceFromLeaf = 0; fiber; ) + fiber === ancestor && (distanceFromLeaf = 0), + (node = { + fiber: fiber, + children: null !== node ? [node] : [], + serverProps: + fiber === child ? props : fiber === ancestor ? null : void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }), + distanceFromLeaf++, + (fiber = fiber.return); + return null !== node ? describeDiff(node).replaceAll(/^[+-]/gm, ">") : ""; + } + function updatedAncestorInfoDev(oldInfo, tag) { + oldInfo = assign({}, oldInfo || emptyAncestorInfoDev); + var info = { tag: tag }; + -1 !== inScopeTags.indexOf(tag) && + ((oldInfo.aTagInScope = null), + (oldInfo.buttonTagInScope = null), + (oldInfo.nobrTagInScope = null)); + -1 !== buttonScopeTags.indexOf(tag) && (oldInfo.pTagInButtonScope = null); + -1 !== specialTags.indexOf(tag) && + "address" !== tag && + "div" !== tag && + "p" !== tag && + ((oldInfo.listItemTagAutoclosing = null), + (oldInfo.dlItemTagAutoclosing = null)); + oldInfo.current = info; + "form" === tag && (oldInfo.formTag = info); + "a" === tag && (oldInfo.aTagInScope = info); + "button" === tag && (oldInfo.buttonTagInScope = info); + "nobr" === tag && (oldInfo.nobrTagInScope = info); + "p" === tag && (oldInfo.pTagInButtonScope = info); + "li" === tag && (oldInfo.listItemTagAutoclosing = info); + if ("dd" === tag || "dt" === tag) oldInfo.dlItemTagAutoclosing = info; + "#document" === tag || "html" === tag + ? (oldInfo.containerTagInScope = null) + : oldInfo.containerTagInScope || (oldInfo.containerTagInScope = info); + return oldInfo; + } + function isTagValidWithParent(tag, parentTag) { + switch (parentTag) { + case "select": return ( - error$jscomp$0( - "Invalid event handler property `%s`. Did you mean `%s`?", - name, - eventRegistry - ), - (warnedProperties[name] = !0) + "hr" === tag || + "option" === tag || + "optgroup" === tag || + "#text" === tag ); - if (EVENT_NAME_REGEX.test(name)) + case "optgroup": + return "option" === tag || "#text" === tag; + case "option": + return "#text" === tag; + case "tr": return ( - error$jscomp$0( - "Unknown event handler property `%s`. It will be ignored.", - name - ), - (warnedProperties[name] = !0) + "th" === tag || + "td" === tag || + "style" === tag || + "script" === tag || + "template" === tag ); - } else if (EVENT_NAME_REGEX.test(name)) - return ( - INVALID_EVENT_NAME_REGEX.test(name) && - error$jscomp$0( - "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", - name - ), - (warnedProperties[name] = !0) - ); - if (rARIA.test(name) || rARIACamel.test(name)) return !0; - if ("innerhtml" === lowerCasedName) - return ( - error$jscomp$0( - "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`." - ), - (warnedProperties[name] = !0) - ); - if ("aria" === lowerCasedName) - return ( - error$jscomp$0( - "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead." - ), - (warnedProperties[name] = !0) - ); - if ( - "is" === lowerCasedName && - null !== value && - void 0 !== value && - "string" !== typeof value - ) - return ( - error$jscomp$0( - "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", - typeof value - ), - (warnedProperties[name] = !0) - ); - if ("number" === typeof value && isNaN(value)) - return ( - error$jscomp$0( - "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", - name - ), - (warnedProperties[name] = !0) - ); - if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { - if ( - ((lowerCasedName = possibleStandardNames[lowerCasedName]), - lowerCasedName !== name) - ) - return ( - error$jscomp$0( - "Invalid DOM property `%s`. Did you mean `%s`?", - name, - lowerCasedName - ), - (warnedProperties[name] = !0) + case "tbody": + case "thead": + case "tfoot": + return ( + "tr" === tag || + "style" === tag || + "script" === tag || + "template" === tag ); - } else if (name !== lowerCasedName) - return ( - error$jscomp$0( - "React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", - name, - lowerCasedName - ), - (warnedProperties[name] = !0) - ); - switch (name) { - case "dangerouslySetInnerHTML": - case "children": - case "style": - case "suppressContentEditableWarning": - case "suppressHydrationWarning": - case "defaultValue": - case "defaultChecked": - case "innerHTML": - case "ref": - return !0; - case "innerText": - case "textContent": - return !0; + case "colgroup": + return "col" === tag || "template" === tag; + case "table": + return ( + "caption" === tag || + "colgroup" === tag || + "tbody" === tag || + "tfoot" === tag || + "thead" === tag || + "style" === tag || + "script" === tag || + "template" === tag + ); + case "head": + return ( + "base" === tag || + "basefont" === tag || + "bgsound" === tag || + "link" === tag || + "meta" === tag || + "title" === tag || + "noscript" === tag || + "noframes" === tag || + "style" === tag || + "script" === tag || + "template" === tag + ); + case "html": + return "head" === tag || "body" === tag || "frameset" === tag; + case "frameset": + return "frame" === tag; + case "#document": + return "html" === tag; } - switch (typeof value) { - case "boolean": - switch (name) { - case "autoFocus": - case "checked": - case "multiple": - case "muted": - case "selected": - case "contentEditable": - case "spellCheck": - case "draggable": - case "value": - case "autoReverse": - case "externalResourcesRequired": - case "focusable": - case "preserveAlpha": - case "allowFullScreen": - case "async": - case "autoPlay": - case "controls": - case "default": - case "defer": - case "disabled": - case "disablePictureInPicture": - case "disableRemotePlayback": - case "formNoValidate": - case "hidden": - case "loop": - case "noModule": - case "noValidate": - case "open": - case "playsInline": - case "readOnly": - case "required": - case "reversed": - case "scoped": - case "seamless": - case "itemScope": - case "capture": - case "download": - case "inert": - return !0; - default: - lowerCasedName = name.toLowerCase().slice(0, 5); - if ("data-" === lowerCasedName || "aria-" === lowerCasedName) - return !0; - value - ? error$jscomp$0( - 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', - value, - name, - name, - value, - name - ) - : error$jscomp$0( - 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', - value, - name, - name, - value, - name, - name, - name - ); - return (warnedProperties[name] = !0); - } - case "function": - case "symbol": - return (warnedProperties[name] = !0), !1; - case "string": - if ("false" === value || "true" === value) { - switch (name) { - case "checked": - case "selected": - case "multiple": - case "muted": - case "allowFullScreen": - case "async": - case "autoPlay": - case "controls": - case "default": - case "defer": - case "disabled": - case "disablePictureInPicture": - case "disableRemotePlayback": - case "formNoValidate": - case "hidden": - case "loop": - case "noModule": - case "noValidate": - case "open": - case "playsInline": - case "readOnly": - case "required": - case "reversed": - case "scoped": - case "seamless": - case "itemScope": - case "inert": - break; - default: - return !0; - } - error$jscomp$0( - "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", - value, - name, - "false" === value - ? "The browser will interpret it as a truthy value." - : 'Although this works, it will not work as expected if you pass the string "false".', - name, - value - ); - warnedProperties[name] = !0; - } + switch (tag) { + case "h1": + case "h2": + case "h3": + case "h4": + case "h5": + case "h6": + return ( + "h1" !== parentTag && + "h2" !== parentTag && + "h3" !== parentTag && + "h4" !== parentTag && + "h5" !== parentTag && + "h6" !== parentTag + ); + case "rp": + case "rt": + return -1 === impliedEndTags.indexOf(parentTag); + case "body": + case "caption": + case "col": + case "colgroup": + case "frameset": + case "frame": + case "head": + case "html": + case "tbody": + case "td": + case "tfoot": + case "th": + case "thead": + case "tr": + return null == parentTag; } return !0; } - function warnUnknownProperties(type, props, eventRegistry) { - var unknownProps = [], - key; - for (key in props) - validateProperty(type, key, props[key], eventRegistry) || - unknownProps.push(key); - props = unknownProps - .map(function (prop) { - return "`" + prop + "`"; - }) - .join(", "); - 1 === unknownProps.length - ? error$jscomp$0( - "Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ", - props, - type - ) - : 1 < unknownProps.length && - error$jscomp$0( - "Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ", - props, - type - ); - } - function sanitizeURL(url) { - return isJavaScriptProtocol.test("" + url) - ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" - : url; - } - function getEventTarget(nativeEvent) { - nativeEvent = nativeEvent.target || nativeEvent.srcElement || window; - nativeEvent.correspondingUseElement && - (nativeEvent = nativeEvent.correspondingUseElement); - return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent; - } - function restoreStateOfTarget(target) { - var internalInstance = getInstanceFromNode(target); - if (internalInstance && (target = internalInstance.stateNode)) { - var props = getFiberCurrentPropsFromNode(target); - a: switch ( - ((target = internalInstance.stateNode), internalInstance.type) - ) { - case "input": - updateInput( - target, - props.value, - props.defaultValue, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name - ); - internalInstance = props.name; - if ("radio" === props.type && null != internalInstance) { - for (props = target; props.parentNode; ) props = props.parentNode; - checkAttributeStringCoercion(internalInstance, "name"); - props = props.querySelectorAll( - 'input[name="' + - escapeSelectorAttributeValueInsideDoubleQuotes( - "" + internalInstance - ) + - '"][type="radio"]' - ); - for ( - internalInstance = 0; - internalInstance < props.length; - internalInstance++ - ) { - var otherNode = props[internalInstance]; - if (otherNode !== target && otherNode.form === target.form) { - var otherProps = getFiberCurrentPropsFromNode(otherNode); - if (!otherProps) - throw Error( - "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." - ); - updateInput( - otherNode, - otherProps.value, - otherProps.defaultValue, - otherProps.defaultValue, - otherProps.checked, - otherProps.defaultChecked, - otherProps.type, - otherProps.name - ); - } - } - for ( - internalInstance = 0; - internalInstance < props.length; - internalInstance++ - ) - (otherNode = props[internalInstance]), - otherNode.form === target.form && - updateValueIfChanged(otherNode); - } - break a; - case "textarea": - updateTextarea(target, props.value, props.defaultValue); - break a; - case "select": - (internalInstance = props.value), - null != internalInstance && - updateOptions(target, !!props.multiple, internalInstance, !1); - } - } - } - function enqueueStateRestore(target) { - restoreTarget - ? restoreQueue - ? restoreQueue.push(target) - : (restoreQueue = [target]) - : (restoreTarget = target); - } - function restoreStateIfNeeded() { - if (restoreTarget) { - var target = restoreTarget, - queuedTargets = restoreQueue; - restoreQueue = restoreTarget = null; - restoreStateOfTarget(target); - if (queuedTargets) - for (target = 0; target < queuedTargets.length; target++) - restoreStateOfTarget(queuedTargets[target]); - } - } - function getMaskedContext(workInProgress, unmaskedContext) { - var contextTypes = workInProgress.type.contextTypes; - if (!contextTypes) return emptyContextObject; - var instance = workInProgress.stateNode; - if ( - instance && - instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext - ) - return instance.__reactInternalMemoizedMaskedChildContext; - var context = {}, - key; - for (key in contextTypes) context[key] = unmaskedContext[key]; - instance && - ((workInProgress = workInProgress.stateNode), - (workInProgress.__reactInternalMemoizedUnmaskedChildContext = - unmaskedContext), - (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); - return context; - } - function isContextProvider(type) { - type = type.childContextTypes; - return null !== type && void 0 !== type; - } - function popContext(fiber) { - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); - } - function popTopLevelContextObject(fiber) { - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); - } - function pushTopLevelContextObject(fiber, context, didChange) { - if (contextStackCursor.current !== emptyContextObject) - throw Error( - "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." - ); - push(contextStackCursor, context, fiber); - push(didPerformWorkStackCursor, didChange, fiber); - } - function processChildContext(fiber, type, parentContext) { - var instance = fiber.stateNode; - type = type.childContextTypes; - if ("function" !== typeof instance.getChildContext) - return ( - (fiber = getComponentNameFromFiber(fiber) || "Unknown"), - warnedAboutMissingGetChildContext[fiber] || - ((warnedAboutMissingGetChildContext[fiber] = !0), - error$jscomp$0( - "%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", - fiber, - fiber - )), - parentContext - ); - instance = instance.getChildContext(); - for (var contextKey in instance) - if (!(contextKey in type)) - throw Error( - (getComponentNameFromFiber(fiber) || "Unknown") + - '.getChildContext(): key "' + - contextKey + - '" is not defined in childContextTypes.' - ); - return assign({}, parentContext, instance); - } - function pushContextProvider(workInProgress) { - var instance = workInProgress.stateNode; - instance = - (instance && instance.__reactInternalMemoizedMergedChildContext) || - emptyContextObject; - previousContext = contextStackCursor.current; - push(contextStackCursor, instance, workInProgress); - push( - didPerformWorkStackCursor, - didPerformWorkStackCursor.current, - workInProgress - ); - return !0; - } - function invalidateContextProvider(workInProgress, type, didChange) { - var instance = workInProgress.stateNode; - if (!instance) - throw Error( - "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." - ); - didChange - ? ((type = processChildContext(workInProgress, type, previousContext)), - (instance.__reactInternalMemoizedMergedChildContext = type), - pop(didPerformWorkStackCursor, workInProgress), - pop(contextStackCursor, workInProgress), - push(contextStackCursor, type, workInProgress)) - : pop(didPerformWorkStackCursor, workInProgress); - push(didPerformWorkStackCursor, didChange, workInProgress); - } - function is(x, y) { - return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); - } - function formatLanes(laneOrLanes) { - return "0b" + laneOrLanes.toString(2).padStart(31, "0"); - } - function group() { - for ( - var _len = arguments.length, groupArgs = Array(_len), _key = 0; - _key < _len; - _key++ - ) - groupArgs[_key] = arguments[_key]; - pendingGroupArgs.push(groupArgs); - null === nativeConsoleLog && - ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); - } - function groupEnd() { - for ( - pendingGroupArgs.pop(); - printedGroupIndex >= pendingGroupArgs.length; - - ) - nativeConsole.groupEnd(), printedGroupIndex--; - 0 === pendingGroupArgs.length && - ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); - } - function log() { - if (printedGroupIndex < pendingGroupArgs.length - 1) { - for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) - nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); - printedGroupIndex = pendingGroupArgs.length - 1; - } - "function" === typeof nativeConsoleLog - ? nativeConsoleLog.apply(void 0, arguments) - : nativeConsole.log.apply(nativeConsole, arguments); - } - function getWakeableID(wakeable) { - wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); - return wakeableIDs.get(wakeable); + function findInvalidAncestorForTag(tag, ancestorInfo) { + switch (tag) { + case "address": + case "article": + case "aside": + case "blockquote": + case "center": + case "details": + case "dialog": + case "dir": + case "div": + case "dl": + case "fieldset": + case "figcaption": + case "figure": + case "footer": + case "header": + case "hgroup": + case "main": + case "menu": + case "nav": + case "ol": + case "p": + case "section": + case "summary": + case "ul": + case "pre": + case "listing": + case "table": + case "hr": + case "xmp": + case "h1": + case "h2": + case "h3": + case "h4": + case "h5": + case "h6": + return ancestorInfo.pTagInButtonScope; + case "form": + return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; + case "li": + return ancestorInfo.listItemTagAutoclosing; + case "dd": + case "dt": + return ancestorInfo.dlItemTagAutoclosing; + case "button": + return ancestorInfo.buttonTagInScope; + case "a": + return ancestorInfo.aTagInScope; + case "nobr": + return ancestorInfo.nobrTagInScope; + } + return null; } - function logComponentSuspended(componentName, wakeable) { - if (enableDebugTracing) { - var id = getWakeableID(wakeable), - display = wakeable.displayName || wakeable; - log( - "%c\u269b\ufe0f%c " + componentName + " suspended", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - wakeable.then( - function () { - log( - "%c\u269b\ufe0f%c " + componentName + " resolved", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - }, - function () { - log( - "%c\u269b\ufe0f%c " + componentName + " rejected", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #80366d; font-weight: bold;", - id, - display - ); - } - ); + function findAncestor(parent, tagName) { + for (; parent; ) { + switch (parent.tag) { + case 5: + case 26: + case 27: + if (parent.type === tagName) return parent; + } + parent = parent.return; } + return null; } - function logRenderStarted(lanes) { - enableDebugTracing && - group( - "%c\u269b\ufe0f%c render%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); + function validateDOMNesting(childTag, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfoDev; + var parentInfo = ancestorInfo.current; + ancestorInfo = (parentInfo = isTagValidWithParent( + childTag, + parentInfo && parentInfo.tag + ) + ? null + : parentInfo) + ? null + : findInvalidAncestorForTag(childTag, ancestorInfo); + ancestorInfo = parentInfo || ancestorInfo; + if (!ancestorInfo) return !0; + ancestorInfo = ancestorInfo.tag; + var warnKey = String(!!parentInfo) + "|" + childTag + "|" + ancestorInfo; + if (didWarn[warnKey]) return !1; + didWarn[warnKey] = !0; + var ancestor = (warnKey = current) + ? findAncestor(warnKey.return, ancestorInfo) + : null; + warnKey = + null !== warnKey && null !== ancestor + ? describeAncestors(ancestor, warnKey, null) + : ""; + ancestor = "<" + childTag + ">"; + parentInfo + ? ((parentInfo = ""), + "table" === ancestorInfo && + "tr" === childTag && + (parentInfo += + " Add a , or to your code to match the DOM tree generated by the browser."), + error$jscomp$0( + "In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s", + ancestor, + ancestorInfo, + parentInfo, + warnKey + )) + : error$jscomp$0( + "In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s", + ancestor, + ancestorInfo, + warnKey + ); + return !1; } - function logStateUpdateScheduled(componentName, lane, payloadOrAction) { - enableDebugTracing && - log( - "%c\u269b\ufe0f%c " + - componentName + - " updated state %c(" + - formatLanes(lane) + - ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "color: #01a252; font-weight: bold;", - "", - payloadOrAction - ); + function validateTextNesting(childText, parentTag) { + if (isTagValidWithParent("#text", parentTag)) return !0; + var warnKey = "#text|" + parentTag; + if (didWarn[warnKey]) return !1; + didWarn[warnKey] = !0; + var ancestor = (warnKey = current) + ? findAncestor(warnKey, parentTag) + : null; + warnKey = + null !== warnKey && null !== ancestor + ? describeAncestors( + ancestor, + warnKey, + 6 !== warnKey.tag ? { children: null } : null + ) + : ""; + /\S/.test(childText) + ? error$jscomp$0( + "In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.%s", + parentTag, + warnKey + ) + : error$jscomp$0( + "In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.%s", + parentTag, + warnKey + ); + return !1; } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var stack = CapturedStacks.get(value); - "string" !== typeof stack && - ((stack = getStackByFiberInDevAndProd(source)), - CapturedStacks.set(value, stack)); - } else stack = getStackByFiberInDevAndProd(source); - return { value: value, source: source, stack: stack }; + function setTextContent(node, text) { + if (text) { + var firstChild = node.firstChild; + if ( + firstChild && + firstChild === node.lastChild && + 3 === firstChild.nodeType + ) { + firstChild.nodeValue = text; + return; + } + } + node.textContent = text; } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; + function camelize(string) { + return string.replace(hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; + function setValueForStyle(style, styleName, value) { + var isCustomProperty = 0 === styleName.indexOf("--"); + isCustomProperty || + (-1 < styleName.indexOf("-") + ? (warnedStyleNames.hasOwnProperty(styleName) && + warnedStyleNames[styleName]) || + ((warnedStyleNames[styleName] = !0), + error$jscomp$0( + "Unsupported style property %s. Did you mean %s?", + styleName, + camelize(styleName.replace(msPattern, "ms-")) + )) + : badVendoredStyleNamePattern.test(styleName) + ? (warnedStyleNames.hasOwnProperty(styleName) && + warnedStyleNames[styleName]) || + ((warnedStyleNames[styleName] = !0), + error$jscomp$0( + "Unsupported vendor-prefixed style property %s. Did you mean %s?", + styleName, + styleName.charAt(0).toUpperCase() + styleName.slice(1) + )) + : !badStyleValueWithSemicolonPattern.test(value) || + (warnedStyleValues.hasOwnProperty(value) && + warnedStyleValues[value]) || + ((warnedStyleValues[value] = !0), + error$jscomp$0( + 'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.', + styleName, + value.replace(badStyleValueWithSemicolonPattern, "") + )), + "number" === typeof value && + (isNaN(value) + ? warnedForNaNValue || + ((warnedForNaNValue = !0), + error$jscomp$0( + "`NaN` is an invalid value for the `%s` css style property.", + styleName + )) + : isFinite(value) || + warnedForInfinityValue || + ((warnedForInfinityValue = !0), + error$jscomp$0( + "`Infinity` is an invalid value for the `%s` css style property.", + styleName + )))); + null == value || "boolean" === typeof value || "" === value + ? isCustomProperty + ? style.setProperty(styleName, "") + : "float" === styleName + ? (style.cssFloat = "") + : (style[styleName] = "") + : isCustomProperty + ? style.setProperty(styleName, value) + : "number" !== typeof value || + 0 === value || + unitlessNumbers.has(styleName) + ? "float" === styleName + ? (style.cssFloat = value) + : (checkCSSPropertyStringCoercion(value, styleName), + (style[styleName] = ("" + value).trim())) + : (style[styleName] = value + "px"); + } + function setValueForStyles(node, styles, prevStyles) { + if (null != styles && "object" !== typeof styles) + throw Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ); + styles && Object.freeze(styles); + node = node.style; + if (null != prevStyles) { + if (styles) { + var expandedUpdates = {}; + if (prevStyles) + for (var key in prevStyles) + if (prevStyles.hasOwnProperty(key) && !styles.hasOwnProperty(key)) + for ( + var longhands = shorthandToLonghand[key] || [key], i = 0; + i < longhands.length; + i++ + ) + expandedUpdates[longhands[i]] = key; + for (var _key in styles) + if ( + styles.hasOwnProperty(_key) && + (!prevStyles || prevStyles[_key] !== styles[_key]) + ) + for ( + key = shorthandToLonghand[_key] || [_key], longhands = 0; + longhands < key.length; + longhands++ + ) + expandedUpdates[key[longhands]] = _key; + _key = {}; + for (var key$jscomp$0 in styles) + for ( + key = shorthandToLonghand[key$jscomp$0] || [key$jscomp$0], + longhands = 0; + longhands < key.length; + longhands++ + ) + _key[key[longhands]] = key$jscomp$0; + key$jscomp$0 = {}; + for (var _key2 in expandedUpdates) + (key = expandedUpdates[_key2]), + (longhands = _key[_key2]) && + key !== longhands && + ((i = key + "," + longhands), + key$jscomp$0[i] || + ((key$jscomp$0[i] = !0), + (i = styles[key]), + error$jscomp$0( + "%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.", + null == i || "boolean" === typeof i || "" === i + ? "Removing" + : "Updating", + key, + longhands + ))); + } + for (var styleName in prevStyles) + !prevStyles.hasOwnProperty(styleName) || + (null != styles && styles.hasOwnProperty(styleName)) || + (0 === styleName.indexOf("--") + ? node.setProperty(styleName, "") + : "float" === styleName + ? (node.cssFloat = "") + : (node[styleName] = "")); + for (var _styleName in styles) + (_key2 = styles[_styleName]), + styles.hasOwnProperty(_styleName) && + prevStyles[_styleName] !== _key2 && + setValueForStyle(node, _styleName, _key2); } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); - } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); - } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); - } - function warnIfNotHydrating() { - isHydrating || - error$jscomp$0( - "Expected to be hydrating. This is a bug in React. Please file an issue." - ); - } - function findNotableNode(node, indent) { - return void 0 === node.serverProps && - 0 === node.serverTail.length && - 1 === node.children.length && - 3 < node.distanceFromLeaf && - node.distanceFromLeaf > 15 - indent - ? findNotableNode(node.children[0], indent) - : node; - } - function indentation(indent) { - return " " + " ".repeat(indent); + for (expandedUpdates in styles) + styles.hasOwnProperty(expandedUpdates) && + setValueForStyle(node, expandedUpdates, styles[expandedUpdates]); } - function added(indent) { - return "+ " + " ".repeat(indent); + function isCustomElement(tagName) { + if (-1 === tagName.indexOf("-")) return !1; + switch (tagName) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return !1; + default: + return !0; + } } - function removed(indent) { - return "- " + " ".repeat(indent); + function getAttributeAlias(name) { + return aliases.get(name) || name; } - function describeFiberType(fiber) { - switch (fiber.tag) { - case 26: - case 27: - case 5: - return fiber.type; - case 16: - return "Lazy"; - case 13: - return "Suspense"; - case 19: - return "SuspenseList"; - case 0: - case 15: - return (fiber = fiber.type), fiber.displayName || fiber.name || null; - case 11: + function validateProperty$1(tagName, name) { + if ( + hasOwnProperty.call(warnedProperties$1, name) && + warnedProperties$1[name] + ) + return !0; + if (rARIACamel$1.test(name)) { + tagName = "aria-" + name.slice(4).toLowerCase(); + tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null; + if (null == tagName) return ( - (fiber = fiber.type.render), fiber.displayName || fiber.name || null + error$jscomp$0( + "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", + name + ), + (warnedProperties$1[name] = !0) ); - case 1: - return (fiber = fiber.type), fiber.displayName || fiber.name || null; - default: - return null; + if (name !== tagName) + return ( + error$jscomp$0( + "Invalid ARIA attribute `%s`. Did you mean `%s`?", + name, + tagName + ), + (warnedProperties$1[name] = !0) + ); + } + if (rARIA$1.test(name)) { + tagName = name.toLowerCase(); + tagName = ariaProperties.hasOwnProperty(tagName) ? tagName : null; + if (null == tagName) return (warnedProperties$1[name] = !0), !1; + name !== tagName && + (error$jscomp$0( + "Unknown ARIA attribute `%s`. Did you mean `%s`?", + name, + tagName + ), + (warnedProperties$1[name] = !0)); } + return !0; } - function describeTextNode(content, maxLength) { - return needsEscaping.test(content) - ? ((content = JSON.stringify(content)), - content.length > maxLength - 2 - ? 8 > maxLength - ? '{"..."}' - : "{" + content.slice(0, maxLength - 7) + '..."}' - : "{" + content + "}") - : content.length > maxLength - ? 5 > maxLength - ? '{"..."}' - : content.slice(0, maxLength - 3) + "..." - : content; + function validateProperties$2(type, props) { + var invalidProps = [], + key; + for (key in props) + validateProperty$1(type, key) || invalidProps.push(key); + props = invalidProps + .map(function (prop) { + return "`" + prop + "`"; + }) + .join(", "); + 1 === invalidProps.length + ? error$jscomp$0( + "Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props", + props, + type + ) + : 1 < invalidProps.length && + error$jscomp$0( + "Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props", + props, + type + ); } - function describeTextDiff(clientText, serverProps, indent) { - var maxLength = 120 - 2 * indent; - if (null === serverProps) - return added(indent) + describeTextNode(clientText, maxLength) + "\n"; - if ("string" === typeof serverProps) { - for ( - var firstDiff = 0; - firstDiff < serverProps.length && - firstDiff < clientText.length && - serverProps.charCodeAt(firstDiff) === - clientText.charCodeAt(firstDiff); - firstDiff++ + function validateProperty(tagName, name, value, eventRegistry) { + if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) + return !0; + var lowerCasedName = name.toLowerCase(); + if ("onfocusin" === lowerCasedName || "onfocusout" === lowerCasedName) + return ( + error$jscomp$0( + "React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React." + ), + (warnedProperties[name] = !0) + ); + if ( + "function" === typeof value && + (("form" === tagName && "action" === name) || + ("input" === tagName && "formAction" === name) || + ("button" === tagName && "formAction" === name)) + ) + return !0; + if (null != eventRegistry) { + tagName = eventRegistry.possibleRegistrationNames; + if (eventRegistry.registrationNameDependencies.hasOwnProperty(name)) + return !0; + eventRegistry = tagName.hasOwnProperty(lowerCasedName) + ? tagName[lowerCasedName] + : null; + if (null != eventRegistry) + return ( + error$jscomp$0( + "Invalid event handler property `%s`. Did you mean `%s`?", + name, + eventRegistry + ), + (warnedProperties[name] = !0) + ); + if (EVENT_NAME_REGEX.test(name)) + return ( + error$jscomp$0( + "Unknown event handler property `%s`. It will be ignored.", + name + ), + (warnedProperties[name] = !0) + ); + } else if (EVENT_NAME_REGEX.test(name)) + return ( + INVALID_EVENT_NAME_REGEX.test(name) && + error$jscomp$0( + "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", + name + ), + (warnedProperties[name] = !0) + ); + if (rARIA.test(name) || rARIACamel.test(name)) return !0; + if ("innerhtml" === lowerCasedName) + return ( + error$jscomp$0( + "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`." + ), + (warnedProperties[name] = !0) + ); + if ("aria" === lowerCasedName) + return ( + error$jscomp$0( + "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead." + ), + (warnedProperties[name] = !0) + ); + if ( + "is" === lowerCasedName && + null !== value && + void 0 !== value && + "string" !== typeof value + ) + return ( + error$jscomp$0( + "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", + typeof value + ), + (warnedProperties[name] = !0) + ); + if ("number" === typeof value && isNaN(value)) + return ( + error$jscomp$0( + "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", + name + ), + (warnedProperties[name] = !0) ); - firstDiff > maxLength - 8 && - 10 < firstDiff && - ((clientText = "..." + clientText.slice(firstDiff - 8)), - (serverProps = "..." + serverProps.slice(firstDiff - 8))); + if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { + if ( + ((lowerCasedName = possibleStandardNames[lowerCasedName]), + lowerCasedName !== name) + ) + return ( + error$jscomp$0( + "Invalid DOM property `%s`. Did you mean `%s`?", + name, + lowerCasedName + ), + (warnedProperties[name] = !0) + ); + } else if (name !== lowerCasedName) return ( - added(indent) + - describeTextNode(clientText, maxLength) + - "\n" + - removed(indent) + - describeTextNode(serverProps, maxLength) + - "\n" + error$jscomp$0( + "React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", + name, + lowerCasedName + ), + (warnedProperties[name] = !0) ); + switch (name) { + case "dangerouslySetInnerHTML": + case "children": + case "style": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "ref": + return !0; + case "innerText": + case "textContent": + return !0; } - return ( - indentation(indent) + describeTextNode(clientText, maxLength) + "\n" - ); - } - function objectName(object) { - return Object.prototype.toString - .call(object) - .replace(/^\[object (.*)\]$/, function (m, p0) { - return p0; - }); - } - function describeValue(value, maxLength) { switch (typeof value) { - case "string": - return ( - (value = JSON.stringify(value)), - value.length > maxLength - ? 5 > maxLength - ? '"..."' - : value.slice(0, maxLength - 4) + '..."' - : value - ); - case "object": - if (null === value) return "null"; - if (isArrayImpl(value)) return "[...]"; - if (value.$$typeof === REACT_ELEMENT_TYPE) - return (maxLength = getComponentNameFromType(value.type)) - ? "<" + maxLength + ">" - : "<...>"; - var name = objectName(value); - if ("Object" === name) { - name = ""; - maxLength -= 2; - for (var propName in value) - if (value.hasOwnProperty(propName)) { - var jsonPropName = JSON.stringify(propName); - jsonPropName !== '"' + propName + '"' && - (propName = jsonPropName); - maxLength -= propName.length - 2; - jsonPropName = describeValue( - value[propName], - 15 > maxLength ? maxLength : 15 - ); - maxLength -= jsonPropName.length; - if (0 > maxLength) { - name += "" === name ? "..." : ", ..."; - break; - } - name += - ("" === name ? "" : ",") + propName + ":" + jsonPropName; - } - return "{" + name + "}"; + case "boolean": + switch (name) { + case "autoFocus": + case "checked": + case "multiple": + case "muted": + case "selected": + case "contentEditable": + case "spellCheck": + case "draggable": + case "value": + case "autoReverse": + case "externalResourcesRequired": + case "focusable": + case "preserveAlpha": + case "allowFullScreen": + case "async": + case "autoPlay": + case "controls": + case "default": + case "defer": + case "disabled": + case "disablePictureInPicture": + case "disableRemotePlayback": + case "formNoValidate": + case "hidden": + case "loop": + case "noModule": + case "noValidate": + case "open": + case "playsInline": + case "readOnly": + case "required": + case "reversed": + case "scoped": + case "seamless": + case "itemScope": + case "capture": + case "download": + case "inert": + return !0; + default: + lowerCasedName = name.toLowerCase().slice(0, 5); + if ("data-" === lowerCasedName || "aria-" === lowerCasedName) + return !0; + value + ? error$jscomp$0( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', + value, + name, + name, + value, + name + ) + : error$jscomp$0( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', + value, + name, + name, + value, + name, + name, + name + ); + return (warnedProperties[name] = !0); } - return name; case "function": - return (maxLength = value.displayName || value.name) - ? "function " + maxLength - : "function"; - default: - return String(value); + case "symbol": + return (warnedProperties[name] = !0), !1; + case "string": + if ("false" === value || "true" === value) { + switch (name) { + case "checked": + case "selected": + case "multiple": + case "muted": + case "allowFullScreen": + case "async": + case "autoPlay": + case "controls": + case "default": + case "defer": + case "disabled": + case "disablePictureInPicture": + case "disableRemotePlayback": + case "formNoValidate": + case "hidden": + case "loop": + case "noModule": + case "noValidate": + case "open": + case "playsInline": + case "readOnly": + case "required": + case "reversed": + case "scoped": + case "seamless": + case "itemScope": + case "inert": + break; + default: + return !0; + } + error$jscomp$0( + "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", + value, + name, + "false" === value + ? "The browser will interpret it as a truthy value." + : 'Although this works, it will not work as expected if you pass the string "false".', + name, + value + ); + warnedProperties[name] = !0; + } } + return !0; } - function describePropValue(value, maxLength) { - return "string" !== typeof value || needsEscaping.test(value) - ? "{" + describeValue(value, maxLength - 2) + "}" - : value.length > maxLength - 2 - ? 5 > maxLength - ? '"..."' - : '"' + value.slice(0, maxLength - 5) + '..."' - : '"' + value + '"'; - } - function describeExpandedElement(type, props, rowPrefix) { - var remainingRowLength = 120 - rowPrefix.length - type.length, - properties = [], - propName; - for (propName in props) - if (props.hasOwnProperty(propName) && "children" !== propName) { - var propValue = describePropValue( - props[propName], - 120 - rowPrefix.length - propName.length - 1 + function warnUnknownProperties(type, props, eventRegistry) { + var unknownProps = [], + key; + for (key in props) + validateProperty(type, key, props[key], eventRegistry) || + unknownProps.push(key); + props = unknownProps + .map(function (prop) { + return "`" + prop + "`"; + }) + .join(", "); + 1 === unknownProps.length + ? error$jscomp$0( + "Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ", + props, + type + ) + : 1 < unknownProps.length && + error$jscomp$0( + "Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ", + props, + type ); - remainingRowLength -= propName.length + propValue.length + 2; - properties.push(propName + "=" + propValue); - } - return 0 === properties.length - ? rowPrefix + "<" + type + ">\n" - : 0 < remainingRowLength - ? rowPrefix + "<" + type + " " + properties.join(" ") + ">\n" - : rowPrefix + - "<" + - type + - "\n" + - rowPrefix + - " " + - properties.join("\n" + rowPrefix + " ") + - "\n" + - rowPrefix + - ">\n"; } - function describePropertiesDiff(clientObject, serverObject, indent) { - var properties = "", - remainingServerProperties = assign({}, serverObject), - propName; - for (propName in clientObject) - if (clientObject.hasOwnProperty(propName)) { - delete remainingServerProperties[propName]; - var maxLength = 120 - 2 * indent - propName.length - 2, - clientPropValue = describeValue(clientObject[propName], maxLength); - serverObject.hasOwnProperty(propName) - ? ((maxLength = describeValue(serverObject[propName], maxLength)), - (properties += - added(indent) + propName + ": " + clientPropValue + "\n"), - (properties += - removed(indent) + propName + ": " + maxLength + "\n")) - : (properties += - added(indent) + propName + ": " + clientPropValue + "\n"); - } - for (var _propName in remainingServerProperties) - remainingServerProperties.hasOwnProperty(_propName) && - ((clientObject = describeValue( - remainingServerProperties[_propName], - 120 - 2 * indent - _propName.length - 2 - )), - (properties += - removed(indent) + _propName + ": " + clientObject + "\n")); - return properties; + function sanitizeURL(url) { + return isJavaScriptProtocol.test("" + url) + ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" + : url; } - function describeElementDiff(type, clientProps, serverProps, indent) { - var content = "", - serverPropNames = new Map(); - for (propName$jscomp$0 in serverProps) - serverProps.hasOwnProperty(propName$jscomp$0) && - serverPropNames.set( - propName$jscomp$0.toLowerCase(), - propName$jscomp$0 - ); - if (1 === serverPropNames.size && serverPropNames.has("children")) - content += describeExpandedElement( - type, - clientProps, - indentation(indent) - ); - else { - for (var _propName2 in clientProps) - if ( - clientProps.hasOwnProperty(_propName2) && - "children" !== _propName2 - ) { - var maxLength$jscomp$0 = - 120 - 2 * (indent + 1) - _propName2.length - 1, - serverPropName = serverPropNames.get(_propName2.toLowerCase()); - if (void 0 !== serverPropName) { - serverPropNames.delete(_propName2.toLowerCase()); - var propName$jscomp$0 = clientProps[_propName2]; - serverPropName = serverProps[serverPropName]; - var clientPropValue = describePropValue( - propName$jscomp$0, - maxLength$jscomp$0 - ); - maxLength$jscomp$0 = describePropValue( - serverPropName, - maxLength$jscomp$0 + function getEventTarget(nativeEvent) { + nativeEvent = nativeEvent.target || nativeEvent.srcElement || window; + nativeEvent.correspondingUseElement && + (nativeEvent = nativeEvent.correspondingUseElement); + return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent; + } + function restoreStateOfTarget(target) { + var internalInstance = getInstanceFromNode(target); + if (internalInstance && (target = internalInstance.stateNode)) { + var props = getFiberCurrentPropsFromNode(target); + a: switch ( + ((target = internalInstance.stateNode), internalInstance.type) + ) { + case "input": + updateInput( + target, + props.value, + props.defaultValue, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name + ); + internalInstance = props.name; + if ("radio" === props.type && null != internalInstance) { + for (props = target; props.parentNode; ) props = props.parentNode; + checkAttributeStringCoercion(internalInstance, "name"); + props = props.querySelectorAll( + 'input[name="' + + escapeSelectorAttributeValueInsideDoubleQuotes( + "" + internalInstance + ) + + '"][type="radio"]' ); - "object" === typeof propName$jscomp$0 && - null !== propName$jscomp$0 && - "object" === typeof serverPropName && - null !== serverPropName && - "Object" === objectName(propName$jscomp$0) && - "Object" === objectName(serverPropName) && - (2 < Object.keys(propName$jscomp$0).length || - 2 < Object.keys(serverPropName).length || - -1 < clientPropValue.indexOf("...") || - -1 < maxLength$jscomp$0.indexOf("...")) - ? (content += - indentation(indent + 1) + - _propName2 + - "={{\n" + - describePropertiesDiff( - propName$jscomp$0, - serverPropName, - indent + 2 - ) + - indentation(indent + 1) + - "}}\n") - : ((content += - added(indent + 1) + - _propName2 + - "=" + - clientPropValue + - "\n"), - (content += - removed(indent + 1) + - _propName2 + - "=" + - maxLength$jscomp$0 + - "\n")); - } else - content += - indentation(indent + 1) + - _propName2 + - "=" + - describePropValue(clientProps[_propName2], maxLength$jscomp$0) + - "\n"; - } - serverPropNames.forEach(function (propName) { - if ("children" !== propName) { - var maxLength = 120 - 2 * (indent + 1) - propName.length - 1; - content += - removed(indent + 1) + - propName + - "=" + - describePropValue(serverProps[propName], maxLength) + - "\n"; - } - }); - content = - "" === content - ? indentation(indent) + "<" + type + ">\n" - : indentation(indent) + - "<" + - type + - "\n" + - content + - indentation(indent) + - ">\n"; + for ( + internalInstance = 0; + internalInstance < props.length; + internalInstance++ + ) { + var otherNode = props[internalInstance]; + if (otherNode !== target && otherNode.form === target.form) { + var otherProps = getFiberCurrentPropsFromNode(otherNode); + if (!otherProps) + throw Error( + "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." + ); + updateInput( + otherNode, + otherProps.value, + otherProps.defaultValue, + otherProps.defaultValue, + otherProps.checked, + otherProps.defaultChecked, + otherProps.type, + otherProps.name + ); + } + } + for ( + internalInstance = 0; + internalInstance < props.length; + internalInstance++ + ) + (otherNode = props[internalInstance]), + otherNode.form === target.form && + updateValueIfChanged(otherNode); + } + break a; + case "textarea": + updateTextarea(target, props.value, props.defaultValue); + break a; + case "select": + (internalInstance = props.value), + null != internalInstance && + updateOptions(target, !!props.multiple, internalInstance, !1); + } } - type = serverProps.children; - clientProps = clientProps.children; - if ( - "string" === typeof type || - "number" === typeof type || - "bigint" === typeof type - ) { - serverPropNames = ""; - if ( - "string" === typeof clientProps || - "number" === typeof clientProps || - "bigint" === typeof clientProps - ) - serverPropNames = "" + clientProps; - content += describeTextDiff(serverPropNames, "" + type, indent + 1); - } else if ( - "string" === typeof clientProps || - "number" === typeof clientProps || - "bigint" === typeof clientProps - ) - content += describeTextDiff("" + clientProps, void 0, indent + 1); - return content; } - function describeSiblingFiber(fiber, indent) { - var type = describeFiberType(fiber); - if (null === type) { - type = ""; - for (fiber = fiber.child; fiber; ) - (type += describeSiblingFiber(fiber, indent)), - (fiber = fiber.sibling); - return type; + function enqueueStateRestore(target) { + restoreTarget + ? restoreQueue + ? restoreQueue.push(target) + : (restoreQueue = [target]) + : (restoreTarget = target); + } + function restoreStateIfNeeded() { + if (restoreTarget) { + var target = restoreTarget, + queuedTargets = restoreQueue; + restoreQueue = restoreTarget = null; + restoreStateOfTarget(target); + if (queuedTargets) + for (target = 0; target < queuedTargets.length; target++) + restoreStateOfTarget(queuedTargets[target]); } - return indentation(indent) + "<" + type + ">\n"; } - function describeNode(node, indent) { - var skipToNode = findNotableNode(node, indent); + function getMaskedContext(workInProgress, unmaskedContext) { + var contextTypes = workInProgress.type.contextTypes; + if (!contextTypes) return emptyContextObject; + var instance = workInProgress.stateNode; if ( - skipToNode !== node && - (1 !== node.children.length || node.children[0] !== skipToNode) + instance && + instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext ) + return instance.__reactInternalMemoizedMaskedChildContext; + var context = {}, + key; + for (key in contextTypes) context[key] = unmaskedContext[key]; + instance && + ((workInProgress = workInProgress.stateNode), + (workInProgress.__reactInternalMemoizedUnmaskedChildContext = + unmaskedContext), + (workInProgress.__reactInternalMemoizedMaskedChildContext = context)); + return context; + } + function isContextProvider(type) { + type = type.childContextTypes; + return null !== type && void 0 !== type; + } + function popContext(fiber) { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + function popTopLevelContextObject(fiber) { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + function pushTopLevelContextObject(fiber, context, didChange) { + if (contextStackCursor.current !== emptyContextObject) + throw Error( + "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." + ); + push(contextStackCursor, context, fiber); + push(didPerformWorkStackCursor, didChange, fiber); + } + function processChildContext(fiber, type, parentContext) { + var instance = fiber.stateNode; + type = type.childContextTypes; + if ("function" !== typeof instance.getChildContext) return ( - indentation(indent) + "...\n" + describeNode(skipToNode, indent + 1) + (fiber = getComponentNameFromFiber(fiber) || "Unknown"), + warnedAboutMissingGetChildContext[fiber] || + ((warnedAboutMissingGetChildContext[fiber] = !0), + error$jscomp$0( + "%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", + fiber, + fiber + )), + parentContext ); - skipToNode = ""; - var debugInfo = node.fiber._debugInfo; - if (debugInfo) - for (var i = 0; i < debugInfo.length; i++) { - var serverComponentName = debugInfo[i].name; - "string" === typeof serverComponentName && - ((skipToNode += - indentation(indent) + "<" + serverComponentName + ">\n"), - indent++); - } - debugInfo = ""; - i = node.fiber.pendingProps; - if (6 === node.fiber.tag) - debugInfo = describeTextDiff(i, node.serverProps, indent); - else if ( - ((serverComponentName = describeFiberType(node.fiber)), - null !== serverComponentName) + instance = instance.getChildContext(); + for (var contextKey in instance) + if (!(contextKey in type)) + throw Error( + (getComponentNameFromFiber(fiber) || "Unknown") + + '.getChildContext(): key "' + + contextKey + + '" is not defined in childContextTypes.' + ); + return assign({}, parentContext, instance); + } + function pushContextProvider(workInProgress) { + var instance = workInProgress.stateNode; + instance = + (instance && instance.__reactInternalMemoizedMergedChildContext) || + emptyContextObject; + previousContext = contextStackCursor.current; + push(contextStackCursor, instance, workInProgress); + push( + didPerformWorkStackCursor, + didPerformWorkStackCursor.current, + workInProgress + ); + return !0; + } + function invalidateContextProvider(workInProgress, type, didChange) { + var instance = workInProgress.stateNode; + if (!instance) + throw Error( + "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." + ); + didChange + ? ((type = processChildContext(workInProgress, type, previousContext)), + (instance.__reactInternalMemoizedMergedChildContext = type), + pop(didPerformWorkStackCursor, workInProgress), + pop(contextStackCursor, workInProgress), + push(contextStackCursor, type, workInProgress)) + : pop(didPerformWorkStackCursor, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + } + function formatLanes(laneOrLanes) { + return "0b" + laneOrLanes.toString(2).padStart(31, "0"); + } + function group() { + for ( + var _len = arguments.length, groupArgs = Array(_len), _key = 0; + _key < _len; + _key++ ) - if (void 0 === node.serverProps) { - debugInfo = indent; - var maxLength = 120 - 2 * debugInfo - serverComponentName.length - 2, - content = ""; - for (propName in i) - if (i.hasOwnProperty(propName) && "children" !== propName) { - var propValue = describePropValue(i[propName], 15); - maxLength -= propName.length + propValue.length + 2; - if (0 > maxLength) { - content += " ..."; - break; - } - content += " " + propName + "=" + propValue; - } - debugInfo = - indentation(debugInfo) + - "<" + - serverComponentName + - content + - ">\n"; - indent++; - } else - null === node.serverProps - ? (debugInfo = describeExpandedElement( - serverComponentName, - i, - added(indent) - )) - : "string" === typeof node.serverProps - ? error$jscomp$0( - "Should not have matched a non HostText fiber to a Text node. This is a bug in React." - ) - : ((debugInfo = describeElementDiff( - serverComponentName, - i, - node.serverProps, - indent - )), - indent++); - var propName = ""; - i = node.fiber.child; + groupArgs[_key] = arguments[_key]; + pendingGroupArgs.push(groupArgs); + null === nativeConsoleLog && + ((nativeConsoleLog = nativeConsole.log), (nativeConsole.log = log)); + } + function groupEnd() { for ( - serverComponentName = 0; - i && serverComponentName < node.children.length; + pendingGroupArgs.pop(); + printedGroupIndex >= pendingGroupArgs.length; ) - (maxLength = node.children[serverComponentName]), - maxLength.fiber === i - ? ((propName += describeNode(maxLength, indent)), - serverComponentName++) - : (propName += describeSiblingFiber(i, indent)), - (i = i.sibling); - i && - 0 < node.children.length && - (propName += indentation(indent) + "...\n"); - node = node.serverTail; - for (i = 0; i < node.length; i++) - (serverComponentName = node[i]), - (propName = - "string" === typeof serverComponentName - ? propName + - (removed(indent) + - describeTextNode(serverComponentName, 120 - 2 * indent) + - "\n") - : propName + - describeExpandedElement( - serverComponentName.type, - serverComponentName.props, - removed(indent) - )); - return skipToNode + debugInfo + propName; + nativeConsole.groupEnd(), printedGroupIndex--; + 0 === pendingGroupArgs.length && + ((nativeConsole.log = nativeConsoleLog), (nativeConsoleLog = null)); + } + function log() { + if (printedGroupIndex < pendingGroupArgs.length - 1) { + for (var i = printedGroupIndex + 1; i < pendingGroupArgs.length; i++) + nativeConsole.group.apply(nativeConsole, pendingGroupArgs[i]); + printedGroupIndex = pendingGroupArgs.length - 1; + } + "function" === typeof nativeConsoleLog + ? nativeConsoleLog.apply(void 0, arguments) + : nativeConsole.log.apply(nativeConsole, arguments); + } + function getWakeableID(wakeable) { + wakeableIDs.has(wakeable) || wakeableIDs.set(wakeable, wakeableID++); + return wakeableIDs.get(wakeable); + } + function logComponentSuspended(componentName, wakeable) { + if (enableDebugTracing) { + var id = getWakeableID(wakeable), + display = wakeable.displayName || wakeable; + log( + "%c\u269b%c " + componentName + " suspended", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "color: #80366d; font-weight: bold;", + id, + display + ); + wakeable.then( + function () { + log( + "%c\u269b%c " + componentName + " resolved", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "color: #80366d; font-weight: bold;", + id, + display + ); + }, + function () { + log( + "%c\u269b%c " + componentName + " rejected", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "color: #80366d; font-weight: bold;", + id, + display + ); + } + ); + } + } + function logRenderStarted(lanes) { + enableDebugTracing && + group( + "%c\u269b%c render%c (" + formatLanes(lanes) + ")", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "", + "font-weight: normal;" + ); + } + function logStateUpdateScheduled(componentName, lane, payloadOrAction) { + enableDebugTracing && + log( + "%c\u269b%c " + + componentName + + " updated state %c(" + + formatLanes(lane) + + ")", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "color: #01a252; font-weight: bold;", + "", + payloadOrAction + ); } - function describeDiff(rootNode) { - try { - return "\n\n" + describeNode(rootNode, 0); - } catch (x) { - return ""; - } + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var stack = CapturedStacks.get(value); + "string" !== typeof stack && + ((stack = getStackByFiberInDevAndProd(source)), + CapturedStacks.set(value, stack)); + } else stack = getStackByFiberInDevAndProd(source); + return { value: value, source: source, stack: stack }; + } + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; + } + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); + } + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); + } + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); + } + function warnIfNotHydrating() { + isHydrating || + error$jscomp$0( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); } function buildHydrationDiffNode(fiber, distanceFromLeaf) { if (null === fiber.return) { @@ -3770,7 +3793,7 @@ __DEV__ && null === sourceFiber ? (parent[isHidden] = [update]) : sourceFiber.push(update), - (update.lane = lane | OffscreenLane)); + (update.lane = lane | 536870912)); } function getRootForUpdatedFiber(sourceFiber) { throwIfInfiniteUpdateLoopDetected(); @@ -3785,6 +3808,54 @@ __DEV__ && (parent = node.return); return 3 === node.tag ? node.stateNode : null; } + function pushNestedEffectDurations() { + var prevEffectDuration = profilerEffectDuration; + profilerEffectDuration = 0; + return prevEffectDuration; + } + function popNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration = prevEffectDuration; + return elapsedTime; + } + function bubbleNestedEffectDurations(prevEffectDuration) { + var elapsedTime = profilerEffectDuration; + profilerEffectDuration += prevEffectDuration; + return elapsedTime; + } + function startProfilerTimer(fiber) { + profilerStartTime = now(); + 0 > fiber.actualStartTime && (fiber.actualStartTime = profilerStartTime); + } + function stopProfilerTimerIfRunningAndRecordDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + fiber.selfBaseDuration = elapsedTime; + profilerStartTime = -1; + } + } + function stopProfilerTimerIfRunningAndRecordIncompleteDuration(fiber) { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + fiber.actualDuration += elapsedTime; + profilerStartTime = -1; + } + } + function recordEffectDuration() { + if (0 <= profilerStartTime) { + var elapsedTime = now() - profilerStartTime; + profilerStartTime = -1; + profilerEffectDuration += elapsedTime; + } + } + function startEffectTimer() { + profilerStartTime = now(); + } + function transferActualDuration(fiber) { + for (var child = fiber.child; child; ) + (fiber.actualDuration += child.actualDuration), (child = child.sibling); + } function ensureRootIsScheduled(root) { root !== lastScheduledRoot && null === root.next && @@ -3806,30 +3877,41 @@ __DEV__ && 0 === root.tag && (ReactSharedInternals.didScheduleLegacyUpdate = !0); } - function flushSyncWorkAcrossRoots_impl(onlyLegacy) { + function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { isFlushingWork = !0; do { var didPerformSomeWork = !1; for (var root = firstScheduledRoot; null !== root; ) { - if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) { - var workInProgressRootRenderLanes$jscomp$0 = - workInProgressRootRenderLanes; - workInProgressRootRenderLanes$jscomp$0 = getNextLanes( - root, - root === workInProgressRoot - ? workInProgressRootRenderLanes$jscomp$0 - : 0 - ); - 0 !== - (workInProgressRootRenderLanes$jscomp$0 & - (SyncLane | SyncHydrationLane)) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot( - root, - workInProgressRootRenderLanes$jscomp$0 - )); - } + if (!onlyLegacy || (!disableLegacyMode && 0 === root.tag)) + if (0 !== syncTransitionLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) var nextLanes = 0; + else { + var suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes; + nextLanes = + (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; + nextLanes &= pendingLanes & ~(suspendedLanes & ~pingedLanes); + nextLanes = + nextLanes & 201326677 + ? (nextLanes & 201326677) | 1 + : nextLanes + ? nextLanes | 2 + : 0; + } + 0 !== nextLanes && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); + } else + (nextLanes = workInProgressRootRenderLanes), + (nextLanes = getNextLanes( + root, + root === workInProgressRoot ? nextLanes : 0 + )), + 0 !== (nextLanes & 3) && + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -3841,34 +3923,29 @@ __DEV__ && didScheduleMicrotask_act = didScheduleMicrotask = !1; + var syncTransitionLanes = 0; + 0 !== currentEventTransitionLane && + (shouldAttemptEagerTransition() && + (syncTransitionLanes = currentEventTransitionLane), + (currentEventTransitionLane = 0)); for ( var currentTime = now$1(), prev = null, root = firstScheduledRoot; null !== root; ) { - var next = root.next; - if ( - 0 !== currentEventTransitionLane && - shouldAttemptEagerTransition() - ) { - var root$jscomp$0 = root, - lane = currentEventTransitionLane; - root$jscomp$0.pendingLanes |= SyncLane; - root$jscomp$0.entangledLanes |= SyncLane; - root$jscomp$0.entanglements[1] |= lane; - } - root$jscomp$0 = scheduleTaskForRootDuringMicrotask(root, currentTime); - 0 === root$jscomp$0 - ? ((root.next = null), + var next = root.next, + nextLanes = scheduleTaskForRootDuringMicrotask(root, currentTime); + if (0 === nextLanes) + (root.next = null), null === prev ? (firstScheduledRoot = next) : (prev.next = next), - null === next && (lastScheduledRoot = prev)) - : ((prev = root), - 0 !== (root$jscomp$0 & (SyncLane | SyncHydrationLane)) && - (mightHavePendingSyncWork = !0)); + null === next && (lastScheduledRoot = prev); + else if ( + ((prev = root), 0 !== syncTransitionLanes || 0 !== (nextLanes & 3)) + ) + mightHavePendingSyncWork = !0; root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(syncTransitionLanes, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -3878,7 +3955,7 @@ __DEV__ && for ( pendingLanes = enableRetryLaneExpiration ? pendingLanes - : pendingLanes & ~RetryLanes; + : pendingLanes & -62914561; 0 < pendingLanes; ) { @@ -3909,12 +3986,12 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & (SyncLane | SyncHydrationLane))) + if (0 !== (suspendedLanes & 3)) return ( null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = SyncLane), + (root.callbackPriority = 2), (root.callbackNode = null), - SyncLane + 2 ); currentTime = suspendedLanes & -suspendedLanes; if ( @@ -3940,7 +4017,7 @@ __DEV__ && default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode$1)) @@ -3949,6 +4026,34 @@ __DEV__ && root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + !disableSchedulerTimeoutInWorkLoop && didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode$1 && null !== callbackNode && @@ -3990,8 +4095,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -4088,10 +4193,7 @@ __DEV__ && } function entangleTransitions(root, fiber, lane) { fiber = fiber.updateQueue; - if ( - null !== fiber && - ((fiber = fiber.shared), 0 !== (lane & TransitionLanes)) - ) { + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { var queueLanes = fiber.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -4187,7 +4289,7 @@ __DEV__ && current = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { - var updateLane = pendingQueue.lane & ~OffscreenLane, + var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane; if ( isHiddenUpdate @@ -4221,7 +4323,7 @@ __DEV__ && newState, nextProps ); - if (updateLane.mode & 8) { + if (updateLane.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { partialState.call(instance, newState, nextProps); @@ -4246,7 +4348,7 @@ __DEV__ && newState, nextProps ); - if (updateLane.mode & 8) { + if (updateLane.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { nextState.call(instance, newState, nextProps); @@ -4314,6 +4416,16 @@ __DEV__ && ); 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) @@ -4595,6 +4707,7 @@ __DEV__ && lanes )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -4668,6 +4781,7 @@ __DEV__ && key )), (current.return = returnFiber), + (current._debugOwner = returnFiber), (current._debugInfo = currentDebugInfo), current ); @@ -4689,6 +4803,7 @@ __DEV__ && lanes )), (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), (newChild._debugInfo = currentDebugInfo), newChild ); @@ -4735,6 +4850,7 @@ __DEV__ && null )), (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), (returnFiber = pushDebugInfo(newChild._debugInfo)), (lanes._debugInfo = currentDebugInfo), (currentDebugInfo = returnFiber), @@ -4754,7 +4870,7 @@ __DEV__ && if (newChild.$$typeof === REACT_CONTEXT_TYPE) return createChild( returnFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -4835,7 +4951,7 @@ __DEV__ && return updateSlot( returnFiber, oldFiber, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -4932,7 +5048,7 @@ __DEV__ && existingChildren, returnFiber, newIdx, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -5275,6 +5391,7 @@ __DEV__ && newChild.key )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), (currentFirstChild._debugInfo = currentDebugInfo), validateFragmentProps( newChild, @@ -5416,7 +5533,7 @@ __DEV__ && return reconcileChildFibersImpl( returnFiber, currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild, lanes), + readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); @@ -5446,6 +5563,8 @@ __DEV__ && lanes )), (currentFirstChild.return = returnFiber), + (currentFirstChild._debugOwner = returnFiber), + (currentFirstChild._debugInfo = currentDebugInfo), (returnFiber = currentFirstChild)), placeSingleChild(returnFiber) ); @@ -5471,7 +5590,7 @@ __DEV__ && if ( x === SuspenseException || (!disableLegacyMode && - 0 === (returnFiber.mode & 1) && + (returnFiber.mode & ConcurrentMode) === NoMode && "object" === typeof x && null !== x && "function" === typeof x.then) @@ -5529,12 +5648,12 @@ __DEV__ && ? (shellBoundary = handler) : null !== current.memoizedState && (shellBoundary = handler))) : null === shellBoundary - ? push(suspenseHandlerStackCursor, handler, handler) - : push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - handler - ); + ? push(suspenseHandlerStackCursor, handler, handler) + : push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + handler + ); } function pushOffscreenSuspenseHandler(fiber) { if (22 === fiber.tag) { @@ -5717,10 +5836,10 @@ __DEV__ && null !== current && null !== current.memoizedState ? HooksDispatcherOnUpdateInDEV : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - 0 !== (workInProgress.mode & 8); + (workInProgress.mode & StrictLegacyMode) !== NoMode; var children = callComponentInDEV(Component, props, secondArg); shouldDoubleInvokeUserFnsInHooksDEV = !1; didScheduleRenderPhaseUpdateDuringThisPass && @@ -5748,6 +5867,14 @@ __DEV__ && } 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; @@ -5761,7 +5888,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; null === current || (current.flags & 31457280) === (workInProgress.flags & 31457280) || - (!disableLegacyMode && 0 === (current.mode & 1)) || + (!disableLegacyMode && (current.mode & ConcurrentMode) === NoMode) || error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5772,9 +5899,8 @@ __DEV__ && throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); - enableLazyContextPropagation && - null !== current && - !didReceiveUpdate && + null === current || + didReceiveUpdate || ((current = current.dependencies), null !== current && checkIfContextChanged(current) && @@ -5806,10 +5932,16 @@ __DEV__ && numberOfReRenders += 1; ignorePreviousDependencies = !1; workInProgressHook = currentHook = null; - workInProgress.updateQueue = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } hookTypesUpdateIndexDev = -1; ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - var children = callComponentInDEV(Component, props, secondArg); + children = callComponentInDEV(Component, props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); return children; } @@ -5833,7 +5965,7 @@ __DEV__ && function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; workInProgress.flags = - 0 !== (workInProgress.mode & 16) + (workInProgress.mode & StrictEffectsMode) !== NoMode ? workInProgress.flags & -201328645 : workInProgress.flags & -2053; current.lanes &= ~lanes; @@ -5912,6 +6044,38 @@ __DEV__ && } return workInProgressHook; } + function unstable_useContextWithBailout(context, select) { + if (null === select) var JSCompiler_temp = readContext(context); + else { + JSCompiler_temp = currentlyRenderingFiber; + var value = context._currentValue; + if (lastFullyObservedContext !== context) + if ( + ((context = { + context: context, + memoizedValue: value, + next: null, + select: select, + lastSelectedValue: select(value) + }), + null === lastContextDependency) + ) { + if (null === JSCompiler_temp) + throw Error( + "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; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + JSCompiler_temp.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + JSCompiler_temp = value; + } + return JSCompiler_temp; + } function useThenable(thenable) { var index = thenableIndexCounter; thenableIndexCounter += 1; @@ -5962,7 +6126,7 @@ __DEV__ && (currentlyRenderingFiber$1.updateQueue = updateQueue)); updateQueue.memoCache = memoCache; updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) + if (void 0 === updateQueue || ignorePreviousDependencies) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; @@ -6043,7 +6207,7 @@ __DEV__ && update = current, didReadFromEntangledAsyncAction = !1; do { - var updateLane = update.lane & ~OffscreenLane; + var updateLane = update.lane & -536870913; if ( updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane @@ -6172,15 +6336,12 @@ __DEV__ && "The result of getSnapshot should be cached to avoid an infinite loop" ), (didWarnUncachedGetSnapshot = !0))); - getServerSnapshot = workInProgressRoot; - if (null === getServerSnapshot) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); - includesBlockingLane( - getServerSnapshot, - workInProgressRootRenderLanes - ) || pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } hook.memoizedState = nextSnapshot; getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; @@ -6257,13 +6418,12 @@ __DEV__ && { destroy: void 0 }, null ); - subscribe = workInProgressRoot; - if (null === subscribe) + if (null === workInProgressRoot) throw Error( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ); isHydrating$jscomp$0 || - includesBlockingLane(subscribe, renderLanes) || + 0 !== (renderLanes & 60) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } return getServerSnapshot; @@ -6297,13 +6457,13 @@ __DEV__ && try { var nextValue = latestGetSnapshot(); return !objectIs(inst, nextValue); - } catch (error$2) { + } catch (error$6) { return !0; } } function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); - null !== root && scheduleUpdateOnFiber(root, fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); } function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); @@ -6426,8 +6586,8 @@ __DEV__ && null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); handleActionReturnValue(actionQueue, node, returnValue); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } catch (error$7) { + onActionError(actionQueue, node, error$7); } finally { (ReactSharedInternals.T = prevTransition), null === prevTransition && @@ -6443,8 +6603,8 @@ __DEV__ && try { (currentTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$4) { - onActionError(actionQueue, node, error$4); + } catch (error$8) { + onActionError(actionQueue, node, error$8); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -6639,17 +6799,16 @@ __DEV__ && function pushEffect(tag, create, inst, deps) { tag = { tag: tag, create: create, inst: inst, deps: deps, next: null }; create = currentlyRenderingFiber$1.updateQueue; - null === create - ? ((create = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = create), - (create.lastEffect = tag.next = tag)) - : ((inst = create.lastEffect), - null === inst - ? (create.lastEffect = tag.next = tag) - : ((deps = inst.next), - (inst.next = tag), - (tag.next = deps), - (create.lastEffect = tag))); + null === create && + ((create = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber$1.updateQueue = create)); + inst = create.lastEffect; + null === inst + ? (create.lastEffect = tag.next = tag) + : ((deps = inst.next), + (inst.next = tag), + (tag.next = deps), + (create.lastEffect = tag)); return tag; } function mountRef(initialValue) { @@ -6684,8 +6843,8 @@ __DEV__ && ))); } function mountEffect(create, deps) { - 0 !== (currentlyRenderingFiber$1.mode & 16) && - 0 === (currentlyRenderingFiber$1.mode & 64) + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode ? mountEffectImpl(142608384, Passive, create, deps) : mountEffectImpl(8390656, Passive, create, deps); } @@ -6728,7 +6887,8 @@ __DEV__ && } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); return mountEffectImpl(fiberFlags, Layout, create, deps); } function imperativeHandleEffect(create, ref) { @@ -6761,7 +6921,8 @@ __DEV__ && ); deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; var fiberFlags = 4194308; - 0 !== (currentlyRenderingFiber$1.mode & 16) && (fiberFlags |= 67108864); + (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); mountEffectImpl( fiberFlags, Layout, @@ -6849,15 +7010,13 @@ __DEV__ && ); } function mountDeferredValueImpl(hook, value, initialValue) { - return enableUseDeferredValueInitialArg && - void 0 !== initialValue && - 0 === (renderLanes & DeferredLane) - ? ((hook.memoizedState = initialValue), - (hook = requestDeferredLane()), - (currentlyRenderingFiber$1.lanes |= hook), - (workInProgressRootSkippedLanes |= hook), - initialValue) - : (hook.memoizedState = value); + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber$1.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } function updateDeferredValueImpl(hook, prevValue, value, initialValue) { if (objectIs(value, prevValue)) return value; @@ -6867,7 +7026,7 @@ __DEV__ && objectIs(hook, prevValue) || (didReceiveUpdate = !0), hook ); - if (0 === (renderLanes & (SyncLane | InputContinuousLane | DefaultLane))) + if (0 === (renderLanes & 42)) return (didReceiveUpdate = !0), (hook.memoizedState = value); hook = requestDeferredLane(); currentlyRenderingFiber$1.lanes |= hook; @@ -6911,14 +7070,26 @@ __DEV__ && returnValue, finishedState ); - dispatchSetState(fiber, queue, thenableForFinishedState); - } else dispatchSetState(fiber, queue, finishedState); - } catch (error$5) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$5 - }); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error$9) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -6992,7 +7163,12 @@ __DEV__ && "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." ); var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetState(formFiber, resetStateQueue, {}); + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } function mountTransition() { var stateHook = mountStateImpl(!1); @@ -7027,8 +7203,7 @@ __DEV__ && ]; } function useHostTransitionStatus() { - var status = readContext(HostTransitionContext); - return null !== status ? status : NotPendingTransition; + return readContext(HostTransitionContext); } function mountId() { var hook = mountWorkInProgressHook(), @@ -7129,8 +7304,17 @@ __DEV__ && "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ); JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); + dispatchSetStateInternal( + fiber, + queue, + action, + JSCompiler_OptimizeArgumentsArray_p1 + ); + markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { var update = { - lane: JSCompiler_OptimizeArgumentsArray_p1, + lane: lane, revertLane: 0, action: action, hasEagerState: !1, @@ -7152,35 +7336,27 @@ __DEV__ && eagerState = alternate(currentState, action); update.hasEagerState = !0; update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) { - enqueueUpdate$1(fiber, queue, update, 0); - null === workInProgressRoot && finishQueueingConcurrentUpdates(); - return; - } - } catch (error$6) { + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error$10) { } finally { ReactSharedInternals.H = prevDispatcher; } } - currentState = enqueueConcurrentHookUpdate( - fiber, - queue, - update, - JSCompiler_OptimizeArgumentsArray_p1 - ); - null !== currentState && - (scheduleUpdateOnFiber( - currentState, - fiber, - JSCompiler_OptimizeArgumentsArray_p1 - ), - entangleTransitionUpdate( - currentState, - queue, - JSCompiler_OptimizeArgumentsArray_p1 - )); + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - markUpdateInDevTools(fiber, JSCompiler_OptimizeArgumentsArray_p1, action); + return !1; } function dispatchOptimisticSetState( fiber, @@ -7194,7 +7370,7 @@ __DEV__ && "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); var update = { - lane: SyncLane, + lane: 2, revertLane: requestTransitionLane(), action: action, hasEagerState: !1, @@ -7210,11 +7386,11 @@ __DEV__ && fiber, queue, update, - SyncLane + 2 )), null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, SyncLane); - markUpdateInDevTools(fiber, SyncLane, action); + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + markUpdateInDevTools(fiber, 2, action); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; @@ -7233,7 +7409,7 @@ __DEV__ && queue.pending = update; } function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & TransitionLanes)) { + if (0 !== (lane & 4194176)) { var queueLanes = queue.lanes; queueLanes &= root.pendingLanes; lane |= queueLanes; @@ -7242,67 +7418,12 @@ __DEV__ && } } function markUpdateInDevTools(fiber, lane, action) { - if (enableDebugTracing && fiber.mode & 4) { + if (enableDebugTracing && fiber.mode & DebugTracingMode) { var name = getComponentNameFromFiber(fiber) || "Unknown"; logStateUpdateScheduled(name, lane, action); } enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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 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 warnOnInvalidCallback$1(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); @@ -7322,7 +7443,7 @@ __DEV__ && ) { var prevState = workInProgress.memoizedState, partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { partialState = getDerivedStateFromProps(nextProps, prevState); @@ -7362,7 +7483,7 @@ __DEV__ && newState, nextContext ); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { oldProps = instance.shouldComponentUpdate( @@ -7400,12 +7521,12 @@ __DEV__ && void 0 === context ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" !== typeof context - ? " However, it is set to a " + typeof context + "." - : context.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(context).join(", ") + - "}."; + ? " However, it is set to a " + typeof context + "." + : context.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(context).join(", ") + + "}."; error$jscomp$0( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", @@ -7424,7 +7545,7 @@ __DEV__ && ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject)); addendum = new ctor(props, context); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { addendum = new ctor(props, context); @@ -7555,11 +7676,6 @@ __DEV__ && "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name ); - instance.propTypes && - error$jscomp$0( - "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", - name - ); instance.contextType && error$jscomp$0( "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", @@ -7578,6 +7694,20 @@ __DEV__ && "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name )); + ctor.childContextTypes && + !didWarnAboutChildContextTypes.has(ctor) && + (didWarnAboutChildContextTypes.add(ctor), + error$jscomp$0( + "%s uses the legacy childContextTypes API which will soon be removed. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + name + )); + ctor.contextTypes && + !didWarnAboutContextTypes$1.has(ctor) && + (didWarnAboutContextTypes$1.add(ctor), + error$jscomp$0( + "%s uses the legacy contextTypes API which will soon be removed. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + name + )); "function" === typeof instance.componentShouldUpdate && error$jscomp$0( "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", @@ -7675,7 +7805,7 @@ __DEV__ && "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", name ))); - workInProgress.mode & 8 && + workInProgress.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, instance @@ -7713,7 +7843,8 @@ __DEV__ && (instance.state = workInProgress.memoizedState)); "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4194308); - 0 !== (workInProgress.mode & 16) && (workInProgress.flags |= 67108864); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); } function resolveClassComponentProps( Component, @@ -7751,26 +7882,61 @@ __DEV__ && } function defaultOnUncaughtError(error, errorInfo) { reportGlobalError(error); - console.warn( - "%s\n\n%s\n%s", - componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components.", - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries.", - null != errorInfo.componentStack ? errorInfo.componentStack : "" - ); + error = componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components."; + var prevGetCurrentStack = ReactSharedInternals.getCurrentStack, + componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + try { + warn( + "%s\n\n%s\n", + error, + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); + } finally { + ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + } } function defaultOnCaughtError(error$1, errorInfo) { - console.error( - "%o\n\n%s\n\n%s\n%s", - error$1, - componentName + var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component." : "The above error occurred in one of your React components.", - "React will try to recreate this component tree from scratch using the error boundary you provided, " + + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + ((errorBoundaryName || "Anonymous") + "."), - null != errorInfo.componentStack ? errorInfo.componentStack : "" - ); + prevGetCurrentStack = ReactSharedInternals.getCurrentStack, + componentStack = + null != errorInfo.componentStack ? errorInfo.componentStack : ""; + ReactSharedInternals.getCurrentStack = function () { + return componentStack; + }; + try { + "object" === typeof error$1 && + null !== error$1 && + "string" === typeof error$1.environmentName + ? bindToConsole( + "error", + [ + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ], + error$1.environmentName + )() + : error$jscomp$0( + "%o\n\n%s\n\n%s\n", + error$1, + componentNameMessage, + recreateMessage + ); + } finally { + ReactSharedInternals.getCurrentStack = prevGetCurrentStack; + } } function defaultOnRecoverableError(error) { reportGlobalError(error); @@ -7859,12 +8025,9 @@ __DEV__ && (null === legacyErrorBoundariesThatAlreadyFailed ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); + callComponentDidCatchInDEV(this, errorInfo); "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & SyncLane) && + (0 === (fiber.lanes & 2) && error$jscomp$0( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", getComponentNameFromFiber(fiber) || "Unknown" @@ -7878,7 +8041,10 @@ __DEV__ && root, rootRenderLanes ) { - if (!disableLegacyMode && 0 === (suspenseBoundary.mode & 1)) + if ( + !disableLegacyMode && + (suspenseBoundary.mode & ConcurrentMode) === NoMode + ) return ( suspenseBoundary === returnFiber ? (suspenseBoundary.flags |= 65536) @@ -7888,13 +8054,13 @@ __DEV__ && 1 === sourceFiber.tag ? null === sourceFiber.alternate ? (sourceFiber.tag = 17) - : ((returnFiber = createUpdate(SyncLane)), + : ((returnFiber = createUpdate(2)), (returnFiber.tag = ForceUpdate), - enqueueUpdate(sourceFiber, returnFiber, SyncLane)) + enqueueUpdate(sourceFiber, returnFiber, 2)) : 0 === sourceFiber.tag && null === sourceFiber.alternate && (sourceFiber.tag = 28), - (sourceFiber.lanes |= SyncLane)), + (sourceFiber.lanes |= 2)), suspenseBoundary ); suspenseBoundary.flags |= 65536; @@ -7915,19 +8081,17 @@ __DEV__ && "object" === typeof value && "function" === typeof value.then ) { - if (enableLazyContextPropagation) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); - } + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); currentSourceFiber = sourceFiber.tag; disableLegacyMode || - 0 !== (sourceFiber.mode & 1) || + (sourceFiber.mode & ConcurrentMode) !== NoMode || (0 !== currentSourceFiber && 11 !== currentSourceFiber && 15 !== currentSourceFiber) || @@ -7938,10 +8102,10 @@ __DEV__ && : ((sourceFiber.updateQueue = null), (sourceFiber.memoizedState = null))); isHydrating && - (disableLegacyMode || sourceFiber.mode & 1) && + (disableLegacyMode || sourceFiber.mode & ConcurrentMode) && (didSuspendOrErrorDEV = !0); enableDebugTracing && - sourceFiber.mode & 4 && + sourceFiber.mode & DebugTracingMode && ((currentSourceFiber = getComponentNameFromFiber(sourceFiber) || "Unknown"), logComponentSuspended(currentSourceFiber, value)); @@ -7949,7 +8113,7 @@ __DEV__ && if (null !== currentSourceFiber) { switch (currentSourceFiber.tag) { case 13: - if (disableLegacyMode || sourceFiber.mode & 1) + if (disableLegacyMode || sourceFiber.mode & ConcurrentMode) null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === currentSourceFiber.alternate && @@ -7969,11 +8133,12 @@ __DEV__ && null === sourceFiber ? (currentSourceFiber.updateQueue = new Set([value])) : sourceFiber.add(value), - (disableLegacyMode || currentSourceFiber.mode & 1) && + (disableLegacyMode || + currentSourceFiber.mode & ConcurrentMode) && attachPingListener(root, value, rootRenderLanes)); return !1; case 22: - if (disableLegacyMode || currentSourceFiber.mode & 1) + if (disableLegacyMode || currentSourceFiber.mode & ConcurrentMode) return ( (currentSourceFiber.flags |= 65536), value === noopSuspenseyCommitThenable @@ -8010,7 +8175,10 @@ __DEV__ && "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition." ); } - if (isHydrating && (disableLegacyMode || sourceFiber.mode & 1)) + if ( + isHydrating && + (disableLegacyMode || sourceFiber.mode & ConcurrentMode) + ) return ( (didSuspendOrErrorDEV = !0), (currentSourceFiber = suspenseHandlerStackCursor.current), @@ -8292,7 +8460,7 @@ __DEV__ && for (var key in nextProps) "ref" !== key && (propsWithoutRef[key] = nextProps[key]); } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextProps = renderWithHooks( current, @@ -8451,8 +8619,11 @@ __DEV__ && renderLanes ); } - if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) - if (0 !== (renderLanes & OffscreenLane)) + if ( + disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode + ) + if (0 !== (renderLanes & 536870912)) (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), null !== current && pushTransition( @@ -8466,8 +8637,7 @@ __DEV__ && pushOffscreenSuspenseHandler(workInProgress); else return ( - (workInProgress.lanes = workInProgress.childLanes = - OffscreenLane), + (workInProgress.lanes = workInProgress.childLanes = 536870912), deferHiddenOffscreenComponent( current, workInProgress, @@ -8523,8 +8693,7 @@ __DEV__ && null !== current && pushTransition(workInProgress, null, null); reuseHiddenContextOnStack(workInProgress); pushOffscreenSuspenseHandler(workInProgress); - enableLazyContextPropagation && - null !== current && + null !== current && propagateParentContextChanges(current, workInProgress, renderLanes, !0); return null; } @@ -8541,6 +8710,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -8577,25 +8747,35 @@ __DEV__ && ), (didWarnAboutBadClass[componentName] = !0)); } - workInProgress.mode & 8 && + workInProgress.mode & StrictLegacyMode && ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, null ); null === current && - validateFunctionComponentInDev(workInProgress, workInProgress.type); - componentName = isContextProvider(Component) - ? previousContext - : contextStackCursor.current; - componentName = getMaskedContext(workInProgress, componentName); - prepareToReadContext(workInProgress, renderLanes); + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + error$jscomp$0( + "%s uses the legacy contextTypes API which will be removed soon. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + if (!disableLegacyContextForFunctionComponents) { + var context = isContextProvider(Component) + ? previousContext + : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + } + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); Component = renderWithHooks( current, workInProgress, Component, nextProps, - componentName, + context, renderLanes ); nextProps = checkDidRenderIdHook(); @@ -8618,11 +8798,12 @@ __DEV__ && secondArg, renderLanes ) { - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8681,7 +8862,7 @@ __DEV__ && isContextProvider(Component) ? ((_instance = !0), pushContextProvider(workInProgress)) : (_instance = !1); - prepareToReadContext(workInProgress, renderLanes); + prepareToReadContext(workInProgress); if (null === workInProgress.stateNode) resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), constructClassInstance(workInProgress, Component, nextProps), @@ -8757,11 +8938,11 @@ __DEV__ && state.UNSAFE_componentWillMount()), "function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864)) : ("function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864), (workInProgress.memoizedProps = nextProps), (workInProgress.memoizedState = oldContext)), @@ -8771,7 +8952,7 @@ __DEV__ && (state = lane)) : ("function" === typeof state.componentDidMount && (workInProgress.flags |= 4194308), - 0 !== (workInProgress.mode & 16) && + (workInProgress.mode & StrictEffectsMode) !== NoMode && (workInProgress.flags |= 67108864), (state = !1)); } else { @@ -8816,8 +8997,7 @@ __DEV__ && unresolvedOldProps !== newState || didPerformWorkStackCursor.current || hasForceUpdate || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? ("function" === typeof oldState && @@ -8839,8 +9019,7 @@ __DEV__ && newState, oldContext ) || - (enableLazyContextPropagation && - null !== current && + (null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies))) ? (getDerivedStateFromProps || @@ -8935,7 +9114,7 @@ __DEV__ && } else { enableSchedulingProfiler && markComponentRenderStarted(workInProgress); nextChildren = callRenderInDEV(shouldUpdate); - if (workInProgress.mode & 8) { + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { callRenderInDEV(shouldUpdate); @@ -9041,32 +9220,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2433; - var JSCompiler_object_inline_stack_2434 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2427; + var JSCompiler_object_inline_stack_2428 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2435 = !1; + var JSCompiler_object_inline_componentStack_2429 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2433 = didSuspend) || - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2427 = didSuspend) || + (JSCompiler_object_inline_digest_2427 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2433 && - ((JSCompiler_object_inline_componentStack_2435 = !0), + JSCompiler_object_inline_digest_2427 && + ((JSCompiler_object_inline_componentStack_2429 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2433 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2427 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2429 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2432 = nextHydratableInstance; + var JSCompiler_object_inline_message_2426 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2432)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2426)) { c: { - var instance = JSCompiler_object_inline_message_2432; + var instance = JSCompiler_object_inline_message_2426; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9092,9 +9271,9 @@ __DEV__ && null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null, - retryLane: OffscreenLane + retryLane: 536870912 }), - (instance = createFiber(18, null, null, 0)), + (instance = createFiber(18, null, null, NoMode)), (instance.stateNode = JSCompiler_temp), (instance.return = workInProgress), (workInProgress.child = instance), @@ -9107,47 +9286,47 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2426 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2432 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2426 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2432 && - ((JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_message_2432.dehydrated), - null !== JSCompiler_object_inline_message_2432) + null !== JSCompiler_object_inline_message_2426 && + ((JSCompiler_object_inline_message_2426 = + JSCompiler_object_inline_message_2426.dehydrated), + null !== JSCompiler_object_inline_message_2426) ) return ( - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_FALLBACK_START_DATA - ? (workInProgress.lanes = DefaultHydrationLane) - : (workInProgress.lanes = OffscreenLane), + ? (workInProgress.lanes = 16) + : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_stack_2434.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2434.fallback; - if (JSCompiler_object_inline_componentStack_2435) + JSCompiler_object_inline_message_2426 = + JSCompiler_object_inline_stack_2428.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2428.fallback; + if (JSCompiler_object_inline_componentStack_2429) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2428 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2426, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2429 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2429.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2429.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9160,9 +9339,9 @@ __DEV__ && ? markerInstanceStack.current : null), (current = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2429.updateQueue), null === current - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = + ? (JSCompiler_object_inline_componentStack_2429.updateQueue = { transitions: workInProgress, markerInstances: renderLanes, @@ -9170,46 +9349,46 @@ __DEV__ && }) : ((current.transitions = workInProgress), (current.markerInstances = renderLanes)))), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2428 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2434.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2428.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2428 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2426, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2429 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2429.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2429.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2428 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2426 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2432 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2432) + ((JSCompiler_object_inline_message_2426 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2426) ) { if (didSuspend) workInProgress.flags & 256 @@ -9221,100 +9400,102 @@ __DEV__ && renderLanes ))) : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2435 = - JSCompiler_object_inline_stack_2434.fallback), - (JSCompiler_object_inline_message_2432 = workInProgress.mode), - (JSCompiler_object_inline_stack_2434 = createFiberFromOffscreen( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2434.children - }, - JSCompiler_object_inline_message_2432, - 0, - null - )), - (JSCompiler_object_inline_componentStack_2435 = - createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, - renderLanes, + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_componentStack_2429 = + JSCompiler_object_inline_stack_2428.fallback), + (JSCompiler_object_inline_message_2426 = workInProgress.mode), + (JSCompiler_object_inline_stack_2428 = createFiberFromOffscreen( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2428.children + }, + JSCompiler_object_inline_message_2426, + 0, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2), - (JSCompiler_object_inline_stack_2434.return = workInProgress), - (JSCompiler_object_inline_componentStack_2435.return = - workInProgress), - (JSCompiler_object_inline_stack_2434.sibling = - JSCompiler_object_inline_componentStack_2435), - (workInProgress.child = JSCompiler_object_inline_stack_2434), - (disableLegacyMode || 0 !== (workInProgress.mode & 1)) && - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2434 = workInProgress.child), - (JSCompiler_object_inline_stack_2434.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2434.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_digest_2433, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_componentStack_2435)); + (JSCompiler_object_inline_componentStack_2429 = + createFiberFromFragment( + JSCompiler_object_inline_componentStack_2429, + JSCompiler_object_inline_message_2426, + renderLanes, + null + )), + (JSCompiler_object_inline_componentStack_2429.flags |= 2), + (JSCompiler_object_inline_stack_2428.return = workInProgress), + (JSCompiler_object_inline_componentStack_2429.return = + workInProgress), + (JSCompiler_object_inline_stack_2428.sibling = + JSCompiler_object_inline_componentStack_2429), + (workInProgress.child = JSCompiler_object_inline_stack_2428), + (disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode) && + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2428 = workInProgress.child), + (JSCompiler_object_inline_stack_2428.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2428.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_digest_2427, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = + JSCompiler_object_inline_componentStack_2429)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2433 = - JSCompiler_object_inline_message_2432.nextSibling && - JSCompiler_object_inline_message_2432.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2433) { - JSCompiler_temp = JSCompiler_object_inline_digest_2433.dgst; - var message = JSCompiler_object_inline_digest_2433.msg; - instance = JSCompiler_object_inline_digest_2433.stck; - var componentStack = JSCompiler_object_inline_digest_2433.cstck; + JSCompiler_object_inline_digest_2427 = + JSCompiler_object_inline_message_2426.nextSibling && + JSCompiler_object_inline_message_2426.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2427) { + JSCompiler_temp = JSCompiler_object_inline_digest_2427.dgst; + var message = JSCompiler_object_inline_digest_2427.msg; + instance = JSCompiler_object_inline_digest_2427.stck; + var componentStack = JSCompiler_object_inline_digest_2427.cstck; } - JSCompiler_object_inline_message_2432 = message; - JSCompiler_object_inline_digest_2433 = JSCompiler_temp; - JSCompiler_object_inline_stack_2434 = instance; - JSCompiler_object_inline_componentStack_2435 = componentStack; - JSCompiler_object_inline_message_2432 = - JSCompiler_object_inline_message_2432 - ? Error(JSCompiler_object_inline_message_2432) + JSCompiler_object_inline_message_2426 = message; + JSCompiler_object_inline_digest_2427 = JSCompiler_temp; + JSCompiler_object_inline_stack_2428 = instance; + JSCompiler_object_inline_componentStack_2429 = componentStack; + JSCompiler_object_inline_message_2426 = + JSCompiler_object_inline_message_2426 + ? Error(JSCompiler_object_inline_message_2426) : 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_2432.stack = - JSCompiler_object_inline_stack_2434 || ""; - JSCompiler_object_inline_message_2432.digest = - JSCompiler_object_inline_digest_2433; - JSCompiler_object_inline_digest_2433 = - void 0 === JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_message_2426.stack = + JSCompiler_object_inline_stack_2428 || ""; + JSCompiler_object_inline_message_2426.digest = + JSCompiler_object_inline_digest_2427; + JSCompiler_object_inline_digest_2427 = + void 0 === JSCompiler_object_inline_componentStack_2429 ? null - : JSCompiler_object_inline_componentStack_2435; - "string" === typeof JSCompiler_object_inline_digest_2433 && + : JSCompiler_object_inline_componentStack_2429; + "string" === typeof JSCompiler_object_inline_digest_2427 && CapturedStacks.set( - JSCompiler_object_inline_message_2432, - JSCompiler_object_inline_digest_2433 + JSCompiler_object_inline_message_2426, + JSCompiler_object_inline_digest_2427 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2432, + value: JSCompiler_object_inline_message_2426, source: null, - stack: JSCompiler_object_inline_digest_2433 + stack: JSCompiler_object_inline_digest_2427 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9322,34 +9503,32 @@ __DEV__ && renderLanes ); } else if ( - (enableLazyContextPropagation && - !didReceiveUpdate && + (didReceiveUpdate || propagateParentContextChanges( current, workInProgress, renderLanes, !1 ), - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2427 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2433) + didReceiveUpdate || JSCompiler_object_inline_digest_2427) ) { - JSCompiler_object_inline_digest_2433 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2433) { - JSCompiler_object_inline_stack_2434 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2434 & SyncUpdateLanes)) - JSCompiler_object_inline_stack_2434 = SyncHydrationLane; + JSCompiler_object_inline_digest_2427 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2427) { + JSCompiler_object_inline_stack_2428 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2428 & 42)) + JSCompiler_object_inline_stack_2428 = 1; else - switch (JSCompiler_object_inline_stack_2434) { - case SyncLane: - JSCompiler_object_inline_stack_2434 = SyncHydrationLane; + switch (JSCompiler_object_inline_stack_2428) { + case 2: + JSCompiler_object_inline_stack_2428 = 1; break; - case InputContinuousLane: - JSCompiler_object_inline_stack_2434 = - InputContinuousHydrationLane; + case 8: + JSCompiler_object_inline_stack_2428 = 4; break; - case DefaultLane: - JSCompiler_object_inline_stack_2434 = DefaultHydrationLane; + case 32: + JSCompiler_object_inline_stack_2428 = 16; break; case 128: case 256: @@ -9370,40 +9549,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2434 = TransitionHydrationLane; + JSCompiler_object_inline_stack_2428 = 64; break; - case IdleLane: - JSCompiler_object_inline_stack_2434 = IdleHydrationLane; + case 268435456: + JSCompiler_object_inline_stack_2428 = 134217728; break; default: - JSCompiler_object_inline_stack_2434 = 0; + JSCompiler_object_inline_stack_2428 = 0; } - JSCompiler_object_inline_stack_2434 = + JSCompiler_object_inline_stack_2428 = 0 !== - (JSCompiler_object_inline_stack_2434 & - (JSCompiler_object_inline_digest_2433.suspendedLanes | + (JSCompiler_object_inline_stack_2428 & + (JSCompiler_object_inline_digest_2427.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2434; + : JSCompiler_object_inline_stack_2428; if ( - 0 !== JSCompiler_object_inline_stack_2434 && - JSCompiler_object_inline_stack_2434 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2428 && + JSCompiler_object_inline_stack_2428 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2434), + ((prevState.retryLane = JSCompiler_object_inline_stack_2428), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2428 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2427, current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2428 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9411,7 +9590,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2426.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9419,12 +9598,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2432._reactRetry = + (JSCompiler_object_inline_message_2426._reactRetry = workInProgress), (workInProgress = null)) : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2432.nextSibling + JSCompiler_object_inline_message_2426.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9442,73 +9621,73 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2434.children + JSCompiler_object_inline_stack_2428.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2435) + if (JSCompiler_object_inline_componentStack_2429) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2435 = - JSCompiler_object_inline_stack_2434.fallback), - (JSCompiler_object_inline_message_2432 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2429 = + JSCompiler_object_inline_stack_2428.fallback), + (JSCompiler_object_inline_message_2426 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), (componentStack = { mode: "hidden", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2428.children }), disableLegacyMode || - 0 !== (JSCompiler_object_inline_message_2432 & 1) || + (JSCompiler_object_inline_message_2426 & ConcurrentMode) !== NoMode || workInProgress.child === JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2434 = createWorkInProgress( + ? ((JSCompiler_object_inline_stack_2428 = createWorkInProgress( JSCompiler_temp, componentStack )), - (JSCompiler_object_inline_stack_2434.subtreeFlags = + (JSCompiler_object_inline_stack_2428.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)) - : ((JSCompiler_object_inline_stack_2434 = workInProgress.child), - (JSCompiler_object_inline_stack_2434.childLanes = 0), - (JSCompiler_object_inline_stack_2434.pendingProps = + : ((JSCompiler_object_inline_stack_2428 = workInProgress.child), + (JSCompiler_object_inline_stack_2428.childLanes = 0), + (JSCompiler_object_inline_stack_2428.pendingProps = componentStack), - workInProgress.mode & 2 && - ((JSCompiler_object_inline_stack_2434.actualDuration = 0), - (JSCompiler_object_inline_stack_2434.actualStartTime = -1), - (JSCompiler_object_inline_stack_2434.selfBaseDuration = + workInProgress.mode & ProfileMode && + ((JSCompiler_object_inline_stack_2428.actualDuration = -0), + (JSCompiler_object_inline_stack_2428.actualStartTime = -1.1), + (JSCompiler_object_inline_stack_2428.selfBaseDuration = JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2434.treeBaseDuration = + (JSCompiler_object_inline_stack_2428.treeBaseDuration = JSCompiler_temp.treeBaseDuration)), (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2435 = + ? (JSCompiler_object_inline_componentStack_2429 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2429 )) - : ((JSCompiler_object_inline_componentStack_2435 = + : ((JSCompiler_object_inline_componentStack_2429 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_componentStack_2429, + JSCompiler_object_inline_message_2426, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2)), - (JSCompiler_object_inline_componentStack_2435.return = + (JSCompiler_object_inline_componentStack_2429.flags |= 2)), + (JSCompiler_object_inline_componentStack_2429.return = workInProgress), - (JSCompiler_object_inline_stack_2434.return = workInProgress), - (JSCompiler_object_inline_stack_2434.sibling = - JSCompiler_object_inline_componentStack_2435), - (workInProgress.child = JSCompiler_object_inline_stack_2434), - (JSCompiler_object_inline_stack_2434 = - JSCompiler_object_inline_componentStack_2435), - (JSCompiler_object_inline_componentStack_2435 = workInProgress.child), - (JSCompiler_object_inline_message_2432 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2432 - ? (JSCompiler_object_inline_message_2432 = + (JSCompiler_object_inline_stack_2428.return = workInProgress), + (JSCompiler_object_inline_stack_2428.sibling = + JSCompiler_object_inline_componentStack_2429), + (workInProgress.child = JSCompiler_object_inline_stack_2428), + (JSCompiler_object_inline_stack_2428 = + JSCompiler_object_inline_componentStack_2429), + (JSCompiler_object_inline_componentStack_2429 = workInProgress.child), + (JSCompiler_object_inline_message_2426 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2426 + ? (JSCompiler_object_inline_message_2426 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2432.cachePool), + JSCompiler_object_inline_message_2426.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9516,73 +9695,76 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2432 = { + (JSCompiler_object_inline_message_2426 = { baseLanes: - JSCompiler_object_inline_message_2432.baseLanes | renderLanes, + JSCompiler_object_inline_message_2426.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2435.memoizedState = - JSCompiler_object_inline_message_2432), + (JSCompiler_object_inline_componentStack_2429.memoizedState = + JSCompiler_object_inline_message_2426), enableTransitionTracing && - ((JSCompiler_object_inline_message_2432 = enableTransitionTracing + ((JSCompiler_object_inline_message_2426 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2432 && + null !== JSCompiler_object_inline_message_2426 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2429.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, + ? (JSCompiler_object_inline_componentStack_2429.updateQueue = { + transitions: JSCompiler_object_inline_message_2426, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, - markerInstances: JSCompiler_temp, - retryQueue: - null !== componentStack ? componentStack.retryQueue : null - }) - : ((instance.transitions = - JSCompiler_object_inline_message_2432), - (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2435.childLanes = + ? (JSCompiler_object_inline_componentStack_2429.updateQueue = + { + transitions: JSCompiler_object_inline_message_2426, + markerInstances: JSCompiler_temp, + retryQueue: + null !== componentStack + ? componentStack.retryQueue + : null + }) + : ((instance.transitions = + JSCompiler_object_inline_message_2426), + (instance.markerInstances = JSCompiler_temp)))), + (JSCompiler_object_inline_componentStack_2429.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2427, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2428 ); pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2433 = current.child; - current = JSCompiler_object_inline_digest_2433.sibling; - JSCompiler_object_inline_digest_2433 = createWorkInProgress( - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2427 = current.child; + current = JSCompiler_object_inline_digest_2427.sibling; + JSCompiler_object_inline_digest_2427 = createWorkInProgress( + JSCompiler_object_inline_digest_2427, { mode: "visible", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2428.children } ); disableLegacyMode || - 0 !== (workInProgress.mode & 1) || - (JSCompiler_object_inline_digest_2433.lanes = renderLanes); - JSCompiler_object_inline_digest_2433.return = workInProgress; - JSCompiler_object_inline_digest_2433.sibling = null; + (workInProgress.mode & ConcurrentMode) !== NoMode || + (JSCompiler_object_inline_digest_2427.lanes = renderLanes); + JSCompiler_object_inline_digest_2427.return = workInProgress; + JSCompiler_object_inline_digest_2427.sibling = null; null !== current && ((renderLanes = workInProgress.deletions), null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2433; + workInProgress.child = JSCompiler_object_inline_digest_2427; workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2433; + return JSCompiler_object_inline_digest_2427; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = createFiberFromOffscreen( @@ -9604,7 +9786,7 @@ __DEV__ && progressedPrimaryFragment = workInProgress.child; primaryChildren = { mode: "hidden", children: primaryChildren }; disableLegacyMode || - 0 !== (mode & 1) || + (mode & ConcurrentMode) !== NoMode || null === progressedPrimaryFragment ? (progressedPrimaryFragment = createFiberFromOffscreen( primaryChildren, @@ -9614,11 +9796,11 @@ __DEV__ && )) : ((progressedPrimaryFragment.childLanes = 0), (progressedPrimaryFragment.pendingProps = primaryChildren), - workInProgress.mode & 2 && - ((progressedPrimaryFragment.actualDuration = 0), - (progressedPrimaryFragment.actualStartTime = -1), - (progressedPrimaryFragment.selfBaseDuration = 0), - (progressedPrimaryFragment.treeBaseDuration = 0))); + workInProgress.mode & ProfileMode && + ((progressedPrimaryFragment.actualDuration = -0), + (progressedPrimaryFragment.actualStartTime = -1.1), + (progressedPrimaryFragment.selfBaseDuration = -0), + (progressedPrimaryFragment.treeBaseDuration = -0))); fallbackChildren = createFiberFromFragment( fallbackChildren, mode, @@ -9809,7 +9991,10 @@ __DEV__ && nextProps &= SubtreeSuspenseContextMask; } push(suspenseStackCursor, nextProps, workInProgress); - if (disableLegacyMode || 0 !== (workInProgress.mode & 1)) + if ( + disableLegacyMode || + (workInProgress.mode & ConcurrentMode) !== NoMode + ) switch (revealOrder) { case "forwards": renderLanes = workInProgress.child; @@ -9866,7 +10051,7 @@ __DEV__ && } function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { disableLegacyMode || - 0 !== (workInProgress.mode & 1) || + (workInProgress.mode & ConcurrentMode) !== NoMode || null === current || ((current.alternate = null), (workInProgress.alternate = null), @@ -9881,7 +10066,7 @@ __DEV__ && profilerStartTime = -1; workInProgressRootSkippedLanes |= workInProgress.lanes; if (0 === (renderLanes & workInProgress.childLanes)) - if (enableLazyContextPropagation && null !== current) { + if (null !== current) { if ( (propagateParentContextChanges( current, @@ -9909,12 +10094,9 @@ __DEV__ && return workInProgress.child; } function checkScheduledUpdateOrContext(current, renderLanes) { - return 0 !== (current.lanes & renderLanes) || - (enableLazyContextPropagation && - ((current = current.dependencies), - null !== current && checkIfContextChanged(current))) - ? !0 - : !1; + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } function attemptEarlyBailoutIfNoScheduledUpdate( current, @@ -9960,9 +10142,10 @@ __DEV__ && case 12: 0 !== (renderLanes & workInProgress.childLanes) && (workInProgress.flags |= 4); + workInProgress.flags |= 2048; var stateNode = workInProgress.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; break; case 13: stateNode = workInProgress.memoizedState; @@ -9992,8 +10175,7 @@ __DEV__ && case 19: var didSuspendBefore = 0 !== (current.flags & 128); stateNode = 0 !== (renderLanes & workInProgress.childLanes); - enableLazyContextPropagation && - !stateNode && + stateNode || (propagateParentContextChanges( current, workInProgress, @@ -10045,7 +10227,7 @@ __DEV__ && } function beginWork(current, workInProgress, renderLanes) { if (workInProgress._debugNeedsRemount && null !== current) { - var copiedFiber = createFiberFromTypeAndProps( + renderLanes = createFiberFromTypeAndProps( workInProgress.type, workInProgress.key, workInProgress.pendingProps, @@ -10057,13 +10239,13 @@ __DEV__ && if (null === returnFiber) throw Error("Cannot swap the root fiber."); current.alternate = null; workInProgress.alternate = null; - copiedFiber.index = workInProgress.index; - copiedFiber.sibling = workInProgress.sibling; - copiedFiber.return = workInProgress.return; - copiedFiber.ref = workInProgress.ref; - copiedFiber._debugInfo = workInProgress._debugInfo; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; if (workInProgress === returnFiber.child) - returnFiber.child = copiedFiber; + returnFiber.child = renderLanes; else { var prevSibling = returnFiber.child; if (null === prevSibling) @@ -10071,14 +10253,14 @@ __DEV__ && for (; prevSibling.sibling !== workInProgress; ) if (((prevSibling = prevSibling.sibling), null === prevSibling)) throw Error("Expected to find the previous sibling."); - prevSibling.sibling = copiedFiber; + prevSibling.sibling = renderLanes; } - var deletions = returnFiber.deletions; - null === deletions + workInProgress = returnFiber.deletions; + null === workInProgress ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : deletions.push(current); - copiedFiber.flags |= 2; - return copiedFiber; + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; } if (null !== current) if ( @@ -10104,142 +10286,153 @@ __DEV__ && } else { didReceiveUpdate = !1; - var JSCompiler_temp; - if ((JSCompiler_temp = isHydrating)) + if ((returnFiber = isHydrating)) warnIfNotHydrating(), - (JSCompiler_temp = 0 !== (workInProgress.flags & 1048576)); - if (JSCompiler_temp) { - var slotIndex = workInProgress.index; - warnIfNotHydrating(); - pushTreeId(workInProgress, treeForkCount, slotIndex); - } + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); } workInProgress.lanes = 0; switch (workInProgress.tag) { case 16: - a: { - var elementType = workInProgress.elementType; - resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); - var props = workInProgress.pendingProps; - var Component = callLazyInitInDEV(elementType); - workInProgress.type = Component; - if ("function" === typeof Component) - if (shouldConstruct(Component)) { - var resolvedProps = resolveClassComponentProps( - Component, - props, + a: if ( + ((prevSibling = workInProgress.elementType), + resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress), + (returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(prevSibling)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber, !1 - ); - workInProgress.tag = 1; - workInProgress.type = Component = - resolveFunctionForHotReloading(Component); - var JSCompiler_inline_result = updateClassComponent( + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( null, workInProgress, - Component, - resolvedProps, + current, + returnFiber, + renderLanes + ))) + : ((returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + )), + (workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + ); + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, renderLanes ); - } else { - var _resolvedProps = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 0; - validateFunctionComponentInDev(workInProgress, Component); - workInProgress.type = Component = - resolveFunctionForHotReloading(Component); - JSCompiler_inline_result = updateFunctionComponent( + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + returnFiber = disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current, + returnFiber + ); + workInProgress.tag = 14; + workInProgress = updateMemoComponent( null, workInProgress, - Component, - _resolvedProps, + current, + disableDefaultPropsExceptForClasses + ? returnFiber + : resolveDefaultPropsOnNonClassComponent( + current.type, + returnFiber + ), renderLanes ); + break a; } - else { - if (void 0 !== Component && null !== Component) { - var $$typeof = Component.$$typeof; - if ($$typeof === REACT_FORWARD_REF_TYPE) { - var _resolvedProps2 = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 11; - workInProgress.type = Component = - resolveForwardRefForHotReloading(Component); - JSCompiler_inline_result = updateForwardRef( - null, - workInProgress, - Component, - _resolvedProps2, - renderLanes - ); - break a; - } else if ($$typeof === REACT_MEMO_TYPE) { - var _resolvedProps3 = disableDefaultPropsExceptForClasses - ? props - : resolveDefaultPropsOnNonClassComponent(Component, props); - workInProgress.tag = 14; - JSCompiler_inline_result = updateMemoComponent( - null, - workInProgress, - Component, - disableDefaultPropsExceptForClasses - ? _resolvedProps3 - : resolveDefaultPropsOnNonClassComponent( - Component.type, - _resolvedProps3 - ), - renderLanes - ); - break a; - } - } - var hint = ""; - null !== Component && - "object" === typeof Component && - Component.$$typeof === REACT_LAZY_TYPE && - (hint = - " Did you wrap a component in React.lazy() more than once?"); - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - Component + - ". Lazy element type must resolve to a class or function." + - hint - ); - } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + renderLanes = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + renderLanes + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); } - return JSCompiler_inline_result; + return workInProgress; case 0: - var Component$jscomp$0 = workInProgress.type, - unresolvedProps = workInProgress.pendingProps, - resolvedProps$jscomp$0 = + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses || - workInProgress.elementType === Component$jscomp$0 - ? unresolvedProps + workInProgress.elementType === returnFiber + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - Component$jscomp$0, - unresolvedProps - ); - return updateFunctionComponent( - current, - workInProgress, - Component$jscomp$0, - resolvedProps$jscomp$0, - renderLanes + returnFiber, + prevSibling + )), + updateFunctionComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 1: - var _Component = workInProgress.type, - _resolvedProps4 = resolveClassComponentProps( - _Component, + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, workInProgress.pendingProps, - workInProgress.elementType === _Component - ); - return updateClassComponent( - current, - workInProgress, - _Component, - _resolvedProps4, - renderLanes + workInProgress.elementType === returnFiber + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 3: a: { @@ -10248,325 +10441,326 @@ __DEV__ && throw Error( "Should have a current fiber. This is a bug in React." ); - var nextProps = workInProgress.pendingProps, - prevState = workInProgress.memoizedState, - prevChildren = prevState.element; + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; enableTransitionTracing && push(transitionStack, workInProgressTransitions, workInProgress); enableTransitionTracing && pushRootMarkerInstance(workInProgress); - var nextCache = nextState.cache; - pushProvider(workInProgress, CacheContext, nextCache); - nextCache !== prevState.cache && - propagateContextChange(workInProgress, CacheContext, renderLanes); + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); suspendIfUpdateReadFromEntangledAsyncAction(); - var nextChildren = nextState.element; - if (prevState.isDehydrated) { - var overrideState = { - element: nextChildren, - isDehydrated: !1, - cache: nextState.cache - }; - workInProgress.updateQueue.baseState = overrideState; - workInProgress.memoizedState = overrideState; - if (workInProgress.flags & 256) { - var JSCompiler_inline_result$jscomp$0 = - mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); break a; - } else if (nextChildren !== prevChildren) { - var recoverableError = createCapturedValueAtFiber( + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( Error( "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." ), workInProgress ); - queueHydrationError(recoverableError); - JSCompiler_inline_result$jscomp$0 = - mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ); - break a; - } else { - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes ); - hydrationParentFiber = workInProgress; - isHydrating = !0; - hydrationErrors = null; - didSuspendOrErrorDEV = !1; - hydrationDiffRootDEV = null; - rootOrSingletonContext = !0; + break a; + } else for ( - var child = mountChildFibers( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( workInProgress, null, - nextChildren, + nextProps, renderLanes ), - node = (workInProgress.child = child); - node; + workInProgress.child = renderLanes; + renderLanes; ) - (node.flags = (node.flags & -3) | 4096), - (node = node.sibling); - } - } else { + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { resetHydrationState(); - if (nextChildren === prevChildren) { - JSCompiler_inline_result$jscomp$0 = - bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); break a; } reconcileChildren( current, workInProgress, - nextChildren, + nextProps, renderLanes ); } - JSCompiler_inline_result$jscomp$0 = workInProgress.child; + workInProgress = workInProgress.child; } - return JSCompiler_inline_result$jscomp$0; + return workInProgress; case 26: - markRef(current, workInProgress); - if (null === current) { - var resource = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - ); - if (resource) workInProgress.memoizedState = resource; - else if (!isHydrating) { - var type = workInProgress.type, - props$jscomp$0 = workInProgress.pendingProps, - rootContainerInstance = requiredContext( - rootInstanceStackCursor.current - ), - domElement = getOwnerDocumentFromRootContainer( - rootContainerInstance - ).createElement(type); - domElement[internalInstanceKey] = workInProgress; - domElement[internalPropsKey] = props$jscomp$0; - setInitialProperties(domElement, type, props$jscomp$0); - markNodeAsHoistable(domElement); - workInProgress.stateNode = domElement; - } - } else - workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - ); - return null; + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(renderLanes)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = current), + setInitialProperties(returnFiber, renderLanes, current), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); case 27: - pushHostContext(workInProgress); - if (null === current && isHydrating) { - var currentRootContainer = requiredContext( - rootInstanceStackCursor.current - ), - currentHostContext = getHostContext(), - instance = (workInProgress.stateNode = resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - currentRootContainer, - currentHostContext, - !1 - )); - if (!didSuspendOrErrorDEV) { - var differences = diffHydratedProperties( - instance, + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( workInProgress.type, - workInProgress.pendingProps, - currentHostContext - ); - null !== differences && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - differences); - } - hydrationParentFiber = workInProgress; - rootOrSingletonContext = !0; - nextHydratableInstance = getNextHydratable(instance.firstChild); - } - var nextChildren$jscomp$0 = workInProgress.pendingProps.children; - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$0, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, workInProgress, + TransitionAwareHostComponent, + null, null, - nextChildren$jscomp$0, renderLanes - )); - markRef(current, workInProgress); - return workInProgress.child; - case 5: - if (null === current && isHydrating) { - var currentHostContext$jscomp$0 = getHostContext(), - shouldKeepWarning = validateDOMNesting( - workInProgress.type, - currentHostContext$jscomp$0.ancestorInfo - ), - nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if (!(JSCompiler_temp$jscomp$0 = !nextInstance)) { - var instance$jscomp$0 = canHydrateInstance( - nextInstance, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - ); - if (null !== instance$jscomp$0) { - workInProgress.stateNode = instance$jscomp$0; - if (!didSuspendOrErrorDEV) { - var differences$jscomp$0 = diffHydratedProperties( - instance$jscomp$0, - workInProgress.type, - workInProgress.pendingProps, - currentHostContext$jscomp$0 - ); - null !== differences$jscomp$0 && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - differences$jscomp$0); - } - hydrationParentFiber = workInProgress; - nextHydratableInstance = getNextHydratable( - instance$jscomp$0.firstChild - ); - rootOrSingletonContext = !1; - var JSCompiler_inline_result$jscomp$1 = !0; - } else JSCompiler_inline_result$jscomp$1 = !1; - JSCompiler_temp$jscomp$0 = !JSCompiler_inline_result$jscomp$1; - } - JSCompiler_temp$jscomp$0 && - (shouldKeepWarning && - warnNonHydratedInstance(workInProgress, nextInstance), - throwOnHydrationMismatch(workInProgress)); - } - pushHostContext(workInProgress); - var type$jscomp$0 = workInProgress.type, - nextProps$jscomp$0 = workInProgress.pendingProps, - prevProps = null !== current ? current.memoizedProps : null, - nextChildren$jscomp$1 = nextProps$jscomp$0.children; - shouldSetTextContent(type$jscomp$0, nextProps$jscomp$0) - ? (nextChildren$jscomp$1 = null) - : null !== prevProps && - shouldSetTextContent(type$jscomp$0, prevProps) && - (workInProgress.flags |= 32); - if (null !== workInProgress.memoizedState) { - var newState = renderWithHooks( + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( current, workInProgress, - TransitionAwareHostComponent, - null, - null, + returnFiber, renderLanes - ); - HostTransitionContext._currentValue = newState; - enableLazyContextPropagation || - (didReceiveUpdate && - null !== current && - current.memoizedState.memoizedState !== newState && - propagateContextChange( - workInProgress, - HostTransitionContext, - renderLanes - )); - } - markRef(current, workInProgress); - reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$1, - renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 6: - if (null === current && isHydrating) { - var text = workInProgress.pendingProps, - ancestor = getHostContext().ancestorInfo.current; - var shouldKeepWarning$jscomp$0 = - null != ancestor ? validateTextNesting(text, ancestor.tag) : !0; - var nextInstance$jscomp$0 = nextHydratableInstance, - JSCompiler_temp$jscomp$1; - if (!(JSCompiler_temp$jscomp$1 = !nextInstance$jscomp$0)) { - var textInstance = canHydrateTextInstance( - nextInstance$jscomp$0, - workInProgress.pendingProps, - rootOrSingletonContext - ); - if (null !== textInstance) { - workInProgress.stateNode = textInstance; - hydrationParentFiber = workInProgress; - nextHydratableInstance = null; - var JSCompiler_inline_result$jscomp$2 = !0; - } else JSCompiler_inline_result$jscomp$2 = !1; - JSCompiler_temp$jscomp$1 = !JSCompiler_inline_result$jscomp$2; - } - JSCompiler_temp$jscomp$1 && - (shouldKeepWarning$jscomp$0 && - warnNonHydratedInstance(workInProgress, nextInstance$jscomp$0), - throwOnHydrationMismatch(workInProgress)); - } - return null; + return ( + null === current && + isHydrating && + ((renderLanes = workInProgress.pendingProps), + (current = getHostContext().ancestorInfo.current), + (renderLanes = + null != current + ? validateTextNesting(renderLanes, current.tag) + : !0), + (current = nextHydratableInstance), + (returnFiber = !current) || + ((returnFiber = canHydrateTextInstance( + current, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (renderLanes && + warnNonHydratedInstance(workInProgress, current), + throwOnHydrationMismatch(workInProgress))), + null + ); case 13: return updateSuspenseComponent(current, workInProgress, renderLanes); case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - var nextChildren$jscomp$2 = workInProgress.pendingProps; - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - nextChildren$jscomp$2, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$2, - renderLanes - ); - return workInProgress.child; case 11: - var type$jscomp$1 = workInProgress.type, - _unresolvedProps2 = workInProgress.pendingProps, - _resolvedProps5 = + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses || - workInProgress.elementType === type$jscomp$1 - ? _unresolvedProps2 + workInProgress.elementType === returnFiber + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - type$jscomp$1, - _unresolvedProps2 - ); - return updateForwardRef( - current, - workInProgress, - type$jscomp$1, - _resolvedProps5, - renderLanes + returnFiber, + prevSibling + )), + updateForwardRef( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 7: return ( @@ -10589,103 +10783,96 @@ __DEV__ && workInProgress.child ); case 12: - workInProgress.flags |= 4; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 10: - a: { - var context = enableRenderableContext + return ( + (returnFiber = enableRenderableContext ? workInProgress.type - : workInProgress.type._context; - var newProps = workInProgress.pendingProps, - oldProps = workInProgress.memoizedProps, - newValue = newProps.value; - "value" in newProps || + : workInProgress.type._context), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || hasWarnedAboutUsingNoValuePropOnContextProvider || ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), error$jscomp$0( "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )); - pushProvider(workInProgress, context, newValue); - if (!enableLazyContextPropagation && null !== oldProps) - if (objectIs(oldProps.value, newValue)) { - if ( - oldProps.children === newProps.children && - !didPerformWorkStackCursor.current - ) { - var JSCompiler_inline_result$jscomp$3 = - bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - } else - propagateContextChange(workInProgress, context, renderLanes); + )), + pushProvider(workInProgress, returnFiber, nextProps), reconcileChildren( current, workInProgress, - newProps.children, + prevSibling.children, renderLanes - ); - JSCompiler_inline_result$jscomp$3 = workInProgress.child; - } - return JSCompiler_inline_result$jscomp$3; + ), + workInProgress.child + ); case 9: - if (enableRenderableContext) - var context$jscomp$0 = workInProgress.type._context; - else - (context$jscomp$0 = workInProgress.type), - void 0 !== context$jscomp$0._context && - (context$jscomp$0 = context$jscomp$0._context); - var render = workInProgress.pendingProps.children; - "function" !== typeof render && - error$jscomp$0( - "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." - ); - prepareToReadContext(workInProgress, renderLanes); - var newValue$jscomp$0 = readContext(context$jscomp$0); - enableSchedulingProfiler && - markComponentRenderStarted(workInProgress); - var newChildren = callComponentInDEV( - render, - newValue$jscomp$0, - void 0 + return ( + enableRenderableContext + ? (prevSibling = workInProgress.type._context) + : ((prevSibling = workInProgress.type), + void 0 !== prevSibling._context && + (prevSibling = prevSibling._context)), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + error$jscomp$0( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + enableSchedulingProfiler && + markComponentRenderStarted(workInProgress), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + enableSchedulingProfiler && markComponentRenderStopped(), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - enableSchedulingProfiler && markComponentRenderStopped(); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, newChildren, renderLanes); - return workInProgress.child; case 14: - var _type = workInProgress.type, - _unresolvedProps3 = workInProgress.pendingProps, - _resolvedProps6 = disableDefaultPropsExceptForClasses - ? _unresolvedProps3 + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (prevSibling = disableDefaultPropsExceptForClasses + ? prevSibling : resolveDefaultPropsOnNonClassComponent( - _type, - _unresolvedProps3 - ); - _resolvedProps6 = disableDefaultPropsExceptForClasses - ? _resolvedProps6 - : resolveDefaultPropsOnNonClassComponent( - _type.type, - _resolvedProps6 - ); - return updateMemoComponent( - current, - workInProgress, - _type, - _resolvedProps6, - renderLanes + returnFiber, + prevSibling + )), + (prevSibling = disableDefaultPropsExceptForClasses + ? prevSibling + : resolveDefaultPropsOnNonClassComponent( + returnFiber.type, + prevSibling + )), + updateMemoComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) ); case 15: return updateSimpleMemoComponent( @@ -10697,49 +10884,48 @@ __DEV__ && ); case 17: if (disableLegacyMode) break; - var _Component2 = workInProgress.type, - _resolvedProps7 = resolveClassComponentProps( - _Component2, - workInProgress.pendingProps, - workInProgress.elementType === _Component2 - ); + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); workInProgress.tag = 1; - if (isContextProvider(_Component2)) { - var hasContext = !0; - pushContextProvider(workInProgress); - } else hasContext = !1; - prepareToReadContext(workInProgress, renderLanes); - constructClassInstance(workInProgress, _Component2, _resolvedProps7); + isContextProvider(returnFiber) + ? ((current = !0), pushContextProvider(workInProgress)) + : (current = !1); + prepareToReadContext(workInProgress); + constructClassInstance(workInProgress, returnFiber, prevSibling); mountClassInstance( workInProgress, - _Component2, - _resolvedProps7, + returnFiber, + prevSibling, renderLanes ); return finishClassComponent( null, workInProgress, - _Component2, + returnFiber, !0, - hasContext, + current, renderLanes ); case 28: if (disableLegacyMode) break; - var _Component3 = workInProgress.type, - _resolvedProps8 = resolveClassComponentProps( - _Component3, - workInProgress.pendingProps, - workInProgress.elementType === _Component3 - ); + returnFiber = workInProgress.type; + prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps, + workInProgress.elementType === returnFiber + ); resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); workInProgress.tag = 0; return updateFunctionComponent( null, workInProgress, - _Component3, - _resolvedProps8, + returnFiber, + prevSibling, renderLanes ); case 19: @@ -10749,15 +10935,17 @@ __DEV__ && renderLanes ); case 21: - var nextChildren$jscomp$3 = workInProgress.pendingProps.children; - markRef(current, workInProgress); - reconcileChildren( - current, - workInProgress, - nextChildren$jscomp$3, - renderLanes + return ( + (returnFiber = workInProgress.pendingProps.children), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 22: return updateOffscreenComponent(current, workInProgress, renderLanes); case 23: @@ -10767,96 +10955,95 @@ __DEV__ && renderLanes ); case 24: - prepareToReadContext(workInProgress, renderLanes); - var parentCache = readContext(CacheContext); - if (null === current) { - var cacheFromPool = peekCacheFromPool(); - if (null !== cacheFromPool) var freshCache = cacheFromPool; - else { - var root = workInProgressRoot, - freshCache$jscomp$0 = createCache(); - root.pooledCache = freshCache$jscomp$0; - retainCache(freshCache$jscomp$0); - null !== freshCache$jscomp$0 && - (root.pooledCacheLanes |= renderLanes); - freshCache = freshCache$jscomp$0; - } - workInProgress.memoizedState = { - parent: parentCache, - cache: freshCache - }; - initializeUpdateQueue(workInProgress); - pushProvider(workInProgress, CacheContext, freshCache); - } else { - 0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()); - var prevState$jscomp$0 = current.memoizedState, - nextState$jscomp$0 = workInProgress.memoizedState; - if (prevState$jscomp$0.parent !== parentCache) { - var derivedState = { parent: parentCache, cache: parentCache }; - workInProgress.memoizedState = derivedState; - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - derivedState); - pushProvider(workInProgress, CacheContext, parentCache); - } else { - var nextCache$jscomp$0 = nextState$jscomp$0.cache; - pushProvider(workInProgress, CacheContext, nextCache$jscomp$0); - nextCache$jscomp$0 !== prevState$jscomp$0.cache && - propagateContextChange( - workInProgress, - CacheContext, - renderLanes - ); - } - } - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child ); - return workInProgress.child; case 25: - if (enableTransitionTracing) { - if (enableTransitionTracing) { - if (null === current) { - var currentTransitions = enableTransitionTracing - ? transitionStack.current - : null; - if (null !== currentTransitions) { - var markerInstance = { - tag: TransitionTracingMarker, - transitions: new Set(currentTransitions), - pendingBoundaries: null, - name: workInProgress.pendingProps.name, - aborts: null - }; - workInProgress.stateNode = markerInstance; - workInProgress.flags |= 2048; - } - } else - current.memoizedProps.name !== - workInProgress.pendingProps.name && - error$jscomp$0( - "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." - ); - var instance$jscomp$1 = workInProgress.stateNode; - null !== instance$jscomp$1 && - pushMarkerInstance(workInProgress, instance$jscomp$1); - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ); - var JSCompiler_inline_result$jscomp$4 = workInProgress.child; - } else JSCompiler_inline_result$jscomp$4 = null; - return JSCompiler_inline_result$jscomp$4; - } + if (enableTransitionTracing) + return ( + enableTransitionTracing + ? (null === current + ? ((returnFiber = enableTransitionTracing + ? transitionStack.current + : null), + null !== returnFiber && + ((returnFiber = { + tag: TransitionTracingMarker, + transitions: new Set(returnFiber), + pendingBoundaries: null, + name: workInProgress.pendingProps.name, + aborts: null + }), + (workInProgress.stateNode = returnFiber), + (workInProgress.flags |= 2048))) + : current.memoizedProps.name !== + workInProgress.pendingProps.name && + error$jscomp$0( + "Changing the name of a tracing marker after mount is not supported. To remount the tracing marker, pass it a new key." + ), + (returnFiber = workInProgress.stateNode), + null !== returnFiber && + pushMarkerInstance(workInProgress, returnFiber), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + (workInProgress = workInProgress.child)) + : (workInProgress = null), + workInProgress + ); break; case 29: throw workInProgress.pendingProps; @@ -10898,97 +11085,21 @@ __DEV__ && renderLanes, propagationRoot ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - error$jscomp$0( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChange(workInProgress, context, renderLanes) { - if (enableLazyContextPropagation) - propagateContextChanges(workInProgress, [context], renderLanes, !0); - else if (!enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - for (var dependency = list.firstContext; null !== dependency; ) { - if (dependency.context === context) { - if (1 === fiber.tag) { - dependency = createUpdate(renderLanes & -renderLanes); - dependency.tag = ForceUpdate; - var updateQueue = fiber.updateQueue; - if (null !== updateQueue) { - updateQueue = updateQueue.shared; - var pending = updateQueue.pending; - null === pending - ? (dependency.next = dependency) - : ((dependency.next = pending.next), - (pending.next = dependency)); - updateQueue.pending = dependency; - } - } - fiber.lanes |= renderLanes; - dependency = fiber.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - workInProgress - ); - list.lanes |= renderLanes; - break; - } - dependency = dependency.next; - } - } else if (10 === fiber.tag) - nextFiber = fiber.type === workInProgress.type ? null : fiber.child; - else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = fiber.sibling; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } + parent !== propagationRoot && + error$jscomp$0( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." + ); } function propagateContextChanges( workInProgress, @@ -10996,65 +11107,74 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress - ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + var i = 0; + b: for (; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + var select = dependency.select; + if ( + null != select && + null != dependency.lastSelectedValue && + !checkIfSelectedContextValuesChanged( + dependency.lastSelectedValue, + select(dependency.context._currentValue) + ) + ) + continue b; + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; } - nextFiber = nextFiber.return; + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress + ); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; } - fiber = nextFiber; - } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } } function propagateParentContextChanges( @@ -11063,85 +11183,90 @@ __DEV__ && renderLanes, forcePropagateEntireTree ) { - if (enableLazyContextPropagation) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = enableRenderableContext - ? parent.type - : parent.type._context; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = enableRenderableContext + ? parent.type + : parent.type._context; + objectIs(parent.pendingProps.value, currentParent.value) || (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); + ? current.push(context) + : (current = [context])); } - parent = parent.return; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; + parent = parent.return; } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; + } + function checkIfSelectedContextValuesChanged( + oldComparedValue, + newComparedValue + ) { + if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) { + if (oldComparedValue.length !== newComparedValue.length) return !0; + for (var i = 0; i < oldComparedValue.length; i++) + if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0; + } else throw Error("Compared context values must be arrays"); + return !1; } function checkIfContextChanged(currentDependencies) { - if (!enableLazyContextPropagation) return !1; for ( currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) { + var newValue = currentDependencies.context._currentValue, + oldValue = currentDependencies.memoizedValue; if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + null != currentDependencies.select && + null != currentDependencies.lastSelectedValue + ) { + if ( + checkIfSelectedContextValuesChanged( + currentDependencies.lastSelectedValue, + currentDependencies.select(newValue) + ) ) - ) - return !0; + return !0; + } else if (!objectIs(newValue, oldValue)) return !0; currentDependencies = currentDependencies.next; } return !1; } - function prepareToReadContext(workInProgress, renderLanes) { + function prepareToReadContext(workInProgress) { currentlyRenderingFiber = workInProgress; lastFullyObservedContext = lastContextDependency = null; workInProgress = workInProgress.dependencies; - null !== workInProgress && - (enableLazyContextPropagation - ? (workInProgress.firstContext = null) - : null !== workInProgress.firstContext && - (0 !== (workInProgress.lanes & renderLanes) && - (didReceiveUpdate = !0), - (workInProgress.firstContext = null))); + null !== workInProgress && (workInProgress.firstContext = null); } function readContext(context) { isDisallowedContextReadInDEV && @@ -11150,9 +11275,8 @@ __DEV__ && ); return readContextForConsumer(currentlyRenderingFiber, context); } - function readContextDuringReconciliation(consumer, context, renderLanes) { - null === currentlyRenderingFiber && - prepareToReadContext(consumer, renderLanes); + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber && prepareToReadContext(consumer); return readContextForConsumer(consumer, context); } function readContextForConsumer(consumer, context) { @@ -11167,8 +11291,12 @@ __DEV__ && "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 }; - enableLazyContextPropagation && (consumer.flags |= 524288); + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; } @@ -11215,16 +11343,16 @@ __DEV__ && (null === transitionStack.current ? push(transitionStack, newTransitions, offscreenWorkInProgress) : null === newTransitions - ? push( - transitionStack, - transitionStack.current, - offscreenWorkInProgress - ) - : push( - transitionStack, - transitionStack.current.concat(newTransitions), - offscreenWorkInProgress - )); + ? push( + transitionStack, + transitionStack.current, + offscreenWorkInProgress + ) + : push( + transitionStack, + transitionStack.current.concat(newTransitions), + offscreenWorkInProgress + )); } function popTransition(workInProgress, current) { null !== current && @@ -11331,7 +11459,7 @@ __DEV__ && : null; } function containsNode$1(node) { - for (node = getClosestInstanceFromNode(node) || null; null !== node; ) { + for (node = getClosestInstanceFromNode(node); null !== node; ) { if (21 === node.tag && node.stateNode === this) return !0; node = node.return; } @@ -11368,12 +11496,13 @@ __DEV__ && ); } function scheduleRetryEffect(workInProgress, retryQueue) { - null !== retryQueue - ? (workInProgress.flags |= 4) - : workInProgress.flags & 16384 && - ((retryQueue = - 22 !== workInProgress.tag ? claimNextRetryLane() : OffscreenLane), - (workInProgress.lanes |= retryQueue)); + null !== retryQueue && (workInProgress.flags |= 4); + workInProgress.flags & 16384 && + ((retryQueue = + 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), + (workInProgress.lanes |= retryQueue), + enableSiblingPrerendering && + (workInProgressSuspendedRetryLanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -11407,7 +11536,7 @@ __DEV__ && newChildLanes = 0, subtreeFlags = 0; if (didBailout) - if (0 !== (completedWork.mode & 2)) { + if ((completedWork.mode & ProfileMode) !== NoMode) { for ( var _treeBaseDuration = completedWork.selfBaseDuration, _child2 = completedWork.child; @@ -11432,7 +11561,7 @@ __DEV__ && (subtreeFlags |= _treeBaseDuration.flags & 31457280), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); - else if (0 !== (completedWork.mode & 2)) { + else if ((completedWork.mode & ProfileMode) !== NoMode) { _treeBaseDuration = completedWork.actualDuration; _child2 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) @@ -11531,19 +11660,19 @@ __DEV__ && : (bubbleProperties(workInProgress), (workInProgress.flags &= -16777217))) : renderLanes - ? renderLanes !== current.memoizedState - ? (markUpdate(workInProgress), + ? renderLanes !== current.memoizedState + ? (markUpdate(workInProgress), + bubbleProperties(workInProgress), + preloadResourceAndSuspendIfNeeded( + workInProgress, + renderLanes + )) + : (bubbleProperties(workInProgress), + (workInProgress.flags &= -16777217)) + : (current.memoizedProps !== newProps && + markUpdate(workInProgress), bubbleProperties(workInProgress), - preloadResourceAndSuspendIfNeeded( - workInProgress, - renderLanes - )) - : (bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)) - : (current.memoizedProps !== newProps && - markUpdate(workInProgress), - bubbleProperties(workInProgress), - (workInProgress.flags &= -16777217)), + (workInProgress.flags &= -16777217)), null ); case 27: @@ -11807,7 +11936,7 @@ __DEV__ && ); _type[internalInstanceKey] = workInProgress; bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && null !== newProps && ((_type = workInProgress.child), null !== _type && @@ -11820,7 +11949,7 @@ __DEV__ && (workInProgress.memoizedState = null), (workInProgress.flags |= 4), bubbleProperties(workInProgress), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && null !== newProps && ((_type = workInProgress.child), null !== _type && @@ -11843,7 +11972,7 @@ __DEV__ && if (0 !== (workInProgress.flags & 128)) return ( (workInProgress.lanes = renderLanes), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress ); @@ -11869,7 +11998,7 @@ __DEV__ && null != workInProgress.memoizedProps.suspenseCallback && (workInProgress.flags |= 4); bubbleProperties(workInProgress); - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && newProps && ((current = workInProgress.child), null !== current && @@ -11966,7 +12095,7 @@ __DEV__ && } else 2 * now$1() - _type.renderingStartTime > workInProgressRootRenderTargetTime && - renderLanes !== OffscreenLane && + 536870912 !== renderLanes && ((workInProgress.flags |= 128), (newProps = !0), cutOffTailIfNeeded(_type, !1), @@ -12023,9 +12152,11 @@ __DEV__ && ? (null !== current.memoizedState) !== newProps && (workInProgress.flags |= 8192) : newProps && (workInProgress.flags |= 8192)), - !newProps || (!disableLegacyMode && 0 === (workInProgress.mode & 1)) + !newProps || + (!disableLegacyMode && + (workInProgress.mode & ConcurrentMode) === NoMode) ? bubbleProperties(workInProgress) - : 0 !== (renderLanes & OffscreenLane) && + : 0 !== (renderLanes & 536870912) && 0 === (workInProgress.flags & 128) && (bubbleProperties(workInProgress), 23 !== workInProgress.tag && @@ -12085,7 +12216,7 @@ __DEV__ && (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null @@ -12122,7 +12253,7 @@ __DEV__ && current = workInProgress.flags; return current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null; @@ -12149,7 +12280,7 @@ __DEV__ && (current = workInProgress.flags), current & 65536 ? ((workInProgress.flags = (current & -65537) | 128), - 0 !== (workInProgress.mode & 2) && + (workInProgress.mode & ProfileMode) !== NoMode && transferActualDuration(workInProgress), workInProgress) : null @@ -12168,171 +12299,681 @@ __DEV__ && return null; } } - function unwindInterruptedWork(current, interruptedWork) { - popTreeContext(interruptedWork); - switch (interruptedWork.tag) { - case 1: - current = interruptedWork.type.childContextTypes; - null !== current && void 0 !== current && popContext(interruptedWork); - break; - case 3: - popProvider(CacheContext, interruptedWork); - enableTransitionTracing && - enableTransitionTracing && - pop(markerInstanceStack, interruptedWork); - enableTransitionTracing && pop(transitionStack, interruptedWork); - popHostContainer(interruptedWork); - popTopLevelContextObject(interruptedWork); - break; - case 26: - case 27: - case 5: - popHostContext(interruptedWork); - break; - case 4: - popHostContainer(interruptedWork); - break; - case 13: - popSuspenseHandler(interruptedWork); - break; - case 19: - pop(suspenseStackCursor, interruptedWork); - break; - case 10: - popProvider( - enableRenderableContext - ? interruptedWork.type - : interruptedWork.type._context, - interruptedWork + function unwindInterruptedWork(current, interruptedWork) { + popTreeContext(interruptedWork); + switch (interruptedWork.tag) { + case 1: + current = interruptedWork.type.childContextTypes; + null !== current && void 0 !== current && popContext(interruptedWork); + break; + case 3: + popProvider(CacheContext, interruptedWork); + enableTransitionTracing && + enableTransitionTracing && + pop(markerInstanceStack, interruptedWork); + enableTransitionTracing && pop(transitionStack, interruptedWork); + popHostContainer(interruptedWork); + popTopLevelContextObject(interruptedWork); + break; + case 26: + case 27: + case 5: + popHostContext(interruptedWork); + break; + case 4: + popHostContainer(interruptedWork); + break; + case 13: + popSuspenseHandler(interruptedWork); + break; + case 19: + pop(suspenseStackCursor, interruptedWork); + break; + case 10: + popProvider( + enableRenderableContext + ? interruptedWork.type + : interruptedWork.type._context, + interruptedWork + ); + break; + case 22: + case 23: + popSuspenseHandler(interruptedWork); + popHiddenContext(interruptedWork); + popTransition(interruptedWork, current); + break; + case 24: + popProvider(CacheContext, interruptedWork); + break; + case 25: + enableTransitionTracing && + null !== interruptedWork.stateNode && + enableTransitionTracing && + pop(markerInstanceStack, interruptedWork); + } + } + function shouldProfile(current) { + return (current.mode & ProfileMode) !== NoMode; + } + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookLayoutUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + 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 && + (enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + 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) { + error$jscomp$0( + "%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$11) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$11); + } + } + function commitHookEffectListUnmount( + flags, + finishedWork, + nearestMountedAncestor + ) { + 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), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && + injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( + finishedWork + )), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !0), + runWithFiberInDEV( + finishedWork, + callDestroyInDEV, + finishedWork, + nearestMountedAncestor, + destroy + ), + (flags & Insertion) !== NoFlags && + (isRunningInsertionEffect = !1), + enableSchedulingProfiler && + ((flags & Passive) !== NoFlags + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : (flags & Layout) !== NoFlags && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error$12) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$12); + } + } + function commitHookPassiveMountEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookPassiveUnmountEffects( + finishedWork, + nearestMountedAncestor, + hookFlags + ) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ), + recordEffectDuration()) + : commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor + ); + } + function commitClassDidMount(finishedWork) { + var instance = finishedWork.stateNode; + "function" === typeof instance.componentDidMount && + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + instance + ); + } + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 ); - break; - case 22: - case 23: - popSuspenseHandler(interruptedWork); - popHiddenContext(interruptedWork); - popTransition(interruptedWork, current); - break; - case 24: - popProvider(CacheContext, interruptedWork); - break; - case 25: - enableTransitionTracing && - null !== interruptedWork.stateNode && - enableTransitionTracing && - pop(markerInstanceStack, interruptedWork); + } catch (error$13) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$13); + } } } - function shouldProfile(current) { - return ( - 0 !== (current.mode & 2) && - (executionContext & CommitContext) !== NoContext - ); + 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 && + error$jscomp$0( + "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 && + error$jscomp$0( + "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 () { + error$jscomp$0( + "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", + getComponentNameFromFiber(finishedWork) + ); + })); + current.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error$16) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + } } function safelyCallComponentWillUnmount( current, nearestMountedAncestor, instance ) { - try { - if ( - ((instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - )), - (instance.state = current.memoizedState), - shouldProfile(current)) - ) - try { - startLayoutEffectTimer(), instance.componentWillUnmount(); - } finally { - recordLayoutEffectDuration(current); - } - else instance.componentWillUnmount(); - } catch (error$7) { - captureCommitPhaseError(current, nearestMountedAncestor, error$7); + instance.props = resolveClassComponentProps( + current.type, + current.memoizedProps, + current.elementType === current.type + ); + instance.state = current.memoizedState; + shouldProfile(current) + ? (startEffectTimer(), + runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ), + recordEffectDuration()) + : runWithFiberInDEV( + current, + callComponentWillUnmountInDEV, + current, + nearestMountedAncestor, + instance + ); + } + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case 26: + case 27: + case 5: + var instanceToUse = instance; + break; + default: + instanceToUse = instance; + } + 21 === finishedWork.tag && (instanceToUse = instance); + if ("function" === typeof ref) + if (shouldProfile(finishedWork)) + try { + startEffectTimer(), + (finishedWork.refCleanup = ref(instanceToUse)); + } finally { + recordEffectDuration(); + } + else finishedWork.refCleanup = ref(instanceToUse); + else + disableStringRefs && "string" === typeof ref + ? error$jscomp$0("String refs are no longer supported.") + : ref.hasOwnProperty("current") || + error$jscomp$0( + "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", + getComponentNameFromFiber(finishedWork) + ), + (ref.current = instanceToUse); } } 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; + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error$17) { + captureCommitPhaseError(current, nearestMountedAncestor, error$17); + } + } + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref, + refCleanup = current.refCleanup; + if (null !== ref) + if ("function" === typeof refCleanup) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), runWithFiberInDEV(current, refCleanup); + } finally { + recordEffectDuration(current); + } + else runWithFiberInDEV(current, refCleanup); + } catch (error$18) { + captureCommitPhaseError(current, nearestMountedAncestor, error$18); + } finally { + (current.refCleanup = null), + (current = current.alternate), + null != current && (current.refCleanup = null); } - 21 === current.tag && (instanceToUse = instance); - if ("function" === typeof ref) + else if ("function" === typeof ref) + try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), - (current.refCleanup = ref(instanceToUse)); + startEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else current.refCleanup = ref(instanceToUse); - else - ref.hasOwnProperty("current") || - error$jscomp$0( - "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", - getComponentNameFromFiber(current) - ), - (ref.current = instanceToUse); + else runWithFiberInDEV(current, ref, null); + } catch (error$19) { + captureCommitPhaseError(current, nearestMountedAncestor, error$19); + } + else ref.current = null; + } + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit; + _finishedWork$memoize = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize && + _finishedWork$memoize( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitStartTime + ); + } + function commitProfilerPostCommitImpl( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { + var _finishedWork$memoize2 = finishedWork.memoizedProps; + finishedWork = _finishedWork$memoize2.id; + _finishedWork$memoize2 = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof _finishedWork$memoize2 && + _finishedWork$memoize2( + finishedWork, + current, + passiveEffectDuration, + commitStartTime + ); + } + function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ) { + try { + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); + } + } + function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + runWithFiberInDEV( + finishedWork, + commitMount, + instance, + type, + props, + finishedWork + ); + } catch (error$22) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$22); + } + } + function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + runWithFiberInDEV( + finishedWork, + commitUpdate, + finishedWork.stateNode, + finishedWork.type, + oldProps, + newProps, + finishedWork + ); + } catch (error$23) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$23); + } + } + 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); } - } catch (error$8) { - captureCommitPhaseError(current, nearestMountedAncestor, error$8); + if (!(fiber.flags & 2)) return fiber.stateNode; } } - 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$9) { - captureCommitPhaseError(current, nearestMountedAncestor, error$9); - } 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$10) { - captureCommitPhaseError(current, nearestMountedAncestor, error$10); + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? parent.nodeType === COMMENT_NODE + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (parent.nodeType === COMMENT_NODE + ? ((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; } - else ref.current = null; - } - function safelyCallDestroy(current, nearestMountedAncestor, destroy) { - try { - destroy(); - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); + 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." + ); + } } } function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; eventsEnabled = _enabled; - root = getActiveElementDeep(); + root = getActiveElementDeep(root); if (hasSelectionCapabilities(root)) { if ("selectionStart" in root) var JSCompiler_temp = { @@ -12354,7 +12995,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$50) { + } catch (e$42) { JSCompiler_temp = null; break a; } @@ -12419,26 +13060,81 @@ __DEV__ && ) (anchorOffset = root[JSCompiler_temp]), doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); root = firstChild.child; if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) (root.return = firstChild), (nextEffect = root); else for (; null !== nextEffect; ) { - firstChild = nextEffect; - try { - runWithFiberInDEV( - firstChild, - commitBeforeMutationEffectsOnFiber, - firstChild - ); - } catch (error$12) { - captureCommitPhaseError(firstChild, firstChild.return, error$12); + root = firstChild = nextEffect; + JSCompiler_temp = root.alternate; + anchorOffset = root.flags; + if ( + (focusNode = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((focusNode = 13 === root.tag)) + a: { + if ( + null !== JSCompiler_temp && + ((focusNode = JSCompiler_temp.memoizedState), + null === focusNode || null !== focusNode.dehydrated) + ) { + focusNode = root.memoizedState; + focusNode = + null !== focusNode && null === focusNode.dehydrated; + break a; + } + focusNode = !1; + } + focusNode = + focusNode && doesFiberContain(root, focusedInstanceHandle); + } + focusNode && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(root)); + 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: + 0 !== (anchorOffset & 1024) && + clearContainer(root.stateNode.containerInfo); + 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) { @@ -12454,425 +13150,55 @@ __DEV__ && focusedInstanceHandle = null; return firstChild; } - function commitBeforeMutationEffectsOnFiber(finishedWork) { - var current = finishedWork.alternate, - flags = finishedWork.flags; - if ( - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle - ) { - var JSCompiler_temp; - if ((JSCompiler_temp = 13 === finishedWork.tag)) - a: { - if ( - null !== current && - ((JSCompiler_temp = current.memoizedState), - null === JSCompiler_temp || null !== JSCompiler_temp.dehydrated) - ) { - JSCompiler_temp = finishedWork.memoizedState; - JSCompiler_temp = - null !== JSCompiler_temp && null === JSCompiler_temp.dehydrated; - break a; - } - JSCompiler_temp = !1; - } - JSCompiler_temp && - doesFiberContain(finishedWork, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - finishedWork - ), - (_enabled = !1)); - } - 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: - 0 !== (flags & 1024) && - null !== current && - ((flags = current.memoizedProps), - (JSCompiler_temp = current.memoizedState), - (current = finishedWork.stateNode), - finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (current.props !== finishedWork.memoizedProps && - error$jscomp$0( - "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 && - error$jscomp$0( - "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, - finishedWork.elementType === finishedWork.type - ), - JSCompiler_temp - )), - (JSCompiler_temp = didWarnAboutUndefinedSnapshotBeforeUpdate), - void 0 !== flags || - JSCompiler_temp.has(finishedWork.type) || - (JSCompiler_temp.add(finishedWork.type), - error$jscomp$0( - "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", - getComponentNameFromFiber(finishedWork) - )), - (current.__reactInternalSnapshotBeforeUpdate = flags)); - break; - case 3: - 0 !== (flags & 1024) && - clearContainer(finishedWork.stateNode.containerInfo); - 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), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork)), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - 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) { - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - )); - var create = effect.create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var inst = effect.inst; - create = create(); - inst.destroy = create; - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !1); - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : (flags & Layout) !== NoFlags && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - void 0 !== create && - "function" !== typeof create && - ((inst = - 0 !== (effect.tag & Layout) - ? "useLayoutEffect" - : 0 !== (effect.tag & Insertion) - ? "useInsertionEffect" - : "useEffect"), - error$jscomp$0( - "%s must not return anything besides a function, which is used for clean-up.%s", - inst, - null === create - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof create.then - ? "\n\nIt looks like you wrote " + - inst + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - inst + - "(() => {\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: " + create - )); - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function commitPassiveEffectDurations(finishedRoot, finishedWork) { - if (executionContext & CommitContext && 0 !== (finishedWork.flags & 4)) - switch (finishedWork.tag) { - case 12: - finishedRoot = finishedWork.stateNode.passiveEffectDuration; - var _finishedWork$memoize = finishedWork.memoizedProps, - id = _finishedWork$memoize.id; - _finishedWork$memoize = _finishedWork$memoize.onPostCommit; - var commitTime$jscomp$0 = commitTime, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize( - id, - phase, - finishedRoot, - commitTime$jscomp$0 - ); - finishedWork = finishedWork.return; - a: for (; null !== finishedWork; ) { - switch (finishedWork.tag) { - case 3: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - case 12: - finishedWork.stateNode.passiveEffectDuration += finishedRoot; - break a; - } - finishedWork = finishedWork.return; - } - } - } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$13) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$13); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$14) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$14); - } - } - 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 && - error$jscomp$0( - "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 && - error$jscomp$0( - "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$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } - } - } - 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); - } - } catch (error$20) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$20); - } - } - 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) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; - } - } catch (error$21) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$21); - } - } - 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)) - if ( - (finishedWork.type.defaultProps || - "ref" in finishedWork.memoizedProps || - didWarnAboutReassigningProps || - (finishedRoot.props !== finishedWork.memoizedProps && - error$jscomp$0( - "Expected %s props to match memoized props before componentDidMount. 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" + finishedWork.type.defaultProps || + "ref" in finishedWork.memoizedProps || + didWarnAboutReassigningProps || + (finishedRoot.props !== finishedWork.memoizedProps && + error$jscomp$0( + "Expected %s props to match memoized props before componentDidMount. 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" + ), + finishedRoot.state !== finishedWork.memoizedState && + error$jscomp$0( + "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) + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot ), - finishedRoot.state !== finishedWork.memoizedState && - error$jscomp$0( - "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)) - ) { - try { - startLayoutEffectTimer(), finishedRoot.componentDidMount(); - } catch (error$15) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$15 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidMount(); - } catch (error$16) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$16 - ); - } + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ); else { - committedLanes = resolveClassComponentProps( + var prevProps = resolveClassComponentProps( finishedWork.type, current.memoizedProps, finishedWork.elementType === finishedWork.type ); - var prevState = current.memoizedState; + current = current.memoizedState; finishedWork.type.defaultProps || "ref" in finishedWork.memoizedProps || didWarnAboutReassigningProps || @@ -12886,122 +13212,121 @@ __DEV__ && "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" )); - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - finishedRoot.componentDidUpdate( - committedLanes, - prevState, - finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$17) { - captureCommitPhaseError( + shouldProfile(finishedWork) + ? (startEffectTimer(), + runWithFiberInDEV( finishedWork, - finishedWork.return, - error$17 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - finishedRoot.componentDidUpdate( - committedLanes, - prevState, + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate - ); - } catch (error$18) { - captureCommitPhaseError( + ), + recordEffectDuration()) + : runWithFiberInDEV( finishedWork, - finishedWork.return, - error$18 + callComponentDidUpdateInDEV, + finishedWork, + finishedRoot, + prevProps, + current, + finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } } flags & 64 && commitClassCallbacks(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + current = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if ( flags & 64 && ((flags = finishedWork.updateQueue), null !== flags) ) { - finishedRoot = null; + prevProps = null; if (null !== finishedWork.child) switch (finishedWork.child.tag) { case 27: case 5: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; break; case 1: - finishedRoot = finishedWork.child.stateNode; + prevProps = finishedWork.child.stateNode; } try { - commitCallbacks(flags, finishedRoot); - } catch (error$22) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$22 + error$15 ); } } + finishedRoot.effectDuration += popNestedEffectDurations(current); 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); + if (flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); + finishedRoot = finishedWork.stateNode; + finishedRoot.effectDuration += bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 13: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; case 22: - if (disableLegacyMode || 0 !== (finishedWork.mode & 1)) { + if ( + disableLegacyMode || + (finishedWork.mode & ConcurrentMode) !== NoMode + ) { if ( - ((prevState = + ((prevProps = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden), - !prevState) + !prevProps) ) { current = (null !== current && null !== current.memoizedState) || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = prevState; + offscreenSubtreeIsHidden = prevProps; (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects( @@ -13009,31 +13334,18 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } - } else - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + } else recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 512 && ("manual" === finishedWork.memoizedProps.mode ? safelyAttachRef(finishedWork, finishedWork.return) : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -13242,78 +13554,6 @@ __DEV__ && 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 - ? parent.nodeType === COMMENT_NODE - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (parent.nodeType === COMMENT_NODE - ? ((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, @@ -13373,8 +13613,12 @@ __DEV__ && 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; @@ -13393,29 +13637,63 @@ __DEV__ && ); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? 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$29) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$29 + ); + } + else + try { + runWithFiberInDEV( + deletedFiber, + removeChild, + hostParent, + deletedFiber.stateNode + ); + } catch (error$30) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$30 + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParent = finishedRoot.onDeleted) && + prevHostParent(deletedFiber.stateNode); + } catch (error$34) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error$34 + ); + } null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - finishedRoot.nodeType === COMMENT_NODE - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + nearestMountedAncestor.nodeType === COMMENT_NODE + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -13435,49 +13713,19 @@ __DEV__ && case 11: case 14: case 15: - if ( - !offscreenSubtreeWasHidden && - ((prevHostParent = deletedFiber.updateQueue), - null !== prevHostParent && - ((prevHostParent = prevHostParent.lastEffect), - null !== prevHostParent)) - ) { - prevHostParentIsContainer = prevHostParent = prevHostParent.next; - do { - var tag = prevHostParentIsContainer.tag, - inst = prevHostParentIsContainer.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((tag & Insertion) !== NoFlags - ? ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - safelyCallDestroy( - deletedFiber, - nearestMountedAncestor, - destroy - )), - enableSchedulingProfiler && - markComponentLayoutEffectUnmountStopped())); - prevHostParentIsContainer = prevHostParentIsContainer.next; - } while (prevHostParentIsContainer !== prevHostParent); - } + (!enableHiddenSubtreeInsertionEffectCleanup && + offscreenSubtreeWasHidden) || + commitHookEffectListUnmount( + Insertion, + deletedFiber, + nearestMountedAncestor + ); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects( + deletedFiber, + nearestMountedAncestor, + Layout + ); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -13510,7 +13758,7 @@ __DEV__ && break; case 22: safelyDetachRef(deletedFiber, nearestMountedAncestor); - disableLegacyMode || deletedFiber.mode & 1 + disableLegacyMode || deletedFiber.mode & ConcurrentMode ? ((offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState), @@ -13542,21 +13790,34 @@ __DEV__ && ((current = current.memoizedState), null !== current && ((current = current.dehydrated), null !== current)) - ) + ) { + try { + runWithFiberInDEV( + finishedWork, + commitHydratedSuspenseInstance, + current + ); + } catch (error$32) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$32 + ); + } try { - retryIfBlockedOn(current); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; onHydrated && onHydrated(current); } - } catch (error$25) { + } catch (error$35) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$25 + error$35 ); } + } } } function getRetryCache(finishedWork) { @@ -13590,10 +13851,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 === (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility |= 2), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachOffscreenInstance(instance) { @@ -13603,10 +13864,10 @@ __DEV__ && "Calling Offscreen.detach before instance handle has been set." ); if (0 !== (instance._pendingVisibility & 2)) { - var root = enqueueConcurrentRenderForLane(fiber, SyncLane); + var root = enqueueConcurrentRenderForLane(fiber, 2); null !== root && ((instance._pendingVisibility &= -3), - scheduleUpdateOnFiber(root, fiber, SyncLane)); + scheduleUpdateOnFiber(root, fiber, 2)); } } function attachSuspenseRetryListeners(finishedWork, wakeables) { @@ -13629,74 +13890,53 @@ __DEV__ && 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$26) { - captureCommitPhaseError(childToDelete, parentFiber, error$26); + parent = parent.return; } - } - if (parentFiber.subtreeFlags & 13878) - for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitMutationEffectsOnFiber, - parentFiber, - root$jscomp$0, - lanes - ), + 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; ) + 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) { @@ -13704,57 +13944,23 @@ __DEV__ && 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$27) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$27 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$29) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$29 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount( + Insertion | HasEffect, + finishedWork, + finishedWork.return + ), + commitHookEffectListMount(Insertion | HasEffect, finishedWork), + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout | HasEffect + )); break; case 1: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13771,7 +13977,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13790,97 +13996,96 @@ __DEV__ && root = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - lanes = root.getElementsByTagName("title")[0]; + hoistableRoot = root.getElementsByTagName("title")[0]; if ( - !lanes || - lanes[internalHoistableMarker] || - lanes[internalInstanceKey] || - lanes.namespaceURI === SVG_NAMESPACE || - lanes.hasAttribute("itemprop") + !hoistableRoot || + hoistableRoot[internalHoistableMarker] || + hoistableRoot[internalInstanceKey] || + hoistableRoot.namespaceURI === SVG_NAMESPACE || + hoistableRoot.hasAttribute("itemprop") ) - (lanes = root.createElement(flags)), + (hoistableRoot = root.createElement(flags)), root.head.insertBefore( - lanes, + hoistableRoot, root.querySelector("head > title") ); - setInitialProperties(lanes, flags, current); - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + setInitialProperties(hoistableRoot, flags, current); + hoistableRoot[internalInstanceKey] = finishedWork; + markNodeAsHoistable(hoistableRoot); + flags = hoistableRoot; break a; case "link": - if ( - (hoistableRoot = getHydratableHoistableCache( - "link", - "href", - root - ).get(flags + (current.href || ""))) - ) - for (var i = 0; i < hoistableRoot.length; i++) + var maybeNodes = getHydratableHoistableCache( + "link", + "href", + root + ).get(flags + (current.href || "")); + if (maybeNodes) + for (var i = 0; i < maybeNodes.length; i++) if ( - ((lanes = hoistableRoot[i]), - lanes.getAttribute("href") === + ((hoistableRoot = maybeNodes[i]), + hoistableRoot.getAttribute("href") === (null == current.href ? null : current.href) && - lanes.getAttribute("rel") === + hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && - lanes.getAttribute("title") === + hoistableRoot.getAttribute("title") === (null == current.title ? null : current.title) && - lanes.getAttribute("crossorigin") === + hoistableRoot.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) ) { - hoistableRoot.splice(i, 1); + maybeNodes.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + hoistableRoot = root.createElement(flags); + setInitialProperties(hoistableRoot, flags, current); + root.head.appendChild(hoistableRoot); break; case "meta": if ( - (hoistableRoot = getHydratableHoistableCache( + (maybeNodes = getHydratableHoistableCache( "meta", "content", root ).get(flags + (current.content || ""))) ) - for (i = 0; i < hoistableRoot.length; i++) + for (i = 0; i < maybeNodes.length; i++) if ( - ((lanes = hoistableRoot[i]), + ((hoistableRoot = maybeNodes[i]), checkAttributeStringCoercion( current.content, "content" ), - lanes.getAttribute("content") === + hoistableRoot.getAttribute("content") === (null == current.content ? null : "" + current.content) && - lanes.getAttribute("name") === + hoistableRoot.getAttribute("name") === (null == current.name ? null : current.name) && - lanes.getAttribute("property") === + hoistableRoot.getAttribute("property") === (null == current.property ? null : current.property) && - lanes.getAttribute("http-equiv") === + hoistableRoot.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - lanes.getAttribute("charset") === + hoistableRoot.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) ) { - hoistableRoot.splice(i, 1); + maybeNodes.splice(i, 1); break b; } - lanes = root.createElement(flags); - setInitialProperties(lanes, flags, current); - root.head.appendChild(lanes); + hoistableRoot = root.createElement(flags); + setInitialProperties(hoistableRoot, flags, current); + root.head.appendChild(hoistableRoot); break; default: throw Error( @@ -13889,9 +14094,9 @@ __DEV__ && '". This is a bug in React.' ); } - lanes[internalInstanceKey] = finishedWork; - markNodeAsHoistable(lanes); - flags = lanes; + hoistableRoot[internalInstanceKey] = finishedWork; + markNodeAsHoistable(hoistableRoot); + flags = hoistableRoot; } finishedWork.stateNode = flags; } else @@ -13906,86 +14111,68 @@ __DEV__ && 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$30) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$30 - ); - } + else + 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 + )) + : 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()), - error$jscomp$0( - "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: - error$jscomp$0( - "acquireSingletonInstance was called with an element type that is not supported. This is a bug in React." - ); + maybeNodes = 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, + maybeNodes, + hoistableRoot, + finishedWork + ); + } catch (error$33) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$33 + ); } - 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 && @@ -13993,30 +14180,23 @@ __DEV__ && if (finishedWork.flags & 32) { root = finishedWork.stateNode; try { - setTextContent(root, ""); - } catch (error$31) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$31 - ); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - lanes = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : lanes; - hoistableRoot = finishedWork.type; - try { - updateProperties(root, hoistableRoot, current, lanes), - (root[internalPropsKey] = lanes); - } catch (error$32) { + runWithFiberInDEV(finishedWork, resetTextContent, root); + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + error$25 ); } } + flags & 4 && + null != finishedWork.stateNode && + ((root = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + root, + null !== current ? current.memoizedProps : root + )); flags & 1024 && ((needsFormReset = !0), "form" !== finishedWork.type && @@ -14025,32 +14205,40 @@ __DEV__ && )); 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; + root = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$33) { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + root, + current, + flags + ); + } catch (error$24) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$33 + error$24 ); } } break; case 3: + hoistableRoot = pushNestedEffectDurations(); tagCaches = null; - hoistableRoot = currentHoistableRoot; + maybeNodes = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - currentHoistableRoot = hoistableRoot; + recursivelyTraverseMutationEffects(root, finishedWork); + currentHoistableRoot = maybeNodes; commitReconciliationEffects(finishedWork); if ( flags & 4 && @@ -14058,28 +14246,40 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$34) { + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); + } catch (error$31) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$34 + error$31 ); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); + root.effectDuration += popNestedEffectDurations(hoistableRoot); break; case 4: flags = currentHoistableRoot; currentHoistableRoot = getHoistableRoot( finishedWork.stateNode.containerInfo ); - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; + case 12: + flags = pushNestedEffectDurations(); + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + finishedWork.stateNode.effectDuration += + bubbleNestedEffectDurations(flags); + break; case 13: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && ((root = null !== finishedWork.memoizedState), @@ -14099,11 +14299,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$35) { + } catch (error$36) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$35 + error$36 ); } flags = finishedWork.updateQueue; @@ -14116,17 +14316,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - disableLegacyMode || finishedWork.mode & 1 - ? ((suspenseCallback = offscreenSubtreeIsHidden), - (retryQueue = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = suspenseCallback || domElement), - (offscreenSubtreeWasHidden = retryQueue || newProps), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - (offscreenSubtreeWasHidden = retryQueue), - (offscreenSubtreeIsHidden = suspenseCallback)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + disableLegacyMode || finishedWork.mode & ConcurrentMode + ? ((nodeName = offscreenSubtreeIsHidden), + (suspenseCallback = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = nodeName || i), + (offscreenSubtreeWasHidden = suspenseCallback || nextNode), + recursivelyTraverseMutationEffects(root, finishedWork), + (offscreenSubtreeWasHidden = suspenseCallback), + (offscreenSubtreeIsHidden = nodeName)) + : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -14134,15 +14334,16 @@ __DEV__ && root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = i ? root._visibility & -2 : root._visibility | 1), - domElement && + i && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || - ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && + ((disableLegacyMode || + (finishedWork.mode & ConcurrentMode) !== NoMode) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), null === finishedWork.memoizedProps || "manual" !== finishedWork.memoizedProps.mode) @@ -14150,47 +14351,54 @@ __DEV__ && 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())); - } catch (error$23) { + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$23 + nextNode, + nextNode.return, + error$26 ); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement - ? "" - : root.memoizedProps; - } catch (error$24) { + (maybeNodes = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + maybeNodes + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + maybeNodes, + nextNode.memoizedProps + ); + } catch (error$27) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$24 + nextNode, + nextNode.return, + error$27 ); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -14221,7 +14429,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -14230,7 +14438,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -14240,7 +14448,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -14248,54 +14456,9 @@ __DEV__ && 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." - ); - } - } - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -14313,27 +14476,13 @@ __DEV__ && 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) { @@ -14342,23 +14491,11 @@ __DEV__ && case 11: case 14: case 15: - if (shouldProfile(finishedWork)) - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); - } finally { - recordLayoutEffectDuration(finishedWork); - } - else - commitHookEffectListUnmount( - Layout, - finishedWork, - finishedWork.return - ); + commitHookLayoutUnmountEffects( + finishedWork, + finishedWork.return, + Layout + ); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 1: @@ -14416,28 +14553,25 @@ __DEV__ && finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; - if ("function" === typeof finishedRoot.componentDidMount) + commitClassDidMount(finishedWork); + current = finishedWork.updateQueue; + if (null !== current) { + finishedRoot = finishedWork.stateNode; try { - finishedRoot.componentDidMount(); - } catch (error$37) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$37 + error$14 ); } - 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); @@ -14454,18 +14588,42 @@ __DEV__ && includeWorkInProgressEffects && null === current && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current); + if (includeWorkInProgressEffects && flags & 4) { + flags = pushNestedEffectDurations(); + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); + includeWorkInProgressEffects = finishedWork.stateNode; + includeWorkInProgressEffects.effectDuration += + bubbleNestedEffectDurations(flags); + try { + runWithFiberInDEV( + finishedWork, + commitProfiler, + finishedWork, + current, + commitStartTime, + includeWorkInProgressEffects.effectDuration + ); + } catch (error$20) { + captureCommitPhaseError( + finishedWork, + finishedWork.return, + error$20 + ); + } + } else + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -14502,9 +14660,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14512,22 +14668,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$38) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$38); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$39) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$39); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -14602,21 +14742,6 @@ __DEV__ && (instance.aborts = null), (instance.name = null)); } - function commitPassiveMountEffects( - root, - finishedWork, - committedLanes, - committedTransitions - ) { - runWithFiberInDEV( - finishedWork, - commitPassiveMountOnFiber, - root, - finishedWork, - committedLanes, - committedTransitions - ); - } function recursivelyTraversePassiveMountEffects( root, parentFiber, @@ -14625,9 +14750,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14656,6 +14779,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -14723,6 +14847,33 @@ __DEV__ && clearTransitionsForLanes(finishedRoot, committedLanes); } } + finishedRoot.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + flags & 2048 + ? ((prevEffectDuration = pushNestedEffectDurations()), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration)), + commitProfilerPostCommit( + finishedWork, + finishedWork.alternate, + commitStartTime, + finishedRoot.passiveEffectDuration + )) + : recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); break; case 23: recursivelyTraversePassiveMountEffects( @@ -14739,49 +14890,47 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraversePassiveMountEffects( + : disableLegacyMode || finishedWork.mode & ConcurrentMode + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((prevEffectDuration._visibility |= 4), + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + )) + : prevEffectDuration._visibility & 4 + ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions - )) - : nextCache._visibility & 4 - ? recursivelyTraversePassiveMountEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((nextCache._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) - )); + ) + : ((prevEffectDuration._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + 0 !== (finishedWork.subtreeFlags & 10256) + )); flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -14825,9 +14974,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -14874,9 +15021,9 @@ __DEV__ && ); break; case 22: - var _instance4 = finishedWork.stateNode; + var _instance2 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? _instance4._visibility & 4 + ? _instance2._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14884,22 +15031,20 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects ) - : disableLegacyMode || finishedWork.mode & 1 - ? recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ) - : ((_instance4._visibility |= 4), - recursivelyTraverseReconnectPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions, - includeWorkInProgressEffects - )) - : ((_instance4._visibility |= 4), + : disableLegacyMode || finishedWork.mode & ConcurrentMode + ? recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork + ) + : ((_instance2._visibility |= 4), + recursivelyTraverseReconnectPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + includeWorkInProgressEffects + )) + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14912,7 +15057,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -14952,70 +15097,46 @@ __DEV__ && } } 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, - finishedWork.stateNode - ); - break; - case 24: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); - break; - default: - recursivelyTraverseAtomicPassiveEffects( - finishedRoot, - finishedWork, - committedLanes, - committedTransitions - ); - } - } - function commitPassiveUnmountEffects(finishedWork) { - runWithFiberInDEV( - finishedWork, - commitPassiveUnmountOnFiber, - finishedWork - ); + 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, + finishedWork.stateNode + ); + 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) @@ -15076,25 +15197,6 @@ __DEV__ && 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)) { @@ -15111,11 +15213,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -15131,12 +15229,24 @@ __DEV__ && Passive | HasEffect ); break; + case 3: + var prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + popNestedEffectDurations(prevEffectDuration); + break; + case 12: + prevEffectDuration = pushNestedEffectDurations(); + recursivelyTraversePassiveUnmountEffects(finishedWork); + finishedWork.stateNode.passiveEffectDuration += + bubbleNestedEffectDurations(prevEffectDuration); + break; case 22: - var instance = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState && - instance._visibility & 4 && + prevEffectDuration._visibility & 4 && (null === finishedWork.return || 13 !== finishedWork.return.tag) - ? ((instance._visibility &= -5), + ? ((prevEffectDuration._visibility &= -5), recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork); break; @@ -15159,7 +15269,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -15186,116 +15296,107 @@ __DEV__ && } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { 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, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + 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 13: + if (enableTransitionTracing) { + var offscreenFiber = current.child, + instance = offscreenFiber.stateNode, + transitions = instance._transitions; + if (null !== transitions) { + var abortReason = { + reason: "suspense", + name: current.memoizedProps.unstable_name || null + }; + if ( + null === current.memoizedState || + null === current.memoizedState.dehydrated + ) + abortParentMarkerTransitionsForDeletedFiber( + offscreenFiber, + abortReason, + transitions, + instance, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + abortReason, + transitions, + instance, + !1 + ); + } + } + break; + case 24: + releaseCache(current.memoizedState.cache); + break; + case 25: + enableTransitionTracing && + ((offscreenFiber = current.stateNode.transitions), + null !== offscreenFiber && + ((instance = { + reason: "marker", + name: current.memoizedProps.name + }), + abortParentMarkerTransitionsForDeletedFiber( + current, + instance, + offscreenFiber, + null, + !0 + ), + null !== nearestMountedAncestor && + abortParentMarkerTransitionsForDeletedFiber( + nearestMountedAncestor, + instance, + offscreenFiber, + null, + !1 + ))); + } + 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; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; break a; } - nextEffect = returnFiber; - } - } - } - 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 13: - if (enableTransitionTracing) { - var offscreenFiber = current.child, - instance = offscreenFiber.stateNode, - transitions = instance._transitions; - if (null !== transitions) { - var abortReason = { - reason: "suspense", - name: current.memoizedProps.unstable_name || null - }; - if ( - null === current.memoizedState || - null === current.memoizedState.dehydrated - ) - abortParentMarkerTransitionsForDeletedFiber( - offscreenFiber, - abortReason, - transitions, - instance, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); - } + nextEffect = offscreenFiber; } - break; - case 24: - releaseCache(current.memoizedState.cache); - break; - case 25: - enableTransitionTracing && - ((offscreenFiber = current.stateNode.transitions), - null !== offscreenFiber && - ((instance = { - reason: "marker", - name: current.memoizedProps.name - }), - abortParentMarkerTransitionsForDeletedFiber( - current, - instance, - offscreenFiber, - null, - !0 - ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - instance, - offscreenFiber, - null, - !1 - ))); } } function invokeLayoutEffectMountInDEV(fiber) { @@ -15303,20 +15404,10 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$40) { - captureCommitPhaseError(fiber, fiber.return, error$40); - } + commitHookEffectListMount(Layout | HasEffect, fiber); break; case 1: - var instance = fiber.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error$41) { - captureCommitPhaseError(fiber, fiber.return, error$41); - } + commitClassDidMount(fiber); } } function invokePassiveEffectMountInDEV(fiber) { @@ -15324,11 +15415,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$42) { - captureCommitPhaseError(fiber, fiber.return, error$42); - } + commitHookEffectListMount(Passive | HasEffect, fiber); } } function invokeLayoutEffectUnmountInDEV(fiber) { @@ -15336,15 +15423,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Layout | HasEffect, - fiber, - fiber.return - ); - } catch (error$43) { - captureCommitPhaseError(fiber, fiber.return, error$43); - } + commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); break; case 1: var instance = fiber.stateNode; @@ -15357,15 +15436,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Passive | HasEffect, - fiber, - fiber.return - ); - } catch (error$44) { - captureCommitPhaseError(fiber, fiber.return, error$44); - } + commitHookEffectListUnmount(Passive | HasEffect, fiber, fiber.return); } } function onCommitRoot() { @@ -15468,7 +15539,7 @@ __DEV__ && } function requestUpdateLane(fiber) { var mode = fiber.mode; - if (!disableLegacyMode && 0 === (mode & 1)) return SyncLane; + if (!disableLegacyMode && (mode & ConcurrentMode) === NoMode) return 2; if ( (executionContext & RenderContext) !== NoContext && 0 !== workInProgressRootRenderLanes @@ -15485,9 +15556,9 @@ __DEV__ && function requestDeferredLane() { 0 === workInProgressDeferredLane && (workInProgressDeferredLane = - 0 === (workInProgressRootRenderLanes & OffscreenLane) || isHydrating + 0 === (workInProgressRootRenderLanes & 536870912) || isHydrating ? claimNextTransitionLane() - : OffscreenLane); + : 536870912); var suspenseHandler = suspenseHandlerStackCursor.current; null !== suspenseHandler && (suspenseHandler.flags |= 32); return workInProgressDeferredLane; @@ -15505,7 +15576,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); markRootUpdated(root, lane); if ( @@ -15563,90 +15635,123 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings )); ensureRootIsScheduled(root); - lane !== SyncLane || + 2 !== lane || executionContext !== NoContext || disableLegacyMode || - 0 !== (fiber.mode & 1) || + (fiber.mode & ConcurrentMode) !== NoMode || ReactSharedInternals.isBatchingLegacy || ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var shouldTimeSlice = - !includesBlockingLane(root, lanes) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice + var exitStatus = (forceSync = + !forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { - var renderWasConcurrent = shouldTimeSlice; + if (exitStatus !== RootInProgress) { + var renderWasConcurrent = forceSync; do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); + if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings + ); else { - shouldTimeSlice = root.current.alternate; + forceSync = root.current.alternate; if ( renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) + !isRenderConsistentWithExternalStores(forceSync) ) { - didTimeout = renderRootSync(root, lanes); + exitStatus = renderRootSync(root, lanes); renderWasConcurrent = !1; continue; } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( + if ( + (disableLegacyMode || 0 !== root.tag) && + exitStatus === RootErrored + ) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; + break a; + } + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; + } + renderWasConcurrent = !1; + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended( root, - renderWasConcurrent + lanes, + 0, + workInProgressRootDidSkipSuspendedSiblings ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); break; } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; a: { renderWasConcurrent = root; - switch (didTimeout) { + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); case RootSuspendedWithDelay: - if ((lanes & TransitionLanes) === lanes) { + if ((lanes & 4194176) === lanes) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); break a; } @@ -15660,53 +15765,73 @@ __DEV__ && default: throw Error("Unknown root exit status."); } + renderWasConcurrent.finishedWork = forceSync; + renderWasConcurrent.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( renderWasConcurrent, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + 0 ); else { if ( - (lanes & RetryLanes) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < didTimeout) + 10 < exitStatus) ) { markRootSuspended( renderWasConcurrent, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; renderWasConcurrent.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + 0 ), - didTimeout + exitStatus ); break a; } commitRootWhenReady( renderWasConcurrent, - shouldTimeSlice, + forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + 0 ); } } @@ -15715,36 +15840,6 @@ __DEV__ && } while (1); } ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -15761,7 +15856,13 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -15777,10 +15878,16 @@ __DEV__ && root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); return; } commitRoot( @@ -15788,31 +15895,36 @@ __DEV__ && recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { - if (node.flags & 16384) { - var updateQueue = node.updateQueue; - if ( - null !== updateQueue && - ((updateQueue = updateQueue.stores), null !== updateQueue) - ) - for (var i = 0; i < updateQueue.length; i++) { - var check = updateQueue[i], - getSnapshot = check.getSnapshot; - check = check.value; - try { - if (!objectIs(getSnapshot(), check)) return !1; - } catch (error$45) { - return !1; - } + var tag = node.tag; + if ( + (0 === tag || 11 === tag || 15 === tag) && + node.flags & 16384 && + ((tag = node.updateQueue), + null !== tag && ((tag = tag.stores), null !== tag)) + ) + for (var i = 0; i < tag.length; i++) { + var check = tag[i], + getSnapshot = check.getSnapshot; + check = check.value; + try { + if (!objectIs(getSnapshot(), check)) return !1; + } catch (error$37) { + return !1; } - } - updateQueue = node.child; - if (node.subtreeFlags & 16384 && null !== updateQueue) - (updateQueue.return = node), (node = updateQueue); + } + tag = node.child; + if (node.subtreeFlags & 16384 && null !== tag) + (tag.return = node), (node = tag); else { if (node === finishedWork) break; for (; null === node.sibling; ) { @@ -15827,8 +15939,10 @@ __DEV__ && } function markRootUpdated(root, updatedLanes) { root.pendingLanes |= updatedLanes; - updatedLanes !== IdleLane && - ((root.suspendedLanes = 0), (root.pingedLanes = 0)); + 268435456 !== updatedLanes && + ((root.suspendedLanes = 0), + (root.pingedLanes = 0), + (root.warmLanes = 0)); enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -15836,70 +15950,29 @@ __DEV__ && (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; - - ) { + enableSiblingPrerendering && + !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 && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if ((disableLegacyMode || 0 !== root.tag) && exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended(root, lanes, workInProgressDeferredLane), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - ensureRootIsScheduled(root); - return null; - } function batchedUpdates$1(fn, a) { if (disableLegacyMode) return fn(a); var prevExecutionContext = executionContext; @@ -15911,12 +15984,12 @@ __DEV__ && executionContext !== NoContext || ReactSharedInternals.isBatchingLegacy || ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -15951,9 +16024,16 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -15961,9 +16041,7 @@ __DEV__ && workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null; workInProgressRootDidIncludeRecursiveRenderUpdate = !1; - 0 === (root.current.mode & 32) && - 0 !== (lanes & InputContinuousLane) && - (lanes |= lanes & DefaultLane); + 0 !== (lanes & 8) && (lanes |= lanes & 32); var allEntangledLanes = root.entangledLanes; if (0 !== allEntangledLanes) for ( @@ -15988,22 +16066,23 @@ __DEV__ && thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) ? SuspendedOnData : SuspendedOnImmediate)) : thrownValue === SuspenseyCommitException - ? ((thrownValue = getSuspendedThenable()), - (workInProgressSuspendedReason = SuspendedOnInstance)) - : (workInProgressSuspendedReason = - thrownValue === SelectiveHydrationException - ? SuspendedOnHydration - : null !== thrownValue && - "object" === typeof thrownValue && - "function" === typeof thrownValue.then - ? SuspendedOnDeprecatedThrowPromise - : SuspendedOnError); + ? ((thrownValue = getSuspendedThenable()), + (workInProgressSuspendedReason = SuspendedOnInstance)) + : (workInProgressSuspendedReason = + thrownValue === SelectiveHydrationException + ? SuspendedOnHydration + : null !== thrownValue && + "object" === typeof thrownValue && + "function" === typeof thrownValue.then + ? SuspendedOnDeprecatedThrowPromise + : SuspendedOnError); workInProgressThrownValue = thrownValue; var erroredWork = workInProgress; if (null === erroredWork) @@ -16013,8 +16092,8 @@ __DEV__ && createCapturedValueAtFiber(thrownValue, root.current) ); else if ( - (erroredWork.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), + (erroredWork.mode & ProfileMode && + stopProfilerTimerIfRunningAndRecordDuration(erroredWork), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -16048,16 +16127,16 @@ __DEV__ && var handler = suspenseHandlerStackCursor.current; return null === handler ? !0 - : (workInProgressRootRenderLanes & TransitionLanes) === - workInProgressRootRenderLanes - ? null === shellBoundary - ? !0 - : !1 - : (workInProgressRootRenderLanes & RetryLanes) === - workInProgressRootRenderLanes || - 0 !== (workInProgressRootRenderLanes & OffscreenLane) - ? handler === shellBoundary - : !1; + : (workInProgressRootRenderLanes & 4194176) === + workInProgressRootRenderLanes + ? null === shellBoundary + ? !0 + : !1 + : (workInProgressRootRenderLanes & 62914560) === + workInProgressRootRenderLanes || + 0 !== (workInProgressRootRenderLanes & 536870912) + ? handler === shellBoundary + : !1; } function pushDispatcher() { var prevDispatcher = ReactSharedInternals.H; @@ -16071,13 +16150,17 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + 0 !== (workInProgressRootRenderLanes & 60) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + workInProgressRootDidSkipSuspendedSiblings ); } function renderRootSync(root, lanes) { @@ -16121,15 +16204,21 @@ __DEV__ && null !== suspenseHandlerStackCursor.current || (lanes = !0); default: - (workInProgressSuspendedReason = NotSuspended), - (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop( + root, + memoizedUpdaters, + thrownValue, + reason + ); } } workLoopSync(); break; - } catch (thrownValue$46) { - handleThrow(root, thrownValue$46); + } catch (thrownValue$38) { + handleThrow(root, thrownValue$38); } while (1); lanes && root.shellSuspendCounter++; @@ -16170,7 +16259,13 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering && + (workInProgressRootIsPrerendering = + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + lanes)); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -16187,7 +16282,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -16219,7 +16319,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -16251,12 +16356,22 @@ __DEV__ && } workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnInstanceAndReadyToContinue + ); break; case SuspendedOnDeprecatedThrowPromise: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnDeprecatedThrowPromise + ); break; case SuspendedOnHydration: resetWorkInProgressStack(); @@ -16271,8 +16386,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$47) { - handleThrow(root, thrownValue$47); + } catch (thrownValue$39) { + handleThrow(root, thrownValue$39); } while (1); resetContextDependencies(); @@ -16301,7 +16416,7 @@ __DEV__ && } function performUnitOfWork(unitOfWork) { var current = unitOfWork.alternate; - 0 !== (unitOfWork.mode & 2) + (unitOfWork.mode & ProfileMode) !== NoMode ? (startProfilerTimer(unitOfWork), (current = runWithFiberInDEV( unitOfWork, @@ -16310,7 +16425,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -16318,7 +16433,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -16326,13 +16441,13 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } function replayBeginWork(unitOfWork) { var current = unitOfWork.alternate, - isProfilingMode = 0 !== (unitOfWork.mode & 2); + isProfilingMode = (unitOfWork.mode & ProfileMode) !== NoMode; isProfilingMode && startProfilerTimer(unitOfWork); switch (unitOfWork.tag) { case 15: @@ -16389,10 +16504,15 @@ __DEV__ && (current = beginWork(current, unitOfWork, entangledRenderLanes)); } isProfilingMode && - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0); + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork); return current; } - function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { + function throwAndUnwindWorkLoop( + root, + unitOfWork, + thrownValue, + suspendedReason + ) { resetContextDependencies(); resetHooksOnUnwind(unitOfWork); thenableState$1 = null; @@ -16416,9 +16536,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$48) { + } catch (error$40) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$48); + throw ((workInProgress = returnFiber), error$40); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -16427,62 +16547,52 @@ __DEV__ && 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 = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (isHydrating || suspendedReason === SuspendedOnError) root = !0; + else if ( + workInProgressRootIsPrerendering || + 0 !== (workInProgressRootRenderLanes & 536870912) + ) + root = !1; + else { + if ( + ((workInProgressRootDidSkipSuspendedSiblings = root = !0), + suspendedReason === SuspendedOnData || + suspendedReason === SuspendedOnImmediate || + suspendedReason === SuspendedOnDeprecatedThrowPromise) + ) + (suspendedReason = suspenseHandlerStackCursor.current), + null !== suspendedReason && + 13 === suspendedReason.tag && + (suspendedReason.flags |= 16384); + } + else root = !0; + unwindUnitOfWork(unitOfWork, root); + } else completeUnitOfWork(unitOfWork); } function completeUnitOfWork(unitOfWork) { var completedWork = unitOfWork; do { - 0 !== (completedWork.flags & 32768) && - error$jscomp$0( - "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; - 0 === (completedWork.mode & 2) - ? (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )) - : (startProfilerTimer(completedWork), - (current = runWithFiberInDEV( - completedWork, - completeWork, - current, - completedWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); + startProfilerTimer(completedWork); + current = runWithFiberInDEV( + completedWork, + completeWork, + current, + completedWork, + entangledRenderLanes + ); + (completedWork.mode & ProfileMode) !== NoMode && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); if (null !== current) { workInProgress = current; return; @@ -16497,12 +16607,49 @@ __DEV__ && 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) { + stopProfilerTimerIfRunningAndRecordIncompleteDuration(unitOfWork); + 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, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = Internals.p; @@ -16515,13 +16662,17 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -16529,7 +16680,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -16542,7 +16695,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c commit%c (" + formatLanes(lanes) + ")", + "%c\u269b%c commit%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -16573,7 +16726,14 @@ __DEV__ && root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished(root, remainingLanes, spawnedLane); + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -16585,58 +16745,58 @@ __DEV__ && (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - spawnedLane = Internals.p; - Internals.p = DiscreteEventPriority; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( - root, - finishedWork - ); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableDebugTracing && + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = Internals.p), + (Internals.p = DiscreteEventPriority), + (updatedLanes = executionContext), + (executionContext |= CommitContext), + (suspendedRetryLanes = commitBeforeMutationEffects( + root, + finishedWork + )), + commitMutationEffects(root, finishedWork, lanes), + suspendedRetryLanes && + ((_enabled = !0), + dispatchAfterDetachedBlur(selectionInformation.focusedElem), + (_enabled = !1)), + restoreSelection(selectionInformation, root.containerInfo), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), enableDebugTracing && - group( - "%c\u269b\ufe0f%c layout effects%c (" + formatLanes(lanes) + ")", - "background-color: #20232a; color: #61dafb; padding: 0 2px;", - "", - "font-weight: normal;" - ); - enableSchedulingProfiler && + enableDebugTracing && + group( + "%c\u269b%c layout effects%c (" + formatLanes(lanes) + ")", + "background-color: #20232a; color: #61dafb; padding: 0 2px;", + "", + "font-weight: normal;" + ), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableDebugTracing && enableDebugTracing && groupEnd(); - enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableDebugTracing && enableDebugTracing && groupEnd(), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); - requestPaint(); - executionContext = prevExecutionContext; - Internals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else (root.current = finishedWork), (commitTime = now()); + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(), + requestPaint(), + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -16665,19 +16825,19 @@ __DEV__ && remainingLanes.value, transitions ); - 0 === (pendingPassiveEffectsLanes & (SyncLane | SyncHydrationLane)) || + 0 === (pendingPassiveEffectsLanes & 3) || (!disableLegacyMode && 0 === root.tag) || flushPassiveEffects(); remainingLanes = root.pendingLanes; (enableInfiniteRenderLoopDetection && (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & UpdateLanes) && 0 !== (remainingLanes & SyncUpdateLanes)) + (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { @@ -16717,7 +16877,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -16733,7 +16893,7 @@ __DEV__ && return ( (Internals.p = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), @@ -16743,15 +16903,6 @@ __DEV__ && } return !1; } - function enqueuePendingPassiveProfilerEffect(fiber) { - pendingPassiveProfilerEffects.push(fiber); - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(); - return null; - })); - } function flushPassiveEffectsImpl() { if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; @@ -16767,7 +16918,7 @@ __DEV__ && enableDebugTracing && enableDebugTracing && group( - "%c\u269b\ufe0f%c passive effects%c (" + formatLanes(lanes) + ")", + "%c\u269b%c passive effects%c (" + formatLanes(lanes) + ")", "background-color: #20232a; color: #61dafb; padding: 0 2px;", "", "font-weight: normal;" @@ -16780,12 +16931,8 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStarted(lanes); var prevExecutionContext = executionContext; executionContext |= CommitContext; - commitPassiveUnmountEffects(root.current); - commitPassiveMountEffects(root, root.current, lanes, transitions); - transitions = pendingPassiveProfilerEffects; - pendingPassiveProfilerEffects = []; - for (lanes = 0; lanes < transitions.length; lanes++) - commitPassiveEffectDurations(root, transitions[lanes]); + commitPassiveUnmountOnFiber(root.current); + commitPassiveMountOnFiber(root, root.current, lanes, transitions); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && enableSchedulingProfiler && @@ -16795,7 +16942,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -16833,22 +16980,17 @@ __DEV__ && err )); } - root = root.current.stateNode; - root.effectDuration = 0; - root.passiveEffectDuration = 0; + transitions = root.current.stateNode; + transitions.effectDuration = 0; + transitions.passiveEffectDuration = 0; return !0; } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); - sourceFiber = createRootErrorUpdate( - rootFiber.stateNode, - sourceFiber, - SyncLane - ); - rootFiber = enqueueUpdate(rootFiber, sourceFiber, SyncLane); + sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2); + rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2); null !== rootFiber && - (markRootUpdated(rootFiber, SyncLane), - ensureRootIsScheduled(rootFiber)); + (markRootUpdated(rootFiber, 2), ensureRootIsScheduled(rootFiber)); } function captureCommitPhaseError( sourceFiber, @@ -16878,12 +17020,8 @@ __DEV__ && !legacyErrorBoundariesThatAlreadyFailed.has(instance))) ) { sourceFiber = createCapturedValueAtFiber(error$1, sourceFiber); - error$1 = createClassErrorUpdate(SyncLane); - instance = enqueueUpdate( - nearestMountedAncestor, - error$1, - SyncLane - ); + error$1 = createClassErrorUpdate(2); + instance = enqueueUpdate(nearestMountedAncestor, error$1, 2); null !== instance && (initializeClassErrorUpdate( error$1, @@ -16891,7 +17029,7 @@ __DEV__ && nearestMountedAncestor, sourceFiber ), - markRootUpdated(instance, SyncLane), + markRootUpdated(instance, 2), ensureRootIsScheduled(instance)); return; } @@ -16925,6 +17063,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -16941,21 +17080,23 @@ __DEV__ && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (workInProgressRootExitStatus === RootSuspendedWithDelay || (workInProgressRootExitStatus === RootSuspended && - (workInProgressRootRenderLanes & RetryLanes) === + (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && now$1() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) ? (executionContext & RenderContext) === NoContext && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { 0 === retryLane && ((retryLane = boundaryFiber.mode), (retryLane = - disableLegacyMode || 0 !== (retryLane & 1) + disableLegacyMode || (retryLane & ConcurrentMode) !== NoMode ? claimNextRetryLane() - : SyncLane)); + : 2)); boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); null !== boundaryFiber && (markRootUpdated(boundaryFiber, retryLane), @@ -17029,7 +17170,7 @@ __DEV__ && doubleInvokeEffectsOnFiber, root, fiber, - 0 === (fiber.mode & 64) + (fiber.mode & NoStrictPassiveEffectsMode) === NoMode ) : recursivelyTraverseAndDoubleInvokeEffectsInDEV( root, @@ -17070,7 +17211,7 @@ __DEV__ && disableLegacyMode || 0 !== root.tag ? ((hasPassiveEffects = !0), (!disableLegacyMode && 1 !== root.tag) || - root.current.mode & 24 || + root.current.mode & (StrictLegacyMode | StrictEffectsMode) || (hasPassiveEffects = !1), recursivelyTraverseAndDoubleInvokeEffectsInDEV( root, @@ -17110,7 +17251,7 @@ __DEV__ && function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { if ( (executionContext & RenderContext) === NoContext && - (disableLegacyMode || fiber.mode & 1) + (disableLegacyMode || fiber.mode & ConcurrentMode) ) { var tag = fiber.tag; if ( @@ -17147,7 +17288,7 @@ __DEV__ && : scheduleCallback$3(priorityLevel, callback); } function warnIfUpdatesNotWrappedWithActDEV(fiber) { - if (disableLegacyMode || fiber.mode & 1) { + if (disableLegacyMode || fiber.mode & ConcurrentMode) { if (!isConcurrentActEnvironment()) return; } else if ( !isLegacyActEnvironment() || @@ -17268,9 +17409,8 @@ __DEV__ && (type = !0); type && (fiber._debugNeedsRemount = !0); if (type || needsRender) - (alternate = enqueueConcurrentRenderForLane(fiber, SyncLane)), - null !== alternate && - scheduleUpdateOnFiber(alternate, fiber, SyncLane); + (alternate = enqueueConcurrentRenderForLane(fiber, 2)), + null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2); null === child || type || scheduleFibersWithFamiliesRecursively( @@ -17285,83 +17425,6 @@ __DEV__ && staleFamilies ); } - function findHostInstancesForMatchingFibersRecursively( - fiber, - types, - hostInstances - ) { - var child = fiber.child, - sibling = fiber.sibling, - type = fiber.type, - candidateType = null; - switch (fiber.tag) { - case 0: - case 15: - case 1: - candidateType = type; - break; - case 11: - candidateType = type.render; - } - type = !1; - null !== candidateType && types.has(candidateType) && (type = !0); - if (type) - a: { - b: for (child = fiber, candidateType = !1; ; ) { - if (5 === child.tag || 26 === child.tag || 27 === child.tag) - (candidateType = !0), hostInstances.add(child.stateNode); - else if (null !== child.child) { - child.child.return = child; - child = child.child; - continue; - } - if (child === fiber) { - child = candidateType; - break b; - } - for (; null === child.sibling; ) { - if (null === child.return || child.return === fiber) { - child = candidateType; - break b; - } - child = child.return; - } - child.sibling.return = child.return; - child = child.sibling; - } - if (!child) - for (;;) { - switch (fiber.tag) { - case 27: - case 5: - hostInstances.add(fiber.stateNode); - break a; - case 4: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - case 3: - hostInstances.add(fiber.stateNode.containerInfo); - break a; - } - if (null === fiber.return) - throw Error("Expected to reach root first."); - fiber = fiber.return; - } - } - else - null !== child && - findHostInstancesForMatchingFibersRecursively( - child, - types, - hostInstances - ); - null !== sibling && - findHostInstancesForMatchingFibersRecursively( - sibling, - types, - hostInstances - ); - } function FiberNode(tag, pendingProps, key, mode) { this.tag = tag; this.key = key; @@ -17385,9 +17448,9 @@ __DEV__ && this.deletions = null; this.childLanes = this.lanes = 0; this.alternate = null; - this.actualDuration = 0; - this.actualStartTime = -1; - this.treeBaseDuration = this.selfBaseDuration = 0; + this.actualDuration = -0; + this.actualStartTime = -1.1; + this.treeBaseDuration = this.selfBaseDuration = -0; this._debugOwner = this._debugInfo = null; this._debugNeedsRemount = !1; this._debugHookTypes = null; @@ -17395,9 +17458,48 @@ __DEV__ && "function" !== typeof Object.preventExtensions || Object.preventExtensions(this); } - function createFiber(tag, pendingProps, key, mode) { + function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); } + function createFiberImplObject(tag, pendingProps, key, mode) { + tag = { + elementType: null, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + refCleanup: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + dependencies: null, + flags: 0, + subtreeFlags: 0, + deletions: null, + lanes: 0, + childLanes: 0, + alternate: null, + tag: tag, + key: key, + pendingProps: pendingProps, + mode: mode, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, + _debugInfo: null, + _debugOwner: null, + _debugNeedsRemount: !1, + _debugHookTypes: null + }; + hasBadMapPolyfill || + "function" !== typeof Object.preventExtensions || + Object.preventExtensions(tag); + return tag; + } function shouldConstruct(Component) { Component = Component.prototype; return !(!Component || !Component.isReactComponent); @@ -17423,8 +17525,8 @@ __DEV__ && (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null), - (workInProgress.actualDuration = 0), - (workInProgress.actualStartTime = -1)); + (workInProgress.actualDuration = -0), + (workInProgress.actualStartTime = -1.1)); workInProgress.flags = current.flags & 31457280; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; @@ -17438,7 +17540,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -17491,7 +17594,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -17515,8 +17619,8 @@ __DEV__ && (fiberTag = isHostHoistableType(type, pendingProps, fiberTag) ? 26 : "html" === type || "head" === type || "body" === type - ? 27 - : 5); + ? 27 + : 5); else a: switch (type) { case REACT_FRAGMENT_TYPE: @@ -17528,12 +17632,12 @@ __DEV__ && ); case REACT_STRICT_MODE_TYPE: fiberTag = 8; - mode |= 8; - if (disableLegacyMode || 0 !== (mode & 1)) - (mode |= 16), + mode |= StrictLegacyMode; + if (disableLegacyMode || (mode & ConcurrentMode) !== NoMode) + (mode |= StrictEffectsMode), enableDO_NOT_USE_disableStrictPassiveEffect && pendingProps.DO_NOT_USE_disableStrictPassiveEffect && - (mode |= 64); + (mode |= NoStrictPassiveEffectsMode); break; case REACT_PROFILER_TYPE: return ( @@ -17543,7 +17647,7 @@ __DEV__ && 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof type.id ), - (key = createFiber(12, type, key, mode | 2)), + (key = createFiber(12, type, key, mode | ProfileMode)), (key.elementType = REACT_PROFILER_TYPE), (key.lanes = lanes), (key.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }), @@ -17594,7 +17698,7 @@ __DEV__ && case REACT_DEBUG_TRACING_MODE_TYPE: if (enableDebugTracing) { fiberTag = 8; - mode |= 4; + mode |= DebugTracingMode; break; } default: @@ -17637,15 +17741,15 @@ __DEV__ && null === type ? (pendingProps = "null") : isArrayImpl(type) - ? (pendingProps = "array") - : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE - ? ((pendingProps = - "<" + - (getComponentNameFromType(type.type) || "Unknown") + - " />"), - (resolvedType = - " Did you accidentally export a JSX literal instead of a component?")) - : (pendingProps = typeof type); + ? (pendingProps = "array") + : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE + ? ((pendingProps = + "<" + + (getComponentNameFromType(type.type) || "Unknown") + + " />"), + (resolvedType = + " Did you accidentally export a JSX literal instead of a component?")) + : (pendingProps = typeof type); (fiberTag = owner ? getComponentNameFromOwner(owner) : null) && (resolvedType += "\n\nCheck the render method of `" + fiberTag + "`."); @@ -17773,6 +17877,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -17793,18 +17898,14 @@ __DEV__ && this.transitionCallbacks = null, containerInfo = this.transitionLanes = [], identifierPrefix = 0; - identifierPrefix < TotalLanes; + 31 > identifierPrefix; identifierPrefix++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; - for ( - identifierPrefix = 0; - identifierPrefix < TotalLanes; - identifierPrefix++ - ) + for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) containerInfo.push(new Set()); if (disableLegacyMode) this._debugRootType = hydrate ? "hydrateRoot()" : "createRoot()"; @@ -17824,7 +17925,6 @@ __DEV__ && initialChildren, hydrationCallbacks, isStrictMode, - concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, @@ -17846,22 +17946,21 @@ __DEV__ && enableTransitionTracing && (containerInfo.transitionCallbacks = transitionCallbacks); disableLegacyMode || 1 === tag - ? ((tag = 1), - !0 === isStrictMode && (tag |= 24), - concurrentUpdatesByDefaultOverride && (tag |= 32)) - : (tag = 0); - isDevToolsPresent && (tag |= 2); + ? ((tag = ConcurrentMode), + !0 === isStrictMode && (tag |= StrictLegacyMode | StrictEffectsMode)) + : (tag = NoMode); + isDevToolsPresent && (tag |= ProfileMode); isStrictMode = createFiber(3, null, null, tag); containerInfo.current = isStrictMode; isStrictMode.stateNode = containerInfo; - concurrentUpdatesByDefaultOverride = createCache(); - retainCache(concurrentUpdatesByDefaultOverride); - containerInfo.pooledCache = concurrentUpdatesByDefaultOverride; - retainCache(concurrentUpdatesByDefaultOverride); + tag = createCache(); + retainCache(tag); + containerInfo.pooledCache = tag; + retainCache(tag); isStrictMode.memoizedState = { element: initialChildren, isDehydrated: hydrate, - cache: concurrentUpdatesByDefaultOverride + cache: tag }; initializeUpdateQueue(isStrictMode); return containerInfo; @@ -17933,12 +18032,12 @@ __DEV__ && } component = findCurrentHostFiber(fiber); if (null === component) return null; - if (component.mode & 8) { + if (component.mode & StrictLegacyMode) { var componentName = getComponentNameFromFiber(fiber) || "Component"; didWarnAboutFindNodeInStrictMode[componentName] || ((didWarnAboutFindNodeInStrictMode[componentName] = !0), runWithFiberInDEV(component, function () { - fiber.mode & 8 + fiber.mode & StrictLegacyMode ? error$jscomp$0( "%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node", methodName, @@ -17977,7 +18076,6 @@ __DEV__ && initialChildren, hydrationCallbacks, isStrictMode, - concurrentUpdatesByDefaultOverride, identifierPrefix, onUncaughtError, onCaughtError, @@ -18019,13 +18117,13 @@ __DEV__ && 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, - SyncLane, + 2, element, container, parentComponent, callback ); - return SyncLane; + return 2; } function updateContainerImpl( rootFiber, @@ -18105,22 +18203,25 @@ __DEV__ && } function attemptContinuousHydration(fiber) { if (13 === fiber.tag) { - var lane = SelectiveHydrationLane, - root = enqueueConcurrentRenderForLane(fiber, lane); - null !== root && scheduleUpdateOnFiber(root, fiber, lane); - markRetryLaneIfNotHydrated(fiber, lane); + var root = enqueueConcurrentRenderForLane(fiber, 67108864); + null !== root && scheduleUpdateOnFiber(root, fiber, 67108864); + markRetryLaneIfNotHydrated(fiber, 67108864); } } - function findHostInstanceByFiber(fiber) { - fiber = findCurrentHostFiber(fiber); - return null === fiber ? null : fiber.stateNode; - } - function emptyFindFiberByHostInstance() { - return null; - } function getCurrentFiberForDevTools() { return current; } + function getLaneLabelMap() { + if (enableSchedulingProfiler) { + for (var map = new Map(), lane = 1, index = 0; 31 > index; index++) { + var label = getLabelForLane(lane); + map.set(lane, label); + lane *= 2; + } + return map; + } + return null; + } function batchedUpdates(fn, a, b) { if (isInsideEventHandler) return fn(a, b); isInsideEventHandler = !0; @@ -18273,8 +18374,8 @@ __DEV__ && return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) - ? !!nativeEvent[keyArg] - : !1; + ? !!nativeEvent[keyArg] + : !1; } function getEventModifierState() { return modifierStateGetter; @@ -18359,8 +18460,8 @@ __DEV__ && return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName - ? !0 - : !1; + ? !0 + : !1; } function isEventSupported(eventNameSuffix) { if (!canUseDOM) return !1; @@ -18479,20 +18580,26 @@ __DEV__ && ? outerNode === innerNode ? !0 : outerNode && 3 === outerNode.nodeType - ? !1 - : innerNode && 3 === innerNode.nodeType - ? containsNode(outerNode, innerNode.parentNode) - : "contains" in outerNode - ? outerNode.contains(innerNode) - : outerNode.compareDocumentPosition - ? !!(outerNode.compareDocumentPosition(innerNode) & 16) - : !1 + ? !1 + : innerNode && 3 === innerNode.nodeType + ? containsNode(outerNode, innerNode.parentNode) + : "contains" in outerNode + ? outerNode.contains(innerNode) + : outerNode.compareDocumentPosition + ? !!(outerNode.compareDocumentPosition(innerNode) & 16) + : !1 : !1; } - function getActiveElementDeep() { + function getActiveElementDeep(containerInfo) { + containerInfo = + null != containerInfo && + null != containerInfo.ownerDocument && + null != containerInfo.ownerDocument.defaultView + ? containerInfo.ownerDocument.defaultView + : window; for ( - var win = window, element = getActiveElement(); - element instanceof win.HTMLIFrameElement; + var element = getActiveElement(containerInfo.document); + element instanceof containerInfo.HTMLIFrameElement; ) { try { @@ -18501,9 +18608,9 @@ __DEV__ && } catch (err) { JSCompiler_inline_result = !1; } - if (JSCompiler_inline_result) win = element.contentWindow; + if (JSCompiler_inline_result) containerInfo = element.contentWindow; else break; - element = getActiveElement(win.document); + element = getActiveElement(containerInfo.document); } return element; } @@ -18521,103 +18628,98 @@ __DEV__ && "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation) { - var curFocusedElem = getActiveElementDeep(), - priorFocusedElem = priorSelectionInformation.focusedElem, - priorSelectionRange = priorSelectionInformation.selectionRange; + function restoreSelection(priorSelectionInformation, containerInfo) { + var curFocusedElem = getActiveElementDeep(containerInfo); + containerInfo = priorSelectionInformation.focusedElem; + var priorSelectionRange = priorSelectionInformation.selectionRange; if ( - curFocusedElem !== priorFocusedElem && - priorFocusedElem && - priorFocusedElem.ownerDocument && - containsNode( - priorFocusedElem.ownerDocument.documentElement, - priorFocusedElem - ) + curFocusedElem !== containerInfo && + containerInfo && + containerInfo.ownerDocument && + containsNode(containerInfo.ownerDocument.documentElement, containerInfo) ) { if ( null !== priorSelectionRange && - hasSelectionCapabilities(priorFocusedElem) + hasSelectionCapabilities(containerInfo) ) if ( - ((curFocusedElem = priorSelectionRange.start), - (priorSelectionInformation = priorSelectionRange.end), - void 0 === priorSelectionInformation && - (priorSelectionInformation = curFocusedElem), - "selectionStart" in priorFocusedElem) + ((priorSelectionInformation = priorSelectionRange.start), + (curFocusedElem = priorSelectionRange.end), + void 0 === curFocusedElem && + (curFocusedElem = priorSelectionInformation), + "selectionStart" in containerInfo) ) - (priorFocusedElem.selectionStart = curFocusedElem), - (priorFocusedElem.selectionEnd = Math.min( - priorSelectionInformation, - priorFocusedElem.value.length + (containerInfo.selectionStart = priorSelectionInformation), + (containerInfo.selectionEnd = Math.min( + curFocusedElem, + containerInfo.value.length )); else if ( - ((priorSelectionInformation = - ((curFocusedElem = priorFocusedElem.ownerDocument || document) && - curFocusedElem.defaultView) || + ((curFocusedElem = + ((priorSelectionInformation = + containerInfo.ownerDocument || document) && + priorSelectionInformation.defaultView) || window), - priorSelectionInformation.getSelection) + curFocusedElem.getSelection) ) { - priorSelectionInformation = - priorSelectionInformation.getSelection(); - var length = priorFocusedElem.textContent.length, + curFocusedElem = curFocusedElem.getSelection(); + var length = containerInfo.textContent.length, start = Math.min(priorSelectionRange.start, length); priorSelectionRange = void 0 === priorSelectionRange.end ? start : Math.min(priorSelectionRange.end, length); - !priorSelectionInformation.extend && + !curFocusedElem.extend && start > priorSelectionRange && ((length = priorSelectionRange), (priorSelectionRange = start), (start = length)); - length = getNodeForCharacterOffset(priorFocusedElem, start); + length = getNodeForCharacterOffset(containerInfo, start); var endMarker = getNodeForCharacterOffset( - priorFocusedElem, + containerInfo, priorSelectionRange ); length && endMarker && - (1 !== priorSelectionInformation.rangeCount || - priorSelectionInformation.anchorNode !== length.node || - priorSelectionInformation.anchorOffset !== length.offset || - priorSelectionInformation.focusNode !== endMarker.node || - priorSelectionInformation.focusOffset !== endMarker.offset) && - ((curFocusedElem = curFocusedElem.createRange()), - curFocusedElem.setStart(length.node, length.offset), - priorSelectionInformation.removeAllRanges(), + (1 !== curFocusedElem.rangeCount || + curFocusedElem.anchorNode !== length.node || + curFocusedElem.anchorOffset !== length.offset || + curFocusedElem.focusNode !== endMarker.node || + curFocusedElem.focusOffset !== endMarker.offset) && + ((priorSelectionInformation = + priorSelectionInformation.createRange()), + priorSelectionInformation.setStart(length.node, length.offset), + curFocusedElem.removeAllRanges(), start > priorSelectionRange - ? (priorSelectionInformation.addRange(curFocusedElem), - priorSelectionInformation.extend( + ? (curFocusedElem.addRange(priorSelectionInformation), + curFocusedElem.extend(endMarker.node, endMarker.offset)) + : (priorSelectionInformation.setEnd( endMarker.node, endMarker.offset - )) - : (curFocusedElem.setEnd(endMarker.node, endMarker.offset), - priorSelectionInformation.addRange(curFocusedElem))); + ), + curFocusedElem.addRange(priorSelectionInformation))); } - curFocusedElem = []; + priorSelectionInformation = []; for ( - priorSelectionInformation = priorFocusedElem; - (priorSelectionInformation = priorSelectionInformation.parentNode); + curFocusedElem = containerInfo; + (curFocusedElem = curFocusedElem.parentNode); ) - 1 === priorSelectionInformation.nodeType && - curFocusedElem.push({ - element: priorSelectionInformation, - left: priorSelectionInformation.scrollLeft, - top: priorSelectionInformation.scrollTop + 1 === curFocusedElem.nodeType && + priorSelectionInformation.push({ + element: curFocusedElem, + left: curFocusedElem.scrollLeft, + top: curFocusedElem.scrollTop }); - "function" === typeof priorFocusedElem.focus && - priorFocusedElem.focus(); + "function" === typeof containerInfo.focus && containerInfo.focus(); for ( - priorFocusedElem = 0; - priorFocusedElem < curFocusedElem.length; - priorFocusedElem++ + containerInfo = 0; + containerInfo < priorSelectionInformation.length; + containerInfo++ ) - (priorSelectionInformation = curFocusedElem[priorFocusedElem]), - (priorSelectionInformation.element.scrollLeft = - priorSelectionInformation.left), - (priorSelectionInformation.element.scrollTop = - priorSelectionInformation.top); + (curFocusedElem = priorSelectionInformation[containerInfo]), + (curFocusedElem.element.scrollLeft = curFocusedElem.left), + (curFocusedElem.element.scrollTop = curFocusedElem.top); } } function constructSelectEvent( @@ -18629,8 +18731,8 @@ __DEV__ && nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : nativeEventTarget.nodeType === DOCUMENT_NODE - ? nativeEventTarget - : nativeEventTarget.ownerDocument; + ? nativeEventTarget + : nativeEventTarget.ownerDocument; mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || @@ -18816,8 +18918,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$51) { - reportGlobalError(error$51); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18838,8 +18940,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$51) { - reportGlobalError(error$51); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18942,17 +19044,17 @@ __DEV__ && eventSystemFlags ) : void 0 !== isPassiveListener - ? EventListenerWWW.bubbleWithPassiveFlag( - targetContainer, - domEventName, - eventSystemFlags, - isPassiveListener - ) - : EventListenerWWW.listen( - targetContainer, - domEventName, - eventSystemFlags - ); + ? EventListenerWWW.bubbleWithPassiveFlag( + targetContainer, + domEventName, + eventSystemFlags, + isPassiveListener + ) + : EventListenerWWW.listen( + targetContainer, + domEventName, + eventSystemFlags + ); } function dispatchEventForPluginEventSystem( domEventName, @@ -19167,8 +19269,8 @@ __DEV__ && nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) - ? reactName.defaultView || reactName.parentWindow - : window; + ? reactName.defaultView || reactName.parentWindow + : window; if (SyntheticEventCtor) { if ( ((reactEventType = @@ -19804,50 +19906,53 @@ __DEV__ && "Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window." ))) : "input" === tag || "button" === tag - ? "action" === key - ? error$jscomp$0( - "You can only pass the action prop to
. Use the formAction prop on or