From 03a84da0be93ced574947a9d11977969183c0b02 Mon Sep 17 00:00:00 2001 From: kodetoreality Date: Wed, 23 Oct 2024 12:33:54 -0700 Subject: [PATCH] [playground] Upgrade to Next 15 stable (#31333) DiffTrain build for [28668d39bea855c3bda481d018d8f3f0dfad9066](https://github.com/facebook/react/commit/28668d39bea855c3bda481d018d8f3f0dfad9066) --- compiled/babel-plugin-react-refresh/index.js | 6 + .../facebook-www/JSXDEVRuntime-dev.classic.js | 244 +- .../facebook-www/JSXDEVRuntime-dev.modern.js | 244 +- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 278 +- compiled/facebook-www/React-dev.modern.js | 278 +- compiled/facebook-www/React-prod.classic.js | 263 +- compiled/facebook-www/React-prod.modern.js | 259 +- .../facebook-www/React-profiling.classic.js | 263 +- .../facebook-www/React-profiling.modern.js | 259 +- compiled/facebook-www/ReactART-dev.classic.js | 4105 +++++++------ compiled/facebook-www/ReactART-dev.modern.js | 4037 +++++++------ .../facebook-www/ReactART-prod.classic.js | 2253 ++++---- compiled/facebook-www/ReactART-prod.modern.js | 2249 ++++---- compiled/facebook-www/ReactDOM-dev.classic.js | 5119 +++++++++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 5072 ++++++++-------- .../facebook-www/ReactDOM-prod.classic.js | 3236 ++++++----- compiled/facebook-www/ReactDOM-prod.modern.js | 3229 ++++++----- .../ReactDOM-profiling.classic.js | 3743 ++++++------ .../facebook-www/ReactDOM-profiling.modern.js | 3732 ++++++------ .../ReactDOMServer-dev.classic.js | 470 +- .../facebook-www/ReactDOMServer-dev.modern.js | 458 +- .../ReactDOMServer-prod.classic.js | 480 +- .../ReactDOMServer-prod.modern.js | 467 +- .../ReactDOMServerStreaming-dev.modern.js | 459 +- .../ReactDOMServerStreaming-prod.modern.js | 426 +- .../ReactDOMTesting-dev.classic.js | 5119 +++++++++-------- .../ReactDOMTesting-dev.modern.js | 5072 ++++++++-------- .../ReactDOMTesting-prod.classic.js | 3244 ++++++----- .../ReactDOMTesting-prod.modern.js | 3237 ++++++----- .../ReactReconciler-dev.classic.js | 4308 +++++++------- .../ReactReconciler-dev.modern.js | 4237 +++++++------- .../ReactReconciler-prod.classic.js | 2549 ++++---- .../ReactReconciler-prod.modern.js | 2540 ++++---- .../ReactTestRenderer-dev.classic.js | 3662 ++++++------ .../ReactTestRenderer-dev.modern.js | 3662 ++++++------ compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 1 - .../facebook-www/eslint-plugin-react-hooks.js | 8 +- 41 files changed, 42755 insertions(+), 36521 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 52f93e85cb663..211a1ee5b0c04 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.classic.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.classic.js @@ -201,64 +201,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -267,54 +267,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -325,7 +329,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -466,7 +470,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -639,18 +644,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ("ref" in config || "key" in config) { + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); + if ( + (!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; @@ -756,6 +766,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) && @@ -774,43 +785,49 @@ __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"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -864,7 +881,8 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, + var enableFastJSXWithoutStringRefs = disableStringRefs, + didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function ( diff --git a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js index 6f6fd917767f1..a0f1fb98c3629 100644 --- a/compiled/facebook-www/JSXDEVRuntime-dev.modern.js +++ b/compiled/facebook-www/JSXDEVRuntime-dev.modern.js @@ -201,64 +201,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -267,54 +267,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -325,7 +329,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -463,7 +467,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -636,18 +641,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ("ref" in config || "key" in config) { + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); + if ( + (!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 +763,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,43 +782,49 @@ __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"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing; dynamicFeatureFlags = dynamicFeatureFlags.renameElementSymbol; @@ -860,7 +877,8 @@ __DEV__ && specialPropKeyWarningShown; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, + var enableFastJSXWithoutStringRefs = disableStringRefs, + didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsxDEV = function ( diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 2109d178ba9b5..6ca6a3689ca9e 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0ad0fac1dc11db8d5a6831987fb0324cd6d59498 +28668d39bea855c3bda481d018d8f3f0dfad9066 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 2109d178ba9b5..6ca6a3689ca9e 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -0ad0fac1dc11db8d5a6831987fb0324cd6d59498 +28668d39bea855c3bda481d018d8f3f0dfad9066 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 082abc5d64d01..1763fd6c2e2d6 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -288,64 +288,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -354,54 +354,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -412,7 +416,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -553,7 +557,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -701,18 +706,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ("ref" in config || "key" in config) { + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); + if ( + (!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; @@ -826,6 +836,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) && @@ -844,37 +855,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" }; @@ -1199,7 +1214,9 @@ __DEV__ && var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -1316,7 +1333,8 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, + var enableFastJSXWithoutStringRefs = disableStringRefs, + didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, @@ -1361,7 +1379,8 @@ __DEV__ && return queueMicrotask(callback); }); } - : enqueueTask; + : enqueueTask, + ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -1403,6 +1422,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 @@ -1565,13 +1585,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; @@ -1707,7 +1727,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)) @@ -1715,9 +1736,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) { @@ -1874,20 +1895,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 && @@ -2001,7 +2021,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; + exports.version = "19.0.0-www-classic-28668d39-20241023"; "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 d0b23c544b7fc..1928ceab81ea0 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -288,64 +288,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -354,54 +354,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -412,7 +416,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -550,7 +554,8 @@ __DEV__ && } function warnIfStringRefCannotBeAutoConverted(config, self) { var owner; - "string" === typeof config.ref && + !disableStringRefs && + "string" === typeof config.ref && (owner = getOwner()) && self && owner.stateNode !== self && @@ -698,18 +703,23 @@ __DEV__ && (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey)); hasValidKey(config) && (checkKeyStringCoercion(config.key), (children = "" + config.key)); - hasValidRef(config) && warnIfStringRefCannotBeAutoConverted(config, self); - if ("ref" in config || "key" in config) { + hasValidRef(config) && + (disableStringRefs || + warnIfStringRefCannotBeAutoConverted(config, self)); + if ( + (!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; @@ -823,6 +833,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) && @@ -841,37 +852,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" }; @@ -1196,7 +1211,9 @@ __DEV__ && var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -1312,7 +1329,8 @@ __DEV__ && didWarnAboutOldJSXRuntime; var didWarnAboutStringRefs = {}; var didWarnAboutElementRef = {}; - var didWarnAboutKeySpread = {}, + var enableFastJSXWithoutStringRefs = disableStringRefs, + didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {}, didWarnAboutMaps = !1, userProvidedKeyEscapeRegex = /\/+/g, @@ -1357,7 +1375,8 @@ __DEV__ && return queueMicrotask(callback); }); } - : enqueueTask; + : enqueueTask, + ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -1399,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 prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth; @@ -1545,13 +1565,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; @@ -1687,7 +1707,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)) @@ -1695,9 +1716,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) { @@ -1854,20 +1875,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 && @@ -1981,7 +2001,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; + exports.version = "19.0.0-www-modern-28668d39-20241023"; "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 7c404132bed4f..ee7f3d7717d61 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -14,9 +14,12 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + 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") @@ -90,40 +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 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 ("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); } @@ -134,7 +281,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -146,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; @@ -157,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" }; @@ -395,6 +552,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -436,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."); }; @@ -452,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 && @@ -471,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; @@ -521,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) { @@ -566,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 && @@ -665,4 +824,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; +exports.version = "19.0.0-www-classic-28668d39-20241023"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 03fcaf44892ed..63b2d5a07d907 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -14,6 +14,8 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -90,40 +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 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 ("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); } @@ -134,7 +277,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -146,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; @@ -157,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" }; @@ -395,6 +548,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -436,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."); }; @@ -452,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 && @@ -471,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; @@ -521,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) { @@ -566,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 && @@ -665,4 +820,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; +exports.version = "19.0.0-www-modern-28668d39-20241023"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 46f97e3980d38..488b5b90f09fc 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -18,9 +18,12 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + 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") @@ -94,40 +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 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 ("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); } @@ -138,7 +285,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -150,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; @@ -161,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" }; @@ -399,6 +556,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -440,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."); }; @@ -456,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 && @@ -475,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; @@ -525,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) { @@ -570,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 && @@ -669,7 +828,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; +exports.version = "19.0.0-www-classic-28668d39-20241023"; "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 eb7d62fcdb617..daa3ed4269f24 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -18,6 +18,8 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, + enableLogStringRefsProd = dynamicFeatureFlags.enableLogStringRefsProd, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -94,40 +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 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 ("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); } @@ -138,7 +281,7 @@ function cloneAndReplaceKey(oldElement, newKey) { null, void 0, void 0, - oldElement._owner, + disableStringRefs ? void 0 : oldElement._owner, oldElement.props ); } @@ -150,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; @@ -161,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" }; @@ -399,6 +552,7 @@ var reportGlobalError = console.error(error); }; function noop() {} +var ReactCompilerRuntime = { c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -440,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."); }; @@ -456,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 && @@ -475,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; @@ -525,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) { @@ -570,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 && @@ -669,7 +824,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; +exports.version = "19.0.0-www-modern-28668d39-20241023"; "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 59abf270ede41..883335b0ec929 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -394,64 +394,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -460,54 +460,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -518,7 +522,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -743,20 +747,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 && @@ -859,31 +849,53 @@ __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 || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -932,14 +944,6 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -956,25 +960,34 @@ __DEV__ && 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) @@ -986,9 +999,15 @@ __DEV__ && var update = hiddenUpdatesForLane[index]; 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; @@ -1243,11 +1262,33 @@ __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; } @@ -1410,7 +1451,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, @@ -1419,7 +1460,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, @@ -1428,7 +1469,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, @@ -1441,7 +1482,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;" @@ -1450,7 +1491,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -2036,6 +2077,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 && @@ -2057,28 +2146,42 @@ __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 & 3) && - ((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) || + checkIfRootIsPrerendering(root, nextLanes) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -2090,6 +2193,7 @@ __DEV__ && didScheduleMicrotask_act = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now$1(), prev = null, root = firstScheduledRoot; null !== root; @@ -2105,8 +2209,7 @@ __DEV__ && 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -2147,45 +2250,74 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode$1) + ) + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode$1)) + : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && cancelCallback(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; + } + 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 && @@ -2224,8 +2356,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2545,6 +2677,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) @@ -3976,6 +4118,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; @@ -4033,10 +4183,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; } @@ -4155,7 +4311,11 @@ __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; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; JSCompiler_temp.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; JSCompiler_temp = value; @@ -4212,7 +4372,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; @@ -4237,10 +4397,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4530,10 +4694,14 @@ __DEV__ && if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -4811,17 +4979,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) { @@ -4975,10 +5142,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; } @@ -4989,10 +5160,14 @@ __DEV__ && if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -5081,14 +5256,26 @@ __DEV__ && 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$9) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$9 - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -5224,8 +5411,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, @@ -5247,35 +5443,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; - } + 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, @@ -5343,61 +5531,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); @@ -6534,6 +6667,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -6624,6 +6758,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7296,8 +7431,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)); @@ -7427,10 +7562,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, @@ -7768,9 +7903,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; @@ -8190,9 +8326,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, @@ -8695,7 +8832,11 @@ __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 }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -8879,12 +9020,13 @@ __DEV__ && 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) { @@ -9561,70 +9703,371 @@ __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 ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, 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") || + 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 + ); + } 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(current) + getComponentNameFromFiber(finishedWork) ), - (ref.current = instanceToUse); - } - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); + (ref.current = instanceToUse); + } + } + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error$17) { + captureCommitPhaseError(current, nearestMountedAncestor, error$17); } } function safelyDetachRef(current, nearestMountedAncestor) { @@ -9635,13 +10078,13 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), refCleanup(); + startEffectTimer(), runWithFiberInDEV(current, refCleanup); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else refCleanup(); - } catch (error$12) { - captureCommitPhaseError(current, nearestMountedAncestor, error$12); + else runWithFiberInDEV(current, refCleanup); + } catch (error$18) { + captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9651,395 +10094,297 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else ref(null); - } catch (error$13) { - captureCommitPhaseError(current, nearestMountedAncestor, error$13); + else runWithFiberInDEV(current, ref, null); + } catch (error$19) { + captureCommitPhaseError(current, nearestMountedAncestor, error$19); } else ref.current = null; } - function commitBeforeMutationEffects(root, firstChild) { - focusedInstanceHandle = null; - for (nextEffect = firstChild; null !== nextEffect; ) { - root = nextEffect; - firstChild = root.deletions; - if (null !== firstChild) - for (var i = 0; i < firstChild.length; i++) - doesFiberContain(firstChild[i], focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - firstChild = root.child; - if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - try { - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$14) { - captureCommitPhaseError(root, root.return, error$14); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } - } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - focusedInstanceHandle = null; - return root; + 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 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 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 commitHookEffectListUnmount( - flags, + function commitProfilerPostCommit( finishedWork, - nearestMountedAncestor + current, + commitStartTime, + passiveEffectDuration ) { - 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), - 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 && - markComponentLayoutEffectUnmountStopped())); - } - effect = effect.next; - } while (effect !== updateQueue); + try { + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } - 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 - )); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (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()); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 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", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); + function 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 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 isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$15) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$15); + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$16) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + 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 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$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); + 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 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) { + function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = null; + for (nextEffect = firstChild; null !== nextEffect; ) { + root = nextEffect; + firstChild = root.deletions; + if (null !== firstChild) + for (var i = 0; i < firstChild.length; i++) + doesFiberContain(firstChild[i], focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + firstChild = root.child; + if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + 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: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + 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) { + firstChild.return = root.return; + nextEffect = firstChild; + break; } - parentFiber = parentFiber.return; + nextEffect = root.return; } - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } + } + root = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return root; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -10056,17 +10401,27 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )), shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), + 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 || @@ -10081,20 +10436,24 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -10102,75 +10461,87 @@ __DEV__ && 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$20) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$20 + 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( @@ -10178,31 +10549,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( @@ -10380,91 +10738,33 @@ __DEV__ && ), (markerInstance.transitions = null), (markerInstance.pendingBoundaries = null), - (markerInstance.aborts = null))) - : markerInstance.tag === TransitionRoot && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }); - } - } - function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber._debugOwner = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; - } - function isHostParent(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || 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); + (markerInstance.aborts = null))) + : markerInstance.tag === TransitionRoot && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }); + } + } + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber._debugOwner = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } function recursivelyTraverseDeletionEffects( finishedRoot, @@ -10515,16 +10815,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() @@ -10547,49 +10882,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), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - callDestroyInDEV( - 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, @@ -10716,74 +11021,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$23) { - captureCommitPhaseError(childToDelete, parentFiber, error$23); + 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) { @@ -10791,57 +11075,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$24) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$24 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$25) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$25 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - } + 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 && @@ -10859,25 +11109,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$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } + 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 && @@ -10887,31 +11154,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) { @@ -10926,11 +11221,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$30) { + } catch (error$32) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + error$32 ); } flags = finishedWork.updateQueue; @@ -10952,10 +11247,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; @@ -10979,24 +11274,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$21) { + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$21 + 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) && @@ -11026,7 +11348,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -11035,7 +11357,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -11044,7 +11366,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -11052,43 +11374,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$31) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$31); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -11097,27 +11385,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) { @@ -11126,23 +11400,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: @@ -11200,28 +11462,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$32) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + 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); @@ -11235,17 +11494,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( @@ -11279,9 +11566,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -11289,22 +11574,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$34) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$34); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -11379,21 +11648,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, @@ -11402,9 +11656,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11433,6 +11685,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11500,6 +11753,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( @@ -11516,9 +11796,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11528,25 +11808,23 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions )) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11558,7 +11836,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -11602,9 +11880,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11651,9 +11927,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, @@ -11664,11 +11940,9 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & 1 ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11676,7 +11950,7 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects )) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11689,7 +11963,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -11729,70 +12003,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) @@ -11844,25 +12094,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)) { @@ -11879,11 +12110,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -11899,12 +12126,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; @@ -11927,7 +12166,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -11954,116 +12193,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) { @@ -12071,20 +12301,10 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$35) { - captureCommitPhaseError(fiber, fiber.return, error$35); - } + commitHookEffectListMount(Layout | HasEffect, fiber); break; case 1: - var instance = fiber.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error$36) { - captureCommitPhaseError(fiber, fiber.return, error$36); - } + commitClassDidMount(fiber); } } function invokePassiveEffectMountInDEV(fiber) { @@ -12092,11 +12312,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$37) { - captureCommitPhaseError(fiber, fiber.return, error$37); - } + commitHookEffectListMount(Passive | HasEffect, fiber); } } function invokeLayoutEffectUnmountInDEV(fiber) { @@ -12104,15 +12320,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Layout | HasEffect, - fiber, - fiber.return - ); - } catch (error$38) { - captureCommitPhaseError(fiber, fiber.return, error$38); - } + commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); break; case 1: var instance = fiber.stateNode; @@ -12125,15 +12333,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Passive | HasEffect, - fiber, - fiber.return - ); - } catch (error$39) { - captureCommitPhaseError(fiber, fiber.return, error$39); - } + commitHookEffectListUnmount(Passive | HasEffect, fiber, fiber.return); } } function isConcurrentActEnvironment() { @@ -12251,7 +12451,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if ( @@ -12309,7 +12510,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); 2 !== lane || @@ -12318,176 +12520,210 @@ __DEV__ && 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; + throw Error("Should not already be working."); var shouldTimeSlice = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + (enableSiblingPrerendering && checkIfRootIsPrerendering(root, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, + if (exitStatus === RootInProgress) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root, lanes, 0, !1); + break; + } else if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + 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, - 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) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + !1 + ); + if (renderWasConcurrent !== RootErrored) { + if (workInProgressRootDidAttachPingListener) { + exitStatus.errorRecoveryDisabledLanes |= + originallyAttemptedLanes; + workInProgressRootInterleavedUpdatedLanes |= + originallyAttemptedLanes; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = lanesThatJustErrored; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = renderWasConcurrent; } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - didTimeout + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) { + lanes = shouldTimeSlice; + forceSync = workInProgressRootRecoverableErrors; + shouldTimeSlice = workInProgressTransitions; + exitStatus = workInProgressRootDidIncludeRecursiveRenderUpdate; + renderWasConcurrent = workInProgressDeferredLane; + lanesThatJustErrored = workInProgressRootInterleavedUpdatedLanes; + originallyAttemptedLanes = workInProgressSuspendedRetryLanes; + var suspendedCommitReason = IMMEDIATE_COMMIT, + prevTransition = ReactSharedInternals.T, + previousUpdateLanePriority = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + lanes, + forceSync, + shouldTimeSlice, + exitStatus, + previousUpdateLanePriority, + renderWasConcurrent, + lanesThatJustErrored, + originallyAttemptedLanes, + suspendedCommitReason, + -0, + 0 + ); + } finally { + (ReactSharedInternals.T = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + } else { + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + -0, + 0 + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + -0, + 0 + ); } } - break; - } while (1); - } + } + break; + } 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 @@ -12504,41 +12740,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$40) { - 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; ) { @@ -12554,7 +12811,9 @@ __DEV__ && 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 & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -12562,73 +12821,32 @@ __DEV__ && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didAttemptEntireTree + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didAttemptEntireTree[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() { @@ -12663,9 +12881,12 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -12697,20 +12918,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 & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - 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()), @@ -12724,16 +12953,16 @@ __DEV__ && ? 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)) { @@ -12743,7 +12972,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentErrored && injectedProfilingHooks.markComponentErrored( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12757,7 +12986,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentSuspended && injectedProfilingHooks.markComponentSuspended( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12775,16 +13004,22 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } - function renderRootSync(root, lanes) { + function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(), @@ -12806,34 +13041,49 @@ __DEV__ && enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = RootInProgress; + break a; + } + break; default: - (workInProgressSuspendedReason = NotSuspended), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$41) { - handleThrow(root, thrownValue$41); + } catch (thrownValue$34) { + handleThrow(root, thrownValue$34); } while (1); lanes && root.shellSuspendCounter++; @@ -12841,16 +13091,13 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -12874,7 +13121,11 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering( + root, + lanes + ); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -12891,7 +13142,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -12923,7 +13179,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -12955,12 +13216,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(); @@ -12975,8 +13246,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$42) { - handleThrow(root, thrownValue$42); + } catch (thrownValue$35) { + handleThrow(root, thrownValue$35); } while (1); resetContextDependencies(); @@ -13014,7 +13285,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -13022,7 +13293,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -13030,7 +13301,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -13093,10 +13364,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; @@ -13120,9 +13396,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$43) { + } catch (error$36) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$43); + throw ((workInProgress = returnFiber), error$36); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -13131,62 +13407,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; @@ -13201,31 +13467,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, @@ -13233,7 +13505,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -13246,7 +13520,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;" @@ -13277,7 +13551,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), @@ -13289,48 +13570,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), @@ -13370,7 +13651,7 @@ __DEV__ && ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; @@ -13392,7 +13673,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -13408,7 +13689,7 @@ __DEV__ && return ( (currentUpdatePriority = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -13418,15 +13699,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; @@ -13442,7 +13714,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;" @@ -13455,12 +13727,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 && @@ -13470,7 +13738,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -13508,9 +13776,9 @@ __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) { @@ -13591,6 +13859,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -13612,7 +13881,9 @@ __DEV__ && 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) { @@ -13725,12 +13996,15 @@ __DEV__ && var shouldDoubleInvokePassiveEffects = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !0; setIsStrictModeForDevtools(!0); - disappearLayoutEffects(fiber); - shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber); - reappearLayoutEffects(root, fiber.alternate, fiber, !1); - shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); - setIsStrictModeForDevtools(!1); + try { + disappearLayoutEffects(fiber), + shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), + reappearLayoutEffects(root, fiber.alternate, fiber, !1), + shouldDoubleInvokePassiveEffects && + reconnectPassiveEffects(root, fiber, 0, null, !1); + } finally { + setIsStrictModeForDevtools(!1); + } } function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { disableLegacyMode || 0 !== root.tag @@ -13970,9 +14244,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; @@ -14008,10 +14282,10 @@ __DEV__ && key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, _debugInfo: null, _debugOwner: null, _debugNeedsRemount: !1, @@ -14047,8 +14321,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; @@ -14062,7 +14336,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -14115,7 +14390,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -14398,6 +14674,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -14422,7 +14699,7 @@ __DEV__ && identifierPrefix++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) @@ -14468,14 +14745,13 @@ __DEV__ && 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: @@ -14569,17 +14845,21 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, @@ -14722,6 +15002,12 @@ __DEV__ && 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, @@ -16256,14 +16542,7 @@ __DEV__ && updateHookTypesDev(); return unstable_useContextWithBailout(context, select); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); @@ -16346,7 +16625,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -16518,6 +16797,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -16525,6 +16806,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -16540,7 +16822,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -16552,6 +16833,8 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16776,11 +17059,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-0ad0fac1-20240814", + version: "19.0.0-www-classic-28668d39-20241023", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-classic-28668d39-20241023" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16814,7 +17097,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; + exports.version = "19.0.0-www-classic-28668d39-20241023"; "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 ba3efc7aae746..b82ec3b57cfab 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -391,64 +391,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -457,54 +457,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -515,7 +519,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -726,20 +730,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 && @@ -842,31 +832,53 @@ __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 || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -915,14 +927,6 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -939,25 +943,34 @@ __DEV__ && 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) @@ -969,9 +982,15 @@ __DEV__ && var update = hiddenUpdatesForLane[index]; 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; @@ -1226,11 +1245,33 @@ __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; } @@ -1299,7 +1340,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, @@ -1308,7 +1349,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, @@ -1317,7 +1358,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, @@ -1330,7 +1371,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;" @@ -1339,7 +1380,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -1925,6 +1966,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 && @@ -1942,28 +2031,42 @@ __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 & 3) && - ((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) || + checkIfRootIsPrerendering(root, nextLanes) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -1975,6 +2078,7 @@ __DEV__ && didScheduleMicrotask_act = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now$1(), prev = null, root = firstScheduledRoot; null !== root; @@ -1990,8 +2094,7 @@ __DEV__ && 0 !== (nextLanes & 3) && (mightHavePendingSyncWork = !0)); root = next; } - currentEventTransitionLane = 0; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); } function scheduleTaskForRootDuringMicrotask(root, currentTime) { var pendingLanes = root.pendingLanes, @@ -2032,45 +2135,74 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode$1) + ) + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode$1)) + : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && cancelCallback(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; + } + 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 && @@ -2109,8 +2241,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2430,6 +2562,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) @@ -3853,6 +3995,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; @@ -3909,10 +4059,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; } @@ -4031,7 +4187,11 @@ __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; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; JSCompiler_temp.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; JSCompiler_temp = value; @@ -4088,7 +4248,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; @@ -4113,10 +4273,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4406,10 +4570,14 @@ __DEV__ && if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -4687,17 +4855,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) { @@ -4851,10 +5018,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; } @@ -4865,10 +5036,14 @@ __DEV__ && if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -4957,14 +5132,26 @@ __DEV__ && 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$9) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$9 - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (currentUpdatePriority = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -5100,8 +5287,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, @@ -5123,35 +5319,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; - } + 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, @@ -5219,61 +5407,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); @@ -6052,6 +6185,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -6136,6 +6270,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -7469,9 +7604,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; @@ -7891,9 +8027,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, @@ -8350,7 +8487,11 @@ __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 }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -8534,12 +8675,13 @@ __DEV__ && 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) { @@ -9193,70 +9335,361 @@ __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 ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance - ); - } - function safelyAttachRef(current, 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") || + 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 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(current) + getComponentNameFromFiber(finishedWork) ), - (ref.current = instanceToUse); - } - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); + (ref.current = instanceToUse); + } + } + function safelyAttachRef(current, nearestMountedAncestor) { + try { + runWithFiberInDEV(current, commitAttachRef, current); + } catch (error$17) { + captureCommitPhaseError(current, nearestMountedAncestor, error$17); } } function safelyDetachRef(current, nearestMountedAncestor) { @@ -9267,13 +9700,13 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), refCleanup(); + startEffectTimer(), runWithFiberInDEV(current, refCleanup); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else refCleanup(); - } catch (error$12) { - captureCommitPhaseError(current, nearestMountedAncestor, error$12); + else runWithFiberInDEV(current, refCleanup); + } catch (error$18) { + captureCommitPhaseError(current, nearestMountedAncestor, error$18); } finally { (current.refCleanup = null), (current = current.alternate), @@ -9283,395 +9716,297 @@ __DEV__ && try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), runWithFiberInDEV(current, ref, null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } - else ref(null); - } catch (error$13) { - captureCommitPhaseError(current, nearestMountedAncestor, error$13); + else runWithFiberInDEV(current, ref, null); + } catch (error$19) { + captureCommitPhaseError(current, nearestMountedAncestor, error$19); } else ref.current = null; } - function commitBeforeMutationEffects(root, firstChild) { - focusedInstanceHandle = null; - for (nextEffect = firstChild; null !== nextEffect; ) { - root = nextEffect; - firstChild = root.deletions; - if (null !== firstChild) - for (var i = 0; i < firstChild.length; i++) - doesFiberContain(firstChild[i], focusedInstanceHandle) && - (shouldFireAfterActiveInstanceBlur = !0); - firstChild = root.child; - if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) - (firstChild.return = root), (nextEffect = firstChild); - else - for (; null !== nextEffect; ) { - root = nextEffect; - try { - runWithFiberInDEV(root, commitBeforeMutationEffectsOnFiber, root); - } catch (error$14) { - captureCommitPhaseError(root, root.return, error$14); - } - firstChild = root.sibling; - if (null !== firstChild) { - firstChild.return = root.return; - nextEffect = firstChild; - break; - } - nextEffect = root.return; - } - } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - focusedInstanceHandle = null; - return root; + 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 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 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 commitHookEffectListUnmount( - flags, + function commitProfilerPostCommit( finishedWork, - nearestMountedAncestor + current, + commitStartTime, + passiveEffectDuration ) { - 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), - 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 && - markComponentLayoutEffectUnmountStopped())); - } - effect = effect.next; - } while (effect !== updateQueue); + try { + runWithFiberInDEV( + finishedWork, + commitProfilerPostCommitImpl, + finishedWork, + current, + commitStartTime, + passiveEffectDuration + ); + } catch (error$21) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$21); } } - 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 - )); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (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()); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 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", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); + function 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 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 isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; } - function commitHookLayoutEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$15) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$15); + function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$16) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$16); + 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 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$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); + 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 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) { + function commitBeforeMutationEffects(root, firstChild) { + focusedInstanceHandle = null; + for (nextEffect = firstChild; null !== nextEffect; ) { + root = nextEffect; + firstChild = root.deletions; + if (null !== firstChild) + for (var i = 0; i < firstChild.length; i++) + doesFiberContain(firstChild[i], focusedInstanceHandle) && + (shouldFireAfterActiveInstanceBlur = !0); + firstChild = root.child; + if (0 !== (root.subtreeFlags & 9236) && null !== firstChild) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + 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: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + 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) { + firstChild.return = root.return; + nextEffect = firstChild; + break; } - parentFiber = parentFiber.return; + nextEffect = root.return; } - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } + } + root = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return root; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -9688,17 +10023,27 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )), shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), + 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 || @@ -9713,20 +10058,24 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -9734,71 +10083,83 @@ __DEV__ && 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$20) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$20 + 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( @@ -9806,11 +10167,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -9820,11 +10177,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -9995,98 +10348,40 @@ __DEV__ && pendingBoundaries ), 0 === pendingBoundaries.size && - (null === markerInstance.aborts && - addMarkerCompleteCallbackToPendingTransition( - markerName, - transitions - ), - (markerInstance.transitions = null), - (markerInstance.pendingBoundaries = null), - (markerInstance.aborts = null))) - : markerInstance.tag === TransitionRoot && - transitions.forEach(function (transition) { - addTransitionProgressCallbackToPendingTransition( - transition, - pendingBoundaries - ); - }))); - }); - } - } - function detachFiberAfterEffects(fiber) { - var alternate = fiber.alternate; - null !== alternate && - ((fiber.alternate = null), detachFiberAfterEffects(alternate)); - fiber.child = null; - fiber.deletions = null; - fiber.sibling = null; - fiber.stateNode = null; - fiber._debugOwner = null; - fiber.return = null; - fiber.dependencies = null; - fiber.memoizedProps = null; - fiber.memoizedState = null; - fiber.pendingProps = null; - fiber.stateNode = null; - fiber.updateQueue = null; - } - function isHostParent(fiber) { - return 5 === fiber.tag || 3 === fiber.tag || 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); + (null === markerInstance.aborts && + addMarkerCompleteCallbackToPendingTransition( + markerName, + transitions + ), + (markerInstance.transitions = null), + (markerInstance.pendingBoundaries = null), + (markerInstance.aborts = null))) + : markerInstance.tag === TransitionRoot && + transitions.forEach(function (transition) { + addTransitionProgressCallbackToPendingTransition( + transition, + pendingBoundaries + ); + }))); + }); + } } - 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 detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && + ((fiber.alternate = null), detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber._debugOwner = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; } function recursivelyTraverseDeletionEffects( finishedRoot, @@ -10137,16 +10432,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() @@ -10169,49 +10499,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), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - callDestroyInDEV( - 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, @@ -10332,74 +10632,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$23) { - captureCommitPhaseError(childToDelete, parentFiber, error$23); + 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) { @@ -10407,57 +10686,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$24) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$24 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$25) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$25 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - } + 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 && @@ -10475,25 +10720,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$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } + 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 && @@ -10503,31 +10765,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) { @@ -10542,11 +10832,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$30) { + } catch (error$32) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + error$32 ); } flags = finishedWork.updateQueue; @@ -10567,7 +10857,7 @@ __DEV__ && prevOffscreenSubtreeIsHidden || suspenseCallback; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || retryQueue; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; commitReconciliationEffects(finishedWork); @@ -10592,24 +10882,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$21) { + ? runWithFiberInDEV(retryQueue, hideInstance, instance) + : runWithFiberInDEV( + retryQueue, + unhideInstance, + retryQueue.stateNode, + retryQueue.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$21 + 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) && @@ -10639,7 +10956,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -10648,7 +10965,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -10657,7 +10974,7 @@ __DEV__ && flags & 4 && prepareScopeUpdate(); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -10665,43 +10982,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$31) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$31); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -10710,27 +10993,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) { @@ -10739,23 +11008,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: @@ -10813,28 +11070,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$32) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + 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); @@ -10848,17 +11109,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( @@ -10892,9 +11181,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -10902,22 +11189,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$33) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$33); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$34) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$34); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -10992,21 +11263,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, @@ -11015,9 +11271,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -11046,6 +11300,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11113,6 +11368,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( @@ -11129,9 +11411,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -11140,18 +11422,16 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11163,7 +11443,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -11207,9 +11487,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -11256,9 +11534,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, @@ -11268,11 +11546,9 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -11285,7 +11561,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -11325,70 +11601,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) @@ -11440,25 +11692,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)) { @@ -11475,11 +11708,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -11495,12 +11724,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; @@ -11523,7 +11764,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -11550,116 +11791,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); - else - a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - child = nextEffect; - var sibling = child.sibling, - returnFiber = child.return; - detachFiberAfterEffects(child); - if (child === fiber) { - nextEffect = null; - break a; - } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; - break a; + 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 + ); + } } - 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 - ) + 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( - offscreenFiber, - abortReason, - transitions, + current, instance, + offscreenFiber, + null, !0 ), - null !== nearestMountedAncestor && - abortParentMarkerTransitionsForDeletedFiber( - nearestMountedAncestor, - abortReason, - transitions, - instance, - !1 - ); + 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; ) { + current = nextEffect; + nearestMountedAncestor = current.sibling; + offscreenFiber = current.return; + detachFiberAfterEffects(current); + if (current === fiber) { + nextEffect = null; + break a; } - } - 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 - ))); + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = offscreenFiber; + nextEffect = nearestMountedAncestor; + break a; + } + nextEffect = offscreenFiber; + } } } function isConcurrentActEnvironment() { @@ -11775,7 +12007,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if ( @@ -11832,178 +12065,210 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + (enableSiblingPrerendering && checkIfRootIsPrerendering(root, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, + if (exitStatus === RootInProgress) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root, lanes, 0, !1); + break; + } else if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + 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, - 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) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + !1 + ); + if (renderWasConcurrent !== RootErrored) { + if (workInProgressRootDidAttachPingListener) { + exitStatus.errorRecoveryDisabledLanes |= + originallyAttemptedLanes; + workInProgressRootInterleavedUpdatedLanes |= + originallyAttemptedLanes; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = lanesThatJustErrored; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = renderWasConcurrent; } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - didTimeout + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) { + lanes = shouldTimeSlice; + forceSync = workInProgressRootRecoverableErrors; + shouldTimeSlice = workInProgressTransitions; + exitStatus = workInProgressRootDidIncludeRecursiveRenderUpdate; + renderWasConcurrent = workInProgressDeferredLane; + lanesThatJustErrored = workInProgressRootInterleavedUpdatedLanes; + originallyAttemptedLanes = workInProgressSuspendedRetryLanes; + var suspendedCommitReason = IMMEDIATE_COMMIT, + prevTransition = ReactSharedInternals.T, + previousUpdateLanePriority = currentUpdatePriority; + try { + (currentUpdatePriority = DiscreteEventPriority), + (ReactSharedInternals.T = null), + commitRootImpl( + lanes, + forceSync, + shouldTimeSlice, + exitStatus, + previousUpdateLanePriority, + renderWasConcurrent, + lanesThatJustErrored, + originallyAttemptedLanes, + suspendedCommitReason, + -0, + 0 + ); + } finally { + (ReactSharedInternals.T = prevTransition), + (currentUpdatePriority = previousUpdateLanePriority); + } + } else { + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + -0, + 0 + ), + exitStatus + ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + -0, + 0 + ); } } - break; - } while (1); - } + } + break; + } 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 @@ -12020,41 +12285,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$35) { - 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; ) { @@ -12070,7 +12356,9 @@ __DEV__ && 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 & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -12078,73 +12366,32 @@ __DEV__ && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didAttemptEntireTree + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didAttemptEntireTree[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() { @@ -12179,9 +12426,12 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -12213,20 +12463,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 & 4194176) === - workInProgressRootRenderLanes - ? null !== shellBoundary - : ((workInProgressRootRenderLanes & 62914560) !== - workInProgressRootRenderLanes && - 0 === (workInProgressRootRenderLanes & 536870912)) || - 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()), @@ -12240,16 +12498,16 @@ __DEV__ && ? 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)) { @@ -12259,7 +12517,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentErrored && injectedProfilingHooks.markComponentErrored( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12273,7 +12531,7 @@ __DEV__ && "function" === typeof injectedProfilingHooks.markComponentSuspended && injectedProfilingHooks.markComponentSuspended( - handler, + JSCompiler_temp, thrownValue, workInProgressRootRenderLanes ); @@ -12291,16 +12549,22 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } - function renderRootSync(root, lanes) { + function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(), @@ -12322,34 +12586,49 @@ __DEV__ && enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = RootInProgress; + break a; + } + break; default: - (workInProgressSuspendedReason = NotSuspended), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$36) { - handleThrow(root, thrownValue$36); + } catch (thrownValue$34) { + handleThrow(root, thrownValue$34); } while (1); lanes && root.shellSuspendCounter++; @@ -12357,16 +12636,13 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -12390,7 +12666,11 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering( + root, + lanes + ); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -12407,7 +12687,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -12439,7 +12724,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -12471,12 +12761,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(); @@ -12491,8 +12791,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$37) { - handleThrow(root, thrownValue$37); + } catch (thrownValue$35) { + handleThrow(root, thrownValue$35); } while (1); resetContextDependencies(); @@ -12530,7 +12830,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -12538,7 +12838,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -12546,7 +12846,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -12605,10 +12905,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; @@ -12632,9 +12937,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$38) { + } catch (error$36) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$38); + throw ((workInProgress = returnFiber), error$36); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -12643,62 +12948,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; @@ -12713,31 +13008,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, @@ -12745,7 +13046,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -12758,7 +13061,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;" @@ -12789,7 +13092,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), @@ -12801,48 +13111,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), @@ -12880,7 +13190,7 @@ __DEV__ && ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); return null; @@ -12902,7 +13212,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -12918,7 +13228,7 @@ __DEV__ && return ( (currentUpdatePriority = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -12928,15 +13238,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; @@ -12952,7 +13253,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;" @@ -12965,12 +13266,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 && @@ -12980,7 +13277,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -13018,9 +13315,9 @@ __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) { @@ -13101,6 +13398,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -13121,7 +13419,9 @@ __DEV__ && 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) { @@ -13229,12 +13529,15 @@ __DEV__ && var shouldDoubleInvokePassiveEffects = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !0; setIsStrictModeForDevtools(!0); - disappearLayoutEffects(fiber); - shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber); - reappearLayoutEffects(root, fiber.alternate, fiber, !1); - shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); - setIsStrictModeForDevtools(!1); + try { + disappearLayoutEffects(fiber), + shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), + reappearLayoutEffects(root, fiber.alternate, fiber, !1), + shouldDoubleInvokePassiveEffects && + reconnectPassiveEffects(root, fiber, 0, null, !1); + } finally { + setIsStrictModeForDevtools(!1); + } } function commitDoubleInvokeEffectsInDEV(root) { var doubleInvokeEffects = !0; @@ -13435,9 +13738,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; @@ -13473,10 +13776,10 @@ __DEV__ && key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, _debugInfo: null, _debugOwner: null, _debugNeedsRemount: !1, @@ -13512,8 +13815,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; @@ -13527,7 +13830,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -13580,7 +13884,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -13861,6 +14166,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -13885,7 +14191,7 @@ __DEV__ && tag++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); @@ -13978,17 +14284,21 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, @@ -14126,6 +14436,12 @@ __DEV__ && 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, @@ -15660,14 +15976,7 @@ __DEV__ && updateHookTypesDev(); return unstable_useContextWithBailout(context, select); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); @@ -15760,7 +16069,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -15932,6 +16241,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -15939,6 +16250,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -15954,7 +16266,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -15966,6 +16277,8 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16189,11 +16502,11 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-0ad0fac1-20240814", + version: "19.0.0-www-modern-28668d39-20241023", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-modern-28668d39-20241023" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16227,7 +16540,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; + exports.version = "19.0.0-www-modern-28668d39-20241023"; "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 09a1c5861f84e..f3876cb204f3c 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -67,17 +67,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, @@ -266,62 +270,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -585,31 +591,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -653,11 +681,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -674,39 +697,54 @@ 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$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(remainingLanes), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -721,21 +759,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - index$9 = root.transitionLanes[index$9]; - null !== index$9 && - index$9.forEach(function (transition) { + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + index$10 = root.transitionLanes[index$10]; + null !== index$10 && + index$10.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -745,10 +783,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - null !== root.transitionLanes[index$10] && - (root.transitionLanes[index$10] = null); + var index$11 = 31 - clz32(lanes), + lane = 1 << index$11; + null !== root.transitionLanes[index$11] && + (root.transitionLanes[index$11] = null); lanes &= ~lane; } } @@ -1172,22 +1210,43 @@ 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$12 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$12 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$12 : 0 - ); - 0 !== (workInProgressRootRenderLanes$12 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$12)); - } + 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) || + checkIfRootIsPrerendering(root, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); root = root.next; } } while (didPerformSomeWork); @@ -1196,6 +1255,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now(), prev = null, root = firstScheduledRoot; null !== root; @@ -1211,8 +1271,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, @@ -1226,12 +1285,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$4 = 31 - clz32(pendingLanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(pendingLanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1254,39 +1313,62 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; + } + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 && @@ -1316,8 +1398,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -1476,20 +1558,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$14 = workInProgress$jscomp$0.alternate; - null !== current$14 && - ((current$14 = current$14.updateQueue), - (pendingQueue = current$14.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$14.firstBaseUpdate = firstPendingUpdate) + ? (current$16.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$14.lastBaseUpdate = lastPendingUpdate))); + (current$16.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$14 = firstPendingUpdate = lastPendingUpdate = null; + current$16 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1502,8 +1584,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$14 && - (current$14 = current$14.next = + null !== current$16 && + (current$16 = current$16.next = { lane: 0, tag: pendingQueue.tag, @@ -1556,10 +1638,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$14 - ? ((firstPendingUpdate = current$14 = isHiddenUpdate), + null === current$16 + ? ((firstPendingUpdate = current$16 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$14 = current$14.next = isHiddenUpdate), + : (current$16 = current$16.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1572,10 +1654,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$14 && (lastPendingUpdate = newState); + null === current$16 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$14; + queue.lastBaseUpdate = current$16; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -2447,9 +2529,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$43 = fiber.alternate; - null !== current$43 && - null !== current$43.memoizedState && + var current$45 = fiber.alternate; + null !== current$45 && + null !== current$45.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2562,9 +2644,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; } @@ -2709,16 +2797,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$45 = currentlyRenderingFiber$1.alternate; - null !== current$45 && - ((current$45 = current$45.updateQueue), - null !== current$45 && - ((current$45 = current$45.memoCache), - null != current$45 && + 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$45.data - : current$45.data.map(function (array) { + ? current$47.data + : current$47.data.map(function (array) { return array.slice(); }), index: 0 @@ -2733,11 +2821,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$45 = 0; - current$45 < size; - current$45++ + current$47 = 0; + current$47 < size; + current$47++ ) - updateQueue[current$45] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$47] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2770,7 +2858,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$46 = !1; + didReadFromEntangledAsyncAction$48 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2791,11 +2879,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$46 = !0); + (didReadFromEntangledAsyncAction$48 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$46 = !0); + (didReadFromEntangledAsyncAction$48 = !0); continue; } else (updateLane = { @@ -2841,7 +2929,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$46 && + didReadFromEntangledAsyncAction$48 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2947,10 +3035,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -3028,8 +3120,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$50) { - onActionError(actionQueue, node, error$50); + } catch (error$52) { + onActionError(actionQueue, node, error$52); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3172,17 +3264,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() { @@ -3281,10 +3372,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -3346,14 +3441,26 @@ 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); @@ -3408,15 +3515,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; @@ -3430,19 +3540,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 = { @@ -3548,10 +3663,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -3559,10 +3678,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -3951,9 +4074,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$52 in Component) - void 0 === newProps[propName$52] && - (newProps[propName$52] = Component[propName$52]); + for (var propName$54 in Component) + void 0 === newProps[propName$54] && + (newProps[propName$54] = Component[propName$54]); } return newProps; } @@ -4596,6 +4719,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 && @@ -4652,6 +4776,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4901,7 +5026,7 @@ function finishClassComponent( ) ); shouldUpdate = workInProgress.stateNode; - current = workInProgress; + disableStringRefs || (current = workInProgress); var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null @@ -6450,12 +6575,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) { @@ -6471,14 +6597,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$99 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$99 = lastTailNode), + for (var lastTailNode$101 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$101 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$99 + null === lastTailNode$101 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$99.sibling = null); + : (lastTailNode$101.sibling = null); } } function bubbleProperties(completedWork) { @@ -6488,19 +6614,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$100 = completedWork.child; null !== child$100; ) - (newChildLanes |= child$100.lanes | child$100.childLanes), - (subtreeFlags |= child$100.subtreeFlags & 31457280), - (subtreeFlags |= child$100.flags & 31457280), - (child$100.return = completedWork), - (child$100 = child$100.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$100 = completedWork.child; null !== child$100; ) - (newChildLanes |= child$100.lanes | child$100.childLanes), - (subtreeFlags |= child$100.subtreeFlags), - (subtreeFlags |= child$100.flags), - (child$100.return = completedWork), - (child$100 = child$100.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; @@ -6679,11 +6805,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$104 = null; + var cache$106 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$104 = newProps.memoizedState.cachePool.pool); - cache$104 !== instance && (newProps.flags |= 2048); + (cache$106 = newProps.memoizedState.cachePool.pool); + cache$106 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6716,8 +6842,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$104 = instance.rendering; - if (null === cache$104) + cache$106 = instance.rendering; + if (null === cache$106) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6725,11 +6851,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$104 = findFirstSuspended(current); - if (null !== cache$104) { + cache$106 = findFirstSuspended(current); + if (null !== cache$106) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$104.updateQueue; + current = cache$106.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6754,7 +6880,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$104)), null !== current)) { + if (((current = findFirstSuspended(cache$106)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6764,7 +6890,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$104.alternate) + !cache$106.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6776,13 +6902,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$104.sibling = workInProgress.child), - (workInProgress.child = cache$104)) + ? ((cache$106.sibling = workInProgress.child), + (workInProgress.child = cache$106)) : ((current = instance.last), null !== current - ? (current.sibling = cache$104) - : (workInProgress.child = cache$104), - (instance.last = cache$104)); + ? (current.sibling = cache$106) + : (workInProgress.child = cache$106), + (instance.last = cache$106)); } if (null !== instance.tail) return ( @@ -7003,10 +7129,76 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; +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, @@ -7064,19 +7256,91 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$122) { - captureCommitPhaseError(current, nearestMountedAncestor, error$122); + } 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; @@ -7093,81 +7357,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; - } - } - 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; + 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 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); + 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 !== (i & 1024)) throw Error(formatProdErrorMessage(163)); } firstChild = root.sibling; if (null !== firstChild) { @@ -7178,65 +7446,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 destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -7245,7 +7458,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); @@ -7269,11 +7482,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$123) { + } catch (error$124) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$123 + error$124 ); } } @@ -7546,60 +7759,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( @@ -7637,21 +7796,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( @@ -7659,43 +7843,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, @@ -7705,12 +7864,12 @@ function commitDeletionEffectsOnFiber( case 1: offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount && + (child = deletedFiber.stateNode), + "function" === typeof child.componentWillUnmount && safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - prevHostParent + child )); recursivelyTraverseDeletionEffects( finishedRoot, @@ -7730,14 +7889,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, @@ -7804,39 +7963,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; ) @@ -7853,19 +8008,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$131) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$131); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -7873,15 +8019,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: @@ -7891,13 +8041,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$134) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$134); + var instance = finishedWork.stateNode; + instance._applyProps(instance, flags, existingHiddenCallbacks); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -7915,15 +8067,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) { @@ -7933,8 +8094,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$136) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$136); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -7946,17 +8107,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; @@ -7965,13 +8126,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))), @@ -7981,19 +8142,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 ); } @@ -8022,10 +8183,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); @@ -8157,7 +8321,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -8165,23 +8329,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 && @@ -8231,13 +8402,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 && @@ -8341,7 +8505,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -8404,6 +8568,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, @@ -8518,7 +8703,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -8537,9 +8722,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$146 = finishedWork.stateNode; + var instance$140 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$146._visibility & 4 + ? instance$140._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8552,7 +8737,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$146._visibility |= 4), + : ((instance$140._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8560,7 +8745,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$146._visibility |= 4), + : ((instance$140._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8573,7 +8758,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$146 + instance$140 ); break; case 24: @@ -8667,12 +8852,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$151 = fiber.alternate; - null !== current$151 && null !== current$151.memoizedState - ? ((current$151 = suspenseyCommitFlag), + var current$145 = fiber.alternate; + null !== current$145 && null !== current$145.memoizedState + ? ((current$145 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$151)) + (suspenseyCommitFlag = current$145)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8722,6 +8907,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 && @@ -8870,25 +9061,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, @@ -8896,6 +9090,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -9004,7 +9199,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -9017,11 +9213,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing) ) { var transitionLanesMap = root.transitionLanes, - index$8 = 31 - clz32(lane), - transitions = transitionLanesMap[index$8]; + index$9 = 31 - clz32(lane), + transitions = transitionLanesMap[index$9]; null === transitions && (transitions = new Set()); transitions.add(transition); - transitionLanesMap[index$8] = transitions; + transitionLanesMap[index$9] = transitions; } } root === workInProgressRoot && @@ -9031,7 +9227,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); 2 !== lane || @@ -9039,158 +9236,172 @@ 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if ((disableLegacyMode || 0 !== root$jscomp$0.tag) && 2 === exitStatus) { + renderWasConcurrent = lanes; + 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, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if (workInProgressRootDidAttachPingListener) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent + ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + 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; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -9207,41 +9418,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; ) { @@ -9257,77 +9488,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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didAttemptEntireTree[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() { @@ -9362,8 +9555,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -9380,9 +9576,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -9392,23 +9588,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()), @@ -9441,16 +9645,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -9459,6 +9669,7 @@ function renderRootSync(root, lanes) { (workInProgressTransitions = getTransitionsForLanes(root, lanes)), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9467,23 +9678,37 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + exitStatus = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$157) { - handleThrow(root, thrownValue$157); + } catch (thrownValue$156) { + handleThrow(root, thrownValue$156); } while (1); lanes && root.shellSuspendCounter++; @@ -9491,11 +9716,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -9505,10 +9730,14 @@ 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 = checkIfRootIsPrerendering( + root, + lanes + )); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9518,7 +9747,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; @@ -9549,7 +9778,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; @@ -9575,12 +9804,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(); @@ -9592,8 +9821,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$159) { - handleThrow(root, thrownValue$159); + } catch (thrownValue$158) { + handleThrow(root, thrownValue$158); } while (1); resetContextDependencies(); @@ -9612,7 +9841,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); } @@ -9665,11 +9894,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; @@ -9703,31 +9937,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, @@ -9747,31 +9990,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, @@ -9779,7 +10019,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -9795,7 +10037,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), @@ -9807,26 +10056,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), @@ -9857,7 +10106,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); return null; } function releaseRootPooledCache(root, remainingLanes) { @@ -9866,7 +10115,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; @@ -9878,7 +10127,7 @@ function flushPassiveEffects() { return ( (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -9902,7 +10151,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, @@ -9991,6 +10240,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) @@ -10004,7 +10254,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) { @@ -10406,6 +10658,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -10616,27 +10869,27 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1361 = { +var internals$jscomp$inline_1474 = { bundleType: 0, - version: "19.0.0-www-classic-0ad0fac1-20240814", + version: "19.0.0-www-classic-28668d39-20241023", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function () { return null; }, - reconcilerVersion: "19.0.0-www-classic-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-classic-28668d39-20241023" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1362 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1475 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1362.isDisabled && - hook$jscomp$inline_1362.supportsFiber + !hook$jscomp$inline_1475.isDisabled && + hook$jscomp$inline_1475.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1362.inject( - internals$jscomp$inline_1361 + (rendererID = hook$jscomp$inline_1475.inject( + internals$jscomp$inline_1474 )), - (injectedHook = hook$jscomp$inline_1362); + (injectedHook = hook$jscomp$inline_1475); } catch (err) {} } var Path = Mode$1.Path; @@ -10650,4 +10903,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; +exports.version = "19.0.0-www-classic-28668d39-20241023"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 168bd9e2d873e..0ce92e71284f9 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -65,17 +65,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, retryLaneExpirationMs = dynamicFeatureFlags.retryLaneExpirationMs, @@ -197,62 +201,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -502,31 +508,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -570,11 +598,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -591,39 +614,54 @@ 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$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$7 = 31 - clz32(remainingLanes), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$7] = null, index$7 = 0; + index$7 < hiddenUpdatesForLane.length; + index$7++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$7]; null !== update && (update.lane &= -536870913); } - noLongerPendingLanes &= ~lane; + 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; @@ -638,21 +676,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + (lane & entangledLanes) | (root[index$8] & entangledLanes) && + (root[index$8] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - index$9 = root.transitionLanes[index$9]; - null !== index$9 && - index$9.forEach(function (transition) { + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + index$10 = root.transitionLanes[index$10]; + null !== index$10 && + index$10.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -662,10 +700,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - null !== root.transitionLanes[index$10] && - (root.transitionLanes[index$10] = null); + var index$11 = 31 - clz32(lanes), + lane = 1 << index$11; + null !== root.transitionLanes[index$11] && + (root.transitionLanes[index$11] = null); lanes &= ~lane; } } @@ -1011,22 +1049,43 @@ 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$12 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$12 = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes$12 : 0 - ); - 0 !== (workInProgressRootRenderLanes$12 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root, workInProgressRootRenderLanes$12)); - } + 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) || + checkIfRootIsPrerendering(root, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, JSCompiler_inline_result)); root = root.next; } } while (didPerformSomeWork); @@ -1035,6 +1094,7 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( var currentTime = now(), prev = null, root = firstScheduledRoot; null !== root; @@ -1050,8 +1110,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, @@ -1065,12 +1124,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$4 = 31 - clz32(pendingLanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$5 = 31 - clz32(pendingLanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$5] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1093,39 +1152,62 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; + } + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 && @@ -1155,8 +1237,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -1315,20 +1397,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$14 = workInProgress$jscomp$0.alternate; - null !== current$14 && - ((current$14 = current$14.updateQueue), - (pendingQueue = current$14.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$14.firstBaseUpdate = firstPendingUpdate) + ? (current$16.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$14.lastBaseUpdate = lastPendingUpdate))); + (current$16.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$14 = firstPendingUpdate = lastPendingUpdate = null; + current$16 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -1341,8 +1423,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$14 && - (current$14 = current$14.next = + null !== current$16 && + (current$16 = current$16.next = { lane: 0, tag: pendingQueue.tag, @@ -1395,10 +1477,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$14 - ? ((firstPendingUpdate = current$14 = isHiddenUpdate), + null === current$16 + ? ((firstPendingUpdate = current$16 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$14 = current$14.next = isHiddenUpdate), + : (current$16 = current$16.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -1411,10 +1493,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$14 && (lastPendingUpdate = newState); + null === current$16 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$14; + queue.lastBaseUpdate = current$16; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -2278,9 +2360,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$43 = fiber.alternate; - null !== current$43 && - null !== current$43.memoizedState && + var current$45 = fiber.alternate; + null !== current$45 && + null !== current$45.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -2393,9 +2475,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; } @@ -2540,16 +2628,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$45 = currentlyRenderingFiber$1.alternate; - null !== current$45 && - ((current$45 = current$45.updateQueue), - null !== current$45 && - ((current$45 = current$45.memoCache), - null != current$45 && + 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$45.data - : current$45.data.map(function (array) { + ? current$47.data + : current$47.data.map(function (array) { return array.slice(); }), index: 0 @@ -2564,11 +2652,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$45 = 0; - current$45 < size; - current$45++ + current$47 = 0; + current$47 < size; + current$47++ ) - updateQueue[current$45] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$47] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -2601,7 +2689,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$46 = !1; + didReadFromEntangledAsyncAction$48 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -2622,11 +2710,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$46 = !0); + (didReadFromEntangledAsyncAction$48 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$46 = !0); + (didReadFromEntangledAsyncAction$48 = !0); continue; } else (updateLane = { @@ -2672,7 +2760,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$46 && + didReadFromEntangledAsyncAction$48 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -2778,10 +2866,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -2859,8 +2951,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$50) { - onActionError(actionQueue, node, error$50); + } catch (error$52) { + onActionError(actionQueue, node, error$52); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3003,17 +3095,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() { @@ -3112,10 +3203,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -3177,14 +3272,26 @@ 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); @@ -3239,15 +3346,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; @@ -3261,19 +3371,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 = { @@ -3379,10 +3494,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -3390,10 +3509,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -3736,9 +3859,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$52 in Component) - void 0 === newProps[propName$52] && - (newProps[propName$52] = Component[propName$52]); + for (var propName$54 in Component) + void 0 === newProps[propName$54] && + (newProps[propName$54] = Component[propName$54]); } return newProps; } @@ -4335,6 +4458,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 && @@ -4385,6 +4509,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -4642,7 +4767,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 @@ -6083,12 +6208,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) { @@ -6104,14 +6230,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$91 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$91 = lastTailNode), + for (var lastTailNode$93 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$93 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$91 + null === lastTailNode$93 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$91.sibling = null); + : (lastTailNode$93.sibling = null); } } function bubbleProperties(completedWork) { @@ -6121,19 +6247,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$92 = completedWork.child; null !== child$92; ) - (newChildLanes |= child$92.lanes | child$92.childLanes), - (subtreeFlags |= child$92.subtreeFlags & 31457280), - (subtreeFlags |= child$92.flags & 31457280), - (child$92.return = completedWork), - (child$92 = child$92.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$92 = completedWork.child; null !== child$92; ) - (newChildLanes |= child$92.lanes | child$92.childLanes), - (subtreeFlags |= child$92.subtreeFlags), - (subtreeFlags |= child$92.flags), - (child$92.return = completedWork), - (child$92 = child$92.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; @@ -6304,11 +6430,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (instance = newProps.alternate.memoizedState.cachePool.pool); - var cache$96 = null; + var cache$98 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$96 = newProps.memoizedState.cachePool.pool); - cache$96 !== instance && (newProps.flags |= 2048); + (cache$98 = newProps.memoizedState.cachePool.pool); + cache$98 !== instance && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -6336,8 +6462,8 @@ function completeWork(current, workInProgress, renderLanes) { instance = workInProgress.memoizedState; if (null === instance) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$96 = instance.rendering; - if (null === cache$96) + cache$98 = instance.rendering; + if (null === cache$98) if (newProps) cutOffTailIfNeeded(instance, !1); else { if ( @@ -6345,11 +6471,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$96 = findFirstSuspended(current); - if (null !== cache$96) { + cache$98 = findFirstSuspended(current); + if (null !== cache$98) { workInProgress.flags |= 128; cutOffTailIfNeeded(instance, !1); - current = cache$96.updateQueue; + current = cache$98.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -6374,7 +6500,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$96)), null !== current)) { + if (((current = findFirstSuspended(cache$98)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -6384,7 +6510,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !0), null === instance.tail && "hidden" === instance.tailMode && - !cache$96.alternate) + !cache$98.alternate) ) return bubbleProperties(workInProgress), null; } else @@ -6396,13 +6522,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(instance, !1), (workInProgress.lanes = 4194304)); instance.isBackwards - ? ((cache$96.sibling = workInProgress.child), - (workInProgress.child = cache$96)) + ? ((cache$98.sibling = workInProgress.child), + (workInProgress.child = cache$98)) : ((current = instance.last), null !== current - ? (current.sibling = cache$96) - : (workInProgress.child = cache$96), - (instance.last = cache$96)); + ? (current.sibling = cache$98) + : (workInProgress.child = cache$98), + (instance.last = cache$98)); } if (null !== instance.tail) return ( @@ -6612,10 +6738,76 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; +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, @@ -6673,19 +6865,91 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$113) { - captureCommitPhaseError(current, nearestMountedAncestor, error$113); + } 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); + } +} +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; @@ -6702,81 +6966,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; - } - } - 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; + 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 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); + 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 !== (i & 1024)) throw Error(formatProdErrorMessage(163)); } firstChild = root.sibling; if (null !== firstChild) { @@ -6787,65 +7055,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 destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -6854,7 +7067,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); @@ -6878,11 +7091,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$114) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$115 ); } } @@ -7150,60 +7363,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( @@ -7241,21 +7400,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( @@ -7263,43 +7447,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, @@ -7309,12 +7468,12 @@ function commitDeletionEffectsOnFiber( case 1: offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), - (prevHostParent = deletedFiber.stateNode), - "function" === typeof prevHostParent.componentWillUnmount && + (child = deletedFiber.stateNode), + "function" === typeof child.componentWillUnmount && safelyCallComponentWillUnmount( deletedFiber, nearestMountedAncestor, - prevHostParent + child )); recursivelyTraverseDeletionEffects( finishedRoot, @@ -7333,14 +7492,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( @@ -7402,39 +7561,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; ) @@ -7451,19 +7606,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$122) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$122); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -7471,15 +7617,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: @@ -7489,13 +7639,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$125) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$125); + var instance = finishedWork.stateNode; + instance._applyProps(instance, flags, existingHiddenCallbacks); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -7513,15 +7665,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) { @@ -7531,8 +7692,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$127) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$127); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -7544,16 +7705,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; @@ -7561,13 +7722,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 || @@ -7576,19 +7737,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 ); } @@ -7617,10 +7778,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); @@ -7752,7 +7916,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -7760,23 +7924,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 && @@ -7826,13 +7997,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 && @@ -7936,7 +8100,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -7999,6 +8163,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, @@ -8102,7 +8287,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -8121,9 +8306,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$137 = finishedWork.stateNode; + var instance$131 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$137._visibility & 4 + ? instance$131._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8135,7 +8320,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$137._visibility |= 4), + : ((instance$131._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -8148,7 +8333,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$137 + instance$131 ); break; case 24: @@ -8242,12 +8427,12 @@ function accumulateSuspenseyCommitOnFiber(fiber) { break; case 22: if (null === fiber.memoizedState) { - var current$142 = fiber.alternate; - null !== current$142 && null !== current$142.memoizedState - ? ((current$142 = suspenseyCommitFlag), + var current$136 = fiber.alternate; + null !== current$136 && null !== current$136.memoizedState + ? ((current$136 = suspenseyCommitFlag), (suspenseyCommitFlag = 16777216), recursivelyAccumulateSuspenseyCommit(fiber), - (suspenseyCommitFlag = current$142)) + (suspenseyCommitFlag = current$136)) : recursivelyAccumulateSuspenseyCommit(fiber); } break; @@ -8297,6 +8482,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 && @@ -8445,25 +8636,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, @@ -8471,6 +8665,7 @@ var DefaultAsyncDispatcher = { workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -8577,7 +8772,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -8590,11 +8786,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$8 = 31 - clz32(lane), - transitions = transitionLanesMap[index$8]; + index$9 = 31 - clz32(lane), + transitions = transitionLanesMap[index$9]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$8] = transitions; + transitionLanesMap[index$9] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -8603,160 +8799,175 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + 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, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if (workInProgressRootDidAttachPingListener) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + 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; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -8773,41 +8984,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; ) { @@ -8823,77 +9054,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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6; + didAttemptEntireTree[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() { @@ -8928,8 +9121,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -8946,9 +9142,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$4 = 31 - clz32(allEntangledLanes), + lane = 1 << index$4; + lanes |= root[index$4]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -8958,23 +9154,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()), @@ -9007,16 +9211,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -9025,6 +9235,7 @@ function renderRootSync(root, lanes) { (workInProgressTransitions = getTransitionsForLanes(root, lanes)), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9033,23 +9244,37 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + exitStatus = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$148) { - handleThrow(root, thrownValue$148); + } catch (thrownValue$147) { + handleThrow(root, thrownValue$147); } while (1); lanes && root.shellSuspendCounter++; @@ -9057,11 +9282,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -9071,10 +9296,14 @@ 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 = checkIfRootIsPrerendering( + root, + lanes + )); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -9084,7 +9313,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; @@ -9115,7 +9344,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; @@ -9141,12 +9370,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(); @@ -9158,8 +9387,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$150) { - handleThrow(root, thrownValue$150); + } catch (thrownValue$149) { + handleThrow(root, thrownValue$149); } while (1); resetContextDependencies(); @@ -9178,7 +9407,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); } @@ -9227,11 +9456,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; @@ -9265,31 +9499,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, @@ -9309,31 +9552,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, @@ -9341,7 +9581,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -9357,7 +9599,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), @@ -9369,26 +9618,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), @@ -9417,7 +9666,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); return null; } function releaseRootPooledCache(root, remainingLanes) { @@ -9426,7 +9675,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; @@ -9438,7 +9687,7 @@ function flushPassiveEffects() { return ( (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (currentUpdatePriority = previousPriority), @@ -9462,7 +9711,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, @@ -9551,6 +9800,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) @@ -9564,7 +9814,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) { @@ -9961,6 +10213,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -10130,27 +10383,27 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1353 = { +var internals$jscomp$inline_1467 = { bundleType: 0, - version: "19.0.0-www-modern-0ad0fac1-20240814", + version: "19.0.0-www-modern-28668d39-20241023", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: function () { return null; }, - reconcilerVersion: "19.0.0-www-modern-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-modern-28668d39-20241023" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1354 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1468 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1354.isDisabled && - hook$jscomp$inline_1354.supportsFiber + !hook$jscomp$inline_1468.isDisabled && + hook$jscomp$inline_1468.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1354.inject( - internals$jscomp$inline_1353 + (rendererID = hook$jscomp$inline_1468.inject( + internals$jscomp$inline_1467 )), - (injectedHook = hook$jscomp$inline_1354); + (injectedHook = hook$jscomp$inline_1468); } catch (err) {} } var Path = Mode$1.Path; @@ -10164,4 +10417,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; +exports.version = "19.0.0-www-modern-28668d39-20241023"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 6acf4d732dac7..99dd875401b4b 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -378,64 +378,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -444,54 +444,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -502,7 +506,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -840,20 +844,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 && @@ -956,31 +946,53 @@ __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 || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1029,14 +1041,6 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1053,25 +1057,34 @@ __DEV__ && 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) @@ -1083,9 +1096,15 @@ __DEV__ && var update = hiddenUpdatesForLane[index]; 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; @@ -3360,7 +3379,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, @@ -3369,7 +3388,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, @@ -3378,7 +3397,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, @@ -3391,7 +3410,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;" @@ -3400,7 +3419,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -3801,6 +3820,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 && @@ -3822,28 +3889,42 @@ __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 & 3) && - ((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) || + checkIfRootIsPrerendering(root, nextLanes) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -3855,33 +3936,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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -3922,45 +3999,74 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode$1) + ) + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode$1)) + : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; + } + null !== pingedLanes && cancelCallback(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; + } + 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 && @@ -4003,8 +4109,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -4324,6 +4430,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) @@ -5765,6 +5881,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; @@ -5822,10 +5946,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; } @@ -5949,7 +6079,11 @@ __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; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; JSCompiler_temp.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; JSCompiler_temp = value; @@ -6006,7 +6140,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; @@ -6031,10 +6165,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -6350,10 +6488,14 @@ __DEV__ && if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -6679,17 +6821,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) { @@ -6845,10 +6986,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; } @@ -6859,10 +7004,14 @@ __DEV__ && if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -6951,14 +7100,26 @@ __DEV__ && 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$9) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$9 - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -7032,7 +7193,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); @@ -7168,8 +7334,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, @@ -7191,35 +7366,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; - } + 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, @@ -7287,61 +7454,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$1(callback) { if (null !== callback && "function" !== typeof callback) { var key = String(callback); @@ -8628,6 +8740,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -8720,6 +8833,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -9136,32 +9250,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2421; - var JSCompiler_object_inline_stack_2422 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2429; + var JSCompiler_object_inline_stack_2430 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2423 = !1; + var JSCompiler_object_inline_componentStack_2431 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2421 = didSuspend) || - (JSCompiler_object_inline_digest_2421 = + (JSCompiler_object_inline_digest_2429 = didSuspend) || + (JSCompiler_object_inline_digest_2429 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2421 && - ((JSCompiler_object_inline_componentStack_2423 = !0), + JSCompiler_object_inline_digest_2429 && + ((JSCompiler_object_inline_componentStack_2431 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2421 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2429 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2423 + JSCompiler_object_inline_componentStack_2431 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2420 = nextHydratableInstance; + var JSCompiler_object_inline_message_2428 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2420)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2428)) { c: { - var instance = JSCompiler_object_inline_message_2420; + var instance = JSCompiler_object_inline_message_2428; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9202,19 +9316,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2420 + JSCompiler_object_inline_message_2428 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2420 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2428 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2420 && - ((JSCompiler_object_inline_message_2420 = - JSCompiler_object_inline_message_2420.dehydrated), - null !== JSCompiler_object_inline_message_2420) + null !== JSCompiler_object_inline_message_2428 && + ((JSCompiler_object_inline_message_2428 = + JSCompiler_object_inline_message_2428.dehydrated), + null !== JSCompiler_object_inline_message_2428) ) return ( - JSCompiler_object_inline_message_2420.data === + JSCompiler_object_inline_message_2428.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -9222,27 +9336,27 @@ __DEV__ && ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2420 = - JSCompiler_object_inline_stack_2422.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2422.fallback; - if (JSCompiler_object_inline_componentStack_2423) + JSCompiler_object_inline_message_2428 = + JSCompiler_object_inline_stack_2430.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2430.fallback; + if (JSCompiler_object_inline_componentStack_2431) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2422 = + (JSCompiler_object_inline_stack_2430 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_message_2428, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2423 = + (JSCompiler_object_inline_componentStack_2431 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2423.memoizedState = + (JSCompiler_object_inline_componentStack_2431.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2423.childLanes = + (JSCompiler_object_inline_componentStack_2431.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9255,9 +9369,9 @@ __DEV__ && ? markerInstanceStack.current : null), (current = - JSCompiler_object_inline_componentStack_2423.updateQueue), + JSCompiler_object_inline_componentStack_2431.updateQueue), null === current - ? (JSCompiler_object_inline_componentStack_2423.updateQueue = + ? (JSCompiler_object_inline_componentStack_2431.updateQueue = { transitions: workInProgress, markerInstances: renderLanes, @@ -9265,46 +9379,46 @@ __DEV__ && }) : ((current.transitions = workInProgress), (current.markerInstances = renderLanes)))), - JSCompiler_object_inline_stack_2422 + JSCompiler_object_inline_stack_2430 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2422.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2430.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2422 = + (JSCompiler_object_inline_stack_2430 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_message_2428, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2423 = + (JSCompiler_object_inline_componentStack_2431 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2423.memoizedState = + (JSCompiler_object_inline_componentStack_2431.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2423.childLanes = + (JSCompiler_object_inline_componentStack_2431.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2422 + JSCompiler_object_inline_stack_2430 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2420 + JSCompiler_object_inline_message_2428 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2420 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2420) + ((JSCompiler_object_inline_message_2428 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2428) ) { if (didSuspend) workInProgress.flags & 256 @@ -9321,32 +9435,32 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2423 = - JSCompiler_object_inline_stack_2422.fallback), - (JSCompiler_object_inline_message_2420 = workInProgress.mode), - (JSCompiler_object_inline_stack_2422 = createFiberFromOffscreen( + (JSCompiler_object_inline_componentStack_2431 = + JSCompiler_object_inline_stack_2430.fallback), + (JSCompiler_object_inline_message_2428 = workInProgress.mode), + (JSCompiler_object_inline_stack_2430 = createFiberFromOffscreen( { mode: "visible", - children: JSCompiler_object_inline_stack_2422.children + children: JSCompiler_object_inline_stack_2430.children }, - JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_message_2428, 0, null )), - (JSCompiler_object_inline_componentStack_2423 = + (JSCompiler_object_inline_componentStack_2431 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2423, - JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_componentStack_2431, + JSCompiler_object_inline_message_2428, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2423.flags |= 2), - (JSCompiler_object_inline_stack_2422.return = workInProgress), - (JSCompiler_object_inline_componentStack_2423.return = + (JSCompiler_object_inline_componentStack_2431.flags |= 2), + (JSCompiler_object_inline_stack_2430.return = workInProgress), + (JSCompiler_object_inline_componentStack_2431.return = workInProgress), - (JSCompiler_object_inline_stack_2422.sibling = - JSCompiler_object_inline_componentStack_2423), - (workInProgress.child = JSCompiler_object_inline_stack_2422), + (JSCompiler_object_inline_stack_2430.sibling = + JSCompiler_object_inline_componentStack_2431), + (workInProgress.child = JSCompiler_object_inline_stack_2430), (disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode) && reconcileChildFibers( @@ -9355,63 +9469,63 @@ __DEV__ && null, renderLanes ), - (JSCompiler_object_inline_stack_2422 = workInProgress.child), - (JSCompiler_object_inline_stack_2422.memoizedState = + (JSCompiler_object_inline_stack_2430 = workInProgress.child), + (JSCompiler_object_inline_stack_2430.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2422.childLanes = + (JSCompiler_object_inline_stack_2430.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2423)); + JSCompiler_object_inline_componentStack_2431)); 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_2420.data === + JSCompiler_object_inline_message_2428.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2421 = - JSCompiler_object_inline_message_2420.nextSibling && - JSCompiler_object_inline_message_2420.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2421) { - JSCompiler_temp = JSCompiler_object_inline_digest_2421.dgst; - var message = JSCompiler_object_inline_digest_2421.msg; - instance = JSCompiler_object_inline_digest_2421.stck; - var componentStack = JSCompiler_object_inline_digest_2421.cstck; + JSCompiler_object_inline_digest_2429 = + JSCompiler_object_inline_message_2428.nextSibling && + JSCompiler_object_inline_message_2428.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2429) { + JSCompiler_temp = JSCompiler_object_inline_digest_2429.dgst; + var message = JSCompiler_object_inline_digest_2429.msg; + instance = JSCompiler_object_inline_digest_2429.stck; + var componentStack = JSCompiler_object_inline_digest_2429.cstck; } - JSCompiler_object_inline_message_2420 = message; - JSCompiler_object_inline_digest_2421 = JSCompiler_temp; - JSCompiler_object_inline_stack_2422 = instance; - JSCompiler_object_inline_componentStack_2423 = componentStack; - JSCompiler_object_inline_message_2420 = - JSCompiler_object_inline_message_2420 - ? Error(JSCompiler_object_inline_message_2420) + JSCompiler_object_inline_message_2428 = message; + JSCompiler_object_inline_digest_2429 = JSCompiler_temp; + JSCompiler_object_inline_stack_2430 = instance; + JSCompiler_object_inline_componentStack_2431 = componentStack; + JSCompiler_object_inline_message_2428 = + JSCompiler_object_inline_message_2428 + ? Error(JSCompiler_object_inline_message_2428) : 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_2420.stack = - JSCompiler_object_inline_stack_2422 || ""; - JSCompiler_object_inline_message_2420.digest = - JSCompiler_object_inline_digest_2421; - JSCompiler_object_inline_digest_2421 = - void 0 === JSCompiler_object_inline_componentStack_2423 + JSCompiler_object_inline_message_2428.stack = + JSCompiler_object_inline_stack_2430 || ""; + JSCompiler_object_inline_message_2428.digest = + JSCompiler_object_inline_digest_2429; + JSCompiler_object_inline_digest_2429 = + void 0 === JSCompiler_object_inline_componentStack_2431 ? null - : JSCompiler_object_inline_componentStack_2423; - "string" === typeof JSCompiler_object_inline_digest_2421 && + : JSCompiler_object_inline_componentStack_2431; + "string" === typeof JSCompiler_object_inline_digest_2429 && CapturedStacks.set( - JSCompiler_object_inline_message_2420, - JSCompiler_object_inline_digest_2421 + JSCompiler_object_inline_message_2428, + JSCompiler_object_inline_digest_2429 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2420, + value: JSCompiler_object_inline_message_2428, source: null, - stack: JSCompiler_object_inline_digest_2421 + stack: JSCompiler_object_inline_digest_2429 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9426,25 +9540,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2421 = + (JSCompiler_object_inline_digest_2429 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2421) + didReceiveUpdate || JSCompiler_object_inline_digest_2429) ) { - JSCompiler_object_inline_digest_2421 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2421) { - JSCompiler_object_inline_stack_2422 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2422 & 42)) - JSCompiler_object_inline_stack_2422 = 1; + JSCompiler_object_inline_digest_2429 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2429) { + JSCompiler_object_inline_stack_2430 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2430 & 42)) + JSCompiler_object_inline_stack_2430 = 1; else - switch (JSCompiler_object_inline_stack_2422) { + switch (JSCompiler_object_inline_stack_2430) { case 2: - JSCompiler_object_inline_stack_2422 = 1; + JSCompiler_object_inline_stack_2430 = 1; break; case 8: - JSCompiler_object_inline_stack_2422 = 4; + JSCompiler_object_inline_stack_2430 = 4; break; case 32: - JSCompiler_object_inline_stack_2422 = 16; + JSCompiler_object_inline_stack_2430 = 16; break; case 128: case 256: @@ -9465,40 +9579,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2422 = 64; + JSCompiler_object_inline_stack_2430 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2422 = 134217728; + JSCompiler_object_inline_stack_2430 = 134217728; break; default: - JSCompiler_object_inline_stack_2422 = 0; + JSCompiler_object_inline_stack_2430 = 0; } - JSCompiler_object_inline_stack_2422 = + JSCompiler_object_inline_stack_2430 = 0 !== - (JSCompiler_object_inline_stack_2422 & - (JSCompiler_object_inline_digest_2421.suspendedLanes | + (JSCompiler_object_inline_stack_2430 & + (JSCompiler_object_inline_digest_2429.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2422; + : JSCompiler_object_inline_stack_2430; if ( - 0 !== JSCompiler_object_inline_stack_2422 && - JSCompiler_object_inline_stack_2422 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2430 && + JSCompiler_object_inline_stack_2430 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2422), + ((prevState.retryLane = JSCompiler_object_inline_stack_2430), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2422 + JSCompiler_object_inline_stack_2430 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429, current, - JSCompiler_object_inline_stack_2422 + JSCompiler_object_inline_stack_2430 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2420.data === + JSCompiler_object_inline_message_2428.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9506,7 +9620,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2420.data === + JSCompiler_object_inline_message_2428.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9514,12 +9628,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2420._reactRetry = + (JSCompiler_object_inline_message_2428._reactRetry = workInProgress), (workInProgress = null)) : ((renderLanes = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2420.nextSibling + JSCompiler_object_inline_message_2428.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9537,73 +9651,73 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2422.children + JSCompiler_object_inline_stack_2430.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2423) + if (JSCompiler_object_inline_componentStack_2431) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2423 = - JSCompiler_object_inline_stack_2422.fallback), - (JSCompiler_object_inline_message_2420 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2431 = + JSCompiler_object_inline_stack_2430.fallback), + (JSCompiler_object_inline_message_2428 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), (componentStack = { mode: "hidden", - children: JSCompiler_object_inline_stack_2422.children + children: JSCompiler_object_inline_stack_2430.children }), disableLegacyMode || - (JSCompiler_object_inline_message_2420 & ConcurrentMode) !== NoMode || + (JSCompiler_object_inline_message_2428 & ConcurrentMode) !== NoMode || workInProgress.child === JSCompiler_temp - ? ((JSCompiler_object_inline_stack_2422 = createWorkInProgress( + ? ((JSCompiler_object_inline_stack_2430 = createWorkInProgress( JSCompiler_temp, componentStack )), - (JSCompiler_object_inline_stack_2422.subtreeFlags = + (JSCompiler_object_inline_stack_2430.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280)) - : ((JSCompiler_object_inline_stack_2422 = workInProgress.child), - (JSCompiler_object_inline_stack_2422.childLanes = 0), - (JSCompiler_object_inline_stack_2422.pendingProps = + : ((JSCompiler_object_inline_stack_2430 = workInProgress.child), + (JSCompiler_object_inline_stack_2430.childLanes = 0), + (JSCompiler_object_inline_stack_2430.pendingProps = componentStack), workInProgress.mode & ProfileMode && - ((JSCompiler_object_inline_stack_2422.actualDuration = 0), - (JSCompiler_object_inline_stack_2422.actualStartTime = -1), - (JSCompiler_object_inline_stack_2422.selfBaseDuration = + ((JSCompiler_object_inline_stack_2430.actualDuration = -0), + (JSCompiler_object_inline_stack_2430.actualStartTime = -1.1), + (JSCompiler_object_inline_stack_2430.selfBaseDuration = JSCompiler_temp.selfBaseDuration), - (JSCompiler_object_inline_stack_2422.treeBaseDuration = + (JSCompiler_object_inline_stack_2430.treeBaseDuration = JSCompiler_temp.treeBaseDuration)), (workInProgress.deletions = null)), null !== instance - ? (JSCompiler_object_inline_componentStack_2423 = + ? (JSCompiler_object_inline_componentStack_2431 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2423 + JSCompiler_object_inline_componentStack_2431 )) - : ((JSCompiler_object_inline_componentStack_2423 = + : ((JSCompiler_object_inline_componentStack_2431 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2423, - JSCompiler_object_inline_message_2420, + JSCompiler_object_inline_componentStack_2431, + JSCompiler_object_inline_message_2428, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2423.flags |= 2)), - (JSCompiler_object_inline_componentStack_2423.return = + (JSCompiler_object_inline_componentStack_2431.flags |= 2)), + (JSCompiler_object_inline_componentStack_2431.return = workInProgress), - (JSCompiler_object_inline_stack_2422.return = workInProgress), - (JSCompiler_object_inline_stack_2422.sibling = - JSCompiler_object_inline_componentStack_2423), - (workInProgress.child = JSCompiler_object_inline_stack_2422), - (JSCompiler_object_inline_stack_2422 = - JSCompiler_object_inline_componentStack_2423), - (JSCompiler_object_inline_componentStack_2423 = workInProgress.child), - (JSCompiler_object_inline_message_2420 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2420 - ? (JSCompiler_object_inline_message_2420 = + (JSCompiler_object_inline_stack_2430.return = workInProgress), + (JSCompiler_object_inline_stack_2430.sibling = + JSCompiler_object_inline_componentStack_2431), + (workInProgress.child = JSCompiler_object_inline_stack_2430), + (JSCompiler_object_inline_stack_2430 = + JSCompiler_object_inline_componentStack_2431), + (JSCompiler_object_inline_componentStack_2431 = workInProgress.child), + (JSCompiler_object_inline_message_2428 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2428 + ? (JSCompiler_object_inline_message_2428 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2420.cachePool), + JSCompiler_object_inline_message_2428.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9611,34 +9725,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2420 = { + (JSCompiler_object_inline_message_2428 = { baseLanes: - JSCompiler_object_inline_message_2420.baseLanes | renderLanes, + JSCompiler_object_inline_message_2428.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2423.memoizedState = - JSCompiler_object_inline_message_2420), + (JSCompiler_object_inline_componentStack_2431.memoizedState = + JSCompiler_object_inline_message_2428), enableTransitionTracing && - ((JSCompiler_object_inline_message_2420 = enableTransitionTracing + ((JSCompiler_object_inline_message_2428 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2420 && + null !== JSCompiler_object_inline_message_2428 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2423.updateQueue), + JSCompiler_object_inline_componentStack_2431.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2423.updateQueue = { - transitions: JSCompiler_object_inline_message_2420, + ? (JSCompiler_object_inline_componentStack_2431.updateQueue = { + transitions: JSCompiler_object_inline_message_2428, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2423.updateQueue = + ? (JSCompiler_object_inline_componentStack_2431.updateQueue = { - transitions: JSCompiler_object_inline_message_2420, + transitions: JSCompiler_object_inline_message_2428, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9646,41 +9760,41 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2420), + JSCompiler_object_inline_message_2428), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2423.childLanes = + (JSCompiler_object_inline_componentStack_2431.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2422 + JSCompiler_object_inline_stack_2430 ); pushPrimaryTreeSuspenseHandler(workInProgress); - JSCompiler_object_inline_digest_2421 = current.child; - current = JSCompiler_object_inline_digest_2421.sibling; - JSCompiler_object_inline_digest_2421 = createWorkInProgress( - JSCompiler_object_inline_digest_2421, + JSCompiler_object_inline_digest_2429 = current.child; + current = JSCompiler_object_inline_digest_2429.sibling; + JSCompiler_object_inline_digest_2429 = createWorkInProgress( + JSCompiler_object_inline_digest_2429, { mode: "visible", - children: JSCompiler_object_inline_stack_2422.children + children: JSCompiler_object_inline_stack_2430.children } ); disableLegacyMode || (workInProgress.mode & ConcurrentMode) !== NoMode || - (JSCompiler_object_inline_digest_2421.lanes = renderLanes); - JSCompiler_object_inline_digest_2421.return = workInProgress; - JSCompiler_object_inline_digest_2421.sibling = null; + (JSCompiler_object_inline_digest_2429.lanes = renderLanes); + JSCompiler_object_inline_digest_2429.return = workInProgress; + JSCompiler_object_inline_digest_2429.sibling = null; null !== current && ((renderLanes = workInProgress.deletions), null === renderLanes ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) : renderLanes.push(current)); - workInProgress.child = JSCompiler_object_inline_digest_2421; + workInProgress.child = JSCompiler_object_inline_digest_2429; workInProgress.memoizedState = null; - return JSCompiler_object_inline_digest_2421; + return JSCompiler_object_inline_digest_2429; } function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { primaryChildren = createFiberFromOffscreen( @@ -9713,10 +9827,10 @@ __DEV__ && : ((progressedPrimaryFragment.childLanes = 0), (progressedPrimaryFragment.pendingProps = primaryChildren), workInProgress.mode & ProfileMode && - ((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, @@ -10058,9 +10172,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; @@ -10700,9 +10815,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, @@ -11205,7 +11321,11 @@ __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 }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -11406,12 +11526,13 @@ __DEV__ && ); } 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) { if (!isHydrating) @@ -12263,109 +12384,626 @@ __DEV__ && } } function shouldProfile(current) { - return ( - (current.mode & ProfileMode) !== NoMode && - (executionContext & CommitContext) !== NoContext - ); + return (current.mode & ProfileMode) !== NoMode; } - function safelyCallComponentWillUnmount( - current, + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookLayoutUnmountEffects( + finishedWork, nearestMountedAncestor, - instance + hookFlags ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + 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 + ); + } 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 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; + 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 { + 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); + } + else if ("function" === typeof ref) + try { + if (shouldProfile(current)) + try { + startEffectTimer(), runWithFiberInDEV(current, ref, null); + } finally { + recordEffectDuration(current); + } + 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); + } + 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 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; } - 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); + 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." + ); } - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); } } - 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$12) { - captureCommitPhaseError(current, nearestMountedAncestor, error$12); - } 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$13) { - captureCommitPhaseError(current, nearestMountedAncestor, error$13); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; eventsEnabled = _enabled; - root = getActiveElementDeep(); + root = getActiveElementDeep(root); if (hasSelectionCapabilities(root)) { if ("selectionStart" in root) var JSCompiler_temp = { @@ -12387,7 +13025,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$48) { + } catch (e$42) { JSCompiler_temp = null; break a; } @@ -12438,428 +13076,122 @@ __DEV__ && root = null; JSCompiler_temp = selectionInformation.focusedElem; null !== JSCompiler_temp && - (root = getClosestInstanceFromNode(JSCompiler_temp)); - _enabled = !1; - focusedInstanceHandle = root; - for (nextEffect = firstChild; null !== nextEffect; ) { - firstChild = nextEffect; - root = firstChild.deletions; - if (null !== root) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); - 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$14) { - captureCommitPhaseError(firstChild, firstChild.return, error$14); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - 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), - 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 && - 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 - )); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (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()); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 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", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function 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$15) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$15); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$16) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$16); - } - } - 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$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error$18) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$18); - } - } - 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) { + (root = getClosestInstanceFromNode(JSCompiler_temp)); + _enabled = !1; + focusedInstanceHandle = root; + for (nextEffect = firstChild; null !== nextEffect; ) { + firstChild = nextEffect; + root = firstChild.deletions; + if (null !== root) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + doesFiberContain(anchorOffset, focusedInstanceHandle) && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); + root = firstChild.child; + if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + 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: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + 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) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } + } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -12876,17 +13208,27 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )), shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), + 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 || @@ -12901,20 +13243,24 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -12922,70 +13268,75 @@ __DEV__ && 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$20) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$20 + 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; @@ -12995,17 +13346,17 @@ __DEV__ && (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( @@ -13013,31 +13364,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( @@ -13246,78 +13584,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, @@ -13377,8 +13643,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; @@ -13397,29 +13667,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: @@ -13439,49 +13743,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), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - callDestroyInDEV( - 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, @@ -13546,21 +13820,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$23) { + } catch (error$35) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$23 + error$35 ); } + } } } function getRetryCache(finishedWork) { @@ -13632,75 +13919,54 @@ __DEV__ && } function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; - inProgressRoot = root; - runWithFiberInDEV( - finishedWork, - commitMutationEffectsOnFiber, - finishedWork, - root, - committedLanes - ); + inProgressRoot = root; + 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$24) { - captureCommitPhaseError(childToDelete, parentFiber, error$24); + 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) { @@ -13708,57 +13974,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$25) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$25 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$27) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$27 - ); - } - } + 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 && @@ -13775,7 +14007,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13794,97 +14026,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( @@ -13893,9 +14124,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 @@ -13910,86 +14141,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$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } + 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 && @@ -13997,30 +14210,23 @@ __DEV__ && if (finishedWork.flags & 32) { root = finishedWork.stateNode; try { - setTextContent(root, ""); - } catch (error$29) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$29 - ); - } - } - 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$30) { + runWithFiberInDEV(finishedWork, resetTextContent, root); + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + 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 && @@ -14029,32 +14235,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$31) { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + root, + current, + flags + ); + } catch (error$24) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$31 + 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 && @@ -14062,28 +14276,40 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$32) { + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); + } catch (error$31) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + 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), @@ -14103,11 +14329,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$33) { + } catch (error$36) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$33 + error$36 ); } flags = finishedWork.updateQueue; @@ -14120,17 +14346,17 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; disableLegacyMode || finishedWork.mode & ConcurrentMode - ? ((suspenseCallback = offscreenSubtreeIsHidden), - (retryQueue = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = suspenseCallback || domElement), - (offscreenSubtreeWasHidden = retryQueue || newProps), - recursivelyTraverseMutationEffects(root, finishedWork, lanes), - (offscreenSubtreeWasHidden = retryQueue), - (offscreenSubtreeIsHidden = suspenseCallback)) - : recursivelyTraverseMutationEffects(root, finishedWork, lanes); + ? ((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; @@ -14138,13 +14364,13 @@ __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 || (finishedWork.mode & ConcurrentMode) !== NoMode) && @@ -14155,47 +14381,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$21) { + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$21 + 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$22) { + (maybeNodes = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + maybeNodes + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + maybeNodes, + nextNode.memoizedProps + ); + } catch (error$27) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$22 + nextNode, + nextNode.return, + error$27 ); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -14226,7 +14459,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -14235,7 +14468,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -14245,7 +14478,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -14253,54 +14486,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$34) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$34); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -14318,27 +14506,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) { @@ -14347,23 +14521,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: @@ -14421,28 +14583,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$35) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$35 + 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); @@ -14459,18 +14618,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( @@ -14507,9 +14690,7 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, parentFiber, @@ -14517,22 +14698,6 @@ __DEV__ && ), (parentFiber = parentFiber.sibling); } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$37) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$37); - } - } function commitOffscreenPassiveMountEffects( current, finishedWork, @@ -14607,21 +14772,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, @@ -14630,9 +14780,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14661,6 +14809,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -14728,6 +14877,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( @@ -14744,9 +14920,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -14756,25 +14932,23 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions )) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14786,7 +14960,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -14830,9 +15004,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -14879,9 +15051,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, @@ -14892,11 +15064,9 @@ __DEV__ && : disableLegacyMode || finishedWork.mode & ConcurrentMode ? recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14904,7 +15074,7 @@ __DEV__ && committedTransitions, includeWorkInProgressEffects )) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14917,7 +15087,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -14957,70 +15127,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) @@ -15081,25 +15227,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)) { @@ -15116,11 +15243,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -15136,12 +15259,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; @@ -15164,7 +15299,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -15191,116 +15326,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) { @@ -15308,20 +15434,10 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Layout | HasEffect, fiber); - } catch (error$38) { - captureCommitPhaseError(fiber, fiber.return, error$38); - } + commitHookEffectListMount(Layout | HasEffect, fiber); break; case 1: - var instance = fiber.stateNode; - if ("function" === typeof instance.componentDidMount) - try { - instance.componentDidMount(); - } catch (error$39) { - captureCommitPhaseError(fiber, fiber.return, error$39); - } + commitClassDidMount(fiber); } } function invokePassiveEffectMountInDEV(fiber) { @@ -15329,11 +15445,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListMount(Passive | HasEffect, fiber); - } catch (error$40) { - captureCommitPhaseError(fiber, fiber.return, error$40); - } + commitHookEffectListMount(Passive | HasEffect, fiber); } } function invokeLayoutEffectUnmountInDEV(fiber) { @@ -15341,15 +15453,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Layout | HasEffect, - fiber, - fiber.return - ); - } catch (error$41) { - captureCommitPhaseError(fiber, fiber.return, error$41); - } + commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); break; case 1: var instance = fiber.stateNode; @@ -15362,15 +15466,7 @@ __DEV__ && case 0: case 11: case 15: - try { - commitHookEffectListUnmount( - Passive | HasEffect, - fiber, - fiber.return - ); - } catch (error$42) { - captureCommitPhaseError(fiber, fiber.return, error$42); - } + commitHookEffectListUnmount(Passive | HasEffect, fiber, fiber.return); } } function onCommitRoot() { @@ -15510,7 +15606,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if ( @@ -15568,7 +15665,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); 2 !== lane || @@ -15577,179 +15675,203 @@ __DEV__ && (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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + (enableSiblingPrerendering && checkIfRootIsPrerendering(root, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = 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 (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + if (exitStatus === RootInProgress) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root, lanes, 0, !1); + break; + } else if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + 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, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - didTimeout + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); + else { + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + 0 + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); } } - break; - } while (1); - } + } + break; + } 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 @@ -15766,7 +15888,13 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -15782,10 +15910,21 @@ __DEV__ && root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended( + root, + lanes, + spawnedLane, + !didSkipSuspendedSiblings + ); return; } commitRoot( @@ -15793,31 +15932,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$43) { - 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; ) { @@ -15833,7 +15977,9 @@ __DEV__ && 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 & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -15841,70 +15987,29 @@ __DEV__ && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didAttemptEntireTree + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didAttemptEntireTree[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; @@ -15916,12 +16021,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() { @@ -15956,9 +16061,12 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -15991,6 +16099,7 @@ __DEV__ && thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -16017,7 +16126,7 @@ __DEV__ && ); else if ( (erroredWork.mode & ProfileMode && - stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), + stopProfilerTimerIfRunningAndRecordDuration(erroredWork), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -16074,16 +16183,22 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } - function renderRootSync(root, lanes) { + function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(), @@ -16105,34 +16220,49 @@ __DEV__ && enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = RootInProgress; + break a; + } + break; default: - (workInProgressSuspendedReason = NotSuspended), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$44) { - handleThrow(root, thrownValue$44); + } catch (thrownValue$38) { + handleThrow(root, thrownValue$38); } while (1); lanes && root.shellSuspendCounter++; @@ -16140,16 +16270,13 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -16173,7 +16300,11 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering( + root, + lanes + ); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -16190,7 +16321,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -16222,7 +16358,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -16254,12 +16395,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(); @@ -16274,8 +16425,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$45) { - handleThrow(root, thrownValue$45); + } catch (thrownValue$39) { + handleThrow(root, thrownValue$39); } while (1); resetContextDependencies(); @@ -16313,7 +16464,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -16321,7 +16472,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -16329,7 +16480,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -16392,10 +16543,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; @@ -16419,9 +16575,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$46) { + } catch (error$40) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$46); + throw ((workInProgress = returnFiber), error$40); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -16430,62 +16586,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 ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + 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; - (completedWork.mode & ProfileMode) === NoMode - ? (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; @@ -16500,12 +16646,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; @@ -16518,13 +16701,17 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -16532,7 +16719,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -16545,7 +16734,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;" @@ -16576,7 +16765,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), @@ -16588,58 +16784,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), @@ -16680,7 +16876,7 @@ __DEV__ && ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { @@ -16720,7 +16916,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -16736,7 +16932,7 @@ __DEV__ && return ( (Internals.p = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), @@ -16746,15 +16942,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; @@ -16770,7 +16957,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;" @@ -16783,12 +16970,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 && @@ -16798,7 +16981,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root, !0); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -16836,9 +17019,9 @@ __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) { @@ -16919,6 +17102,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -16940,7 +17124,9 @@ __DEV__ && 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) { @@ -17053,12 +17239,15 @@ __DEV__ && var shouldDoubleInvokePassiveEffects = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !0; setIsStrictModeForDevtools(!0); - disappearLayoutEffects(fiber); - shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber); - reappearLayoutEffects(root, fiber.alternate, fiber, !1); - shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); - setIsStrictModeForDevtools(!1); + try { + disappearLayoutEffects(fiber), + shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), + reappearLayoutEffects(root, fiber.alternate, fiber, !1), + shouldDoubleInvokePassiveEffects && + reconnectPassiveEffects(root, fiber, 0, null, !1); + } finally { + setIsStrictModeForDevtools(!1); + } } function commitDoubleInvokeEffectsInDEV(root, hasPassiveEffects) { disableLegacyMode || 0 !== root.tag @@ -17301,9 +17490,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; @@ -17339,10 +17528,10 @@ __DEV__ && key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, _debugInfo: null, _debugOwner: null, _debugNeedsRemount: !1, @@ -17378,8 +17567,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; @@ -17393,7 +17582,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -17446,7 +17636,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -17728,6 +17919,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -17752,7 +17944,7 @@ __DEV__ && identifierPrefix++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (identifierPrefix = 0; 31 > identifierPrefix; identifierPrefix++) @@ -18440,10 +18632,16 @@ __DEV__ && : !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 { @@ -18452,9 +18650,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; } @@ -18472,103 +18670,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( @@ -18767,8 +18960,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$49) { - reportGlobalError(error$49); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18789,8 +18982,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$49) { - reportGlobalError(error$49); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -21793,6 +21986,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -21824,21 +22025,48 @@ __DEV__ && throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } function createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -21862,6 +22090,27 @@ __DEV__ && } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainer(container) { var nodeType = container.nodeType; if (nodeType === DOCUMENT_NODE) clearContainerSparingly(container); @@ -22076,6 +22325,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function requestPostPaintCallback(callback) { localRequestAnimationFrame(function () { localRequestAnimationFrame(function (time) { @@ -22121,6 +22376,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.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.", + tagName, + tagName, + tagName + ); + } + switch (type) { + 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." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -22793,7 +23079,7 @@ __DEV__ && ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -23338,7 +23624,7 @@ __DEV__ && NoContext && ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -23618,7 +23904,7 @@ __DEV__ && (ReactSharedInternals.T = prevTransition), (executionContext = prevExecutionContext), (executionContext & (RenderContext | CommitContext)) === - NoContext && flushSyncWorkAcrossRoots_impl(!1); + NoContext && flushSyncWorkAcrossRoots_impl(0, !1); } JSCompiler_inline_result = void 0; } @@ -23790,17 +24076,21 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -24816,6 +25106,13 @@ __DEV__ && concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0, + now = Scheduler.unstable_now, + renderStartTime = -0, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -26407,14 +26704,7 @@ __DEV__ && updateHookTypesDev(); return unstable_useContextWithBailout(context, select); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); @@ -26497,7 +26787,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -26678,6 +26968,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -26685,6 +26977,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -26700,7 +26993,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -26712,6 +27004,9 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -26814,7 +27109,7 @@ __DEV__ && }); window.addEventListener("test", options$jscomp$0, options$jscomp$0); window.removeEventListener("test", options$jscomp$0, options$jscomp$0); - } catch (e$47) { + } catch (e$41) { passiveBrowserEventsSupported = !1; } var EventListenerWWW = require("EventListener"), @@ -27528,11 +27823,11 @@ __DEV__ && : flushSyncErrorInBuildsThatSupportLegacyMode; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-classic-0ad0fac1-20240814" !== isomorphicReactPackageVersion) + if ("19.0.0-www-classic-28668d39-20241023" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-classic-0ad0fac1-20240814\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-classic-28668d39-20241023\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27576,11 +27871,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-classic-0ad0fac1-20240814", + version: "19.0.0-www-classic-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-classic-28668d39-20241023" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -28233,7 +28528,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; + exports.version = "19.0.0-www-classic-28668d39-20241023"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 24d00e21684cc..1fae96f82cf5d 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -375,64 +375,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -441,54 +441,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -499,7 +503,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -824,20 +828,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 && @@ -940,31 +930,53 @@ __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 || - (32 === suspendedLanes && 0 !== (root & 4194176))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1013,14 +1025,6 @@ __DEV__ && ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1037,25 +1041,34 @@ __DEV__ && 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) @@ -1067,9 +1080,15 @@ __DEV__ && var update = hiddenUpdatesForLane[index]; 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; @@ -3236,7 +3255,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, @@ -3245,7 +3264,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, @@ -3254,7 +3273,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, @@ -3267,7 +3286,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;" @@ -3276,7 +3295,7 @@ __DEV__ && function logStateUpdateScheduled(componentName, lane, payloadOrAction) { enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + componentName + " updated state %c(" + formatLanes(lane) + @@ -3672,6 +3691,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 && @@ -3689,28 +3756,42 @@ __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 & 3) && - ((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) || + checkIfRootIsPrerendering(root, nextLanes) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root, nextLanes)); root = root.next; } } while (didPerformSomeWork); @@ -3722,33 +3803,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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -3789,45 +3866,74 @@ __DEV__ && (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode$1) - ) - cancelCallback(pingedLanes); - else return currentTime; - switch (lanesToEventPriority(suspendedLanes)) { - case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; - case ContinuousEventPriority: - suspendedLanes = UserBlockingPriority; - break; - case DefaultEventPriority: - suspendedLanes = NormalPriority$1; - break; - case IdleEventPriority: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - null !== ReactSharedInternals.actQueue - ? (ReactSharedInternals.actQueue.push(pingedLanes), - (suspendedLanes = fakeActCallbackNode$1)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if ( + currentTime !== root.callbackPriority || + (null !== ReactSharedInternals.actQueue && + pingedLanes !== fakeActCallbackNode$1) + ) + cancelCallback(pingedLanes); + else return currentTime; + switch (lanesToEventPriority(suspendedLanes)) { + case DiscreteEventPriority: + case ContinuousEventPriority: + suspendedLanes = UserBlockingPriority; + break; + case DefaultEventPriority: + suspendedLanes = NormalPriority$1; + break; + case IdleEventPriority: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + null !== ReactSharedInternals.actQueue + ? (ReactSharedInternals.actQueue.push(pingedLanes), + (suspendedLanes = fakeActCallbackNode$1)) + : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; + } + null !== pingedLanes && cancelCallback(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; + } + 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 && @@ -3870,8 +3976,8 @@ __DEV__ && } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -4191,6 +4297,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) @@ -5624,6 +5740,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; @@ -5680,10 +5804,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; } @@ -5807,7 +5937,11 @@ __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; - JSCompiler_temp.dependencies = { lanes: 0, firstContext: context }; + JSCompiler_temp.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; JSCompiler_temp.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; JSCompiler_temp = value; @@ -5864,7 +5998,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; @@ -5889,10 +6023,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -6208,10 +6346,14 @@ __DEV__ && if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -6537,17 +6679,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) { @@ -6703,10 +6844,14 @@ __DEV__ && var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; } @@ -6717,10 +6862,14 @@ __DEV__ && if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -6809,14 +6958,26 @@ __DEV__ && 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$9) { - dispatchSetState(fiber, queue, { - then: function () {}, - status: "rejected", - reason: error$9 - }); + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error$9 }, + requestUpdateLane(fiber) + ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), @@ -6890,7 +7051,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); @@ -7026,8 +7192,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, @@ -7049,35 +7224,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; - } + 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, @@ -7145,61 +7312,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); @@ -8091,6 +8203,7 @@ __DEV__ && ); if (null === current || current.ref !== ref) { if ( + !disableStringRefs && null !== current && ((current = current.ref), "function" === typeof current && @@ -8177,6 +8290,7 @@ __DEV__ && hookTypesUpdateIndexDev = -1; ignorePreviousDependencies = null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -8821,32 +8935,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_2450; + var JSCompiler_object_inline_stack_2451 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2435 = !1; + var JSCompiler_object_inline_componentStack_2452 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2433 = didSuspend) || - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2450 = didSuspend) || + (JSCompiler_object_inline_digest_2450 = 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_2450 && + ((JSCompiler_object_inline_componentStack_2452 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2433 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2450 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2452 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2432 = nextHydratableInstance; + var JSCompiler_object_inline_message_2449 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2432)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2449)) { c: { - var instance = JSCompiler_object_inline_message_2432; + var instance = JSCompiler_object_inline_message_2449; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -8887,19 +9001,19 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2449 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2432 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2449 = 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_2449 && + ((JSCompiler_object_inline_message_2449 = + JSCompiler_object_inline_message_2449.dehydrated), + null !== JSCompiler_object_inline_message_2449) ) return ( - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2449.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8907,27 +9021,27 @@ __DEV__ && ); 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_2449 = + JSCompiler_object_inline_stack_2451.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2451.fallback; + if (JSCompiler_object_inline_componentStack_2452) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2451 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2449, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2452 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2452.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2452.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2450, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -8940,9 +9054,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2452.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = + ? (JSCompiler_object_inline_componentStack_2452.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -8950,46 +9064,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2451 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2434.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2451.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2434 = + (JSCompiler_object_inline_stack_2451 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_message_2449, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2452 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2435.memoizedState = + (JSCompiler_object_inline_componentStack_2452.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2452.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2450, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2451 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2449 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2432 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2432) + ((JSCompiler_object_inline_message_2449 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2449) ) { if (didSuspend) workInProgress.flags & 256 @@ -9006,94 +9120,94 @@ __DEV__ && (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 = + (JSCompiler_object_inline_componentStack_2452 = + JSCompiler_object_inline_stack_2451.fallback), + (JSCompiler_object_inline_message_2449 = workInProgress.mode), + (JSCompiler_object_inline_stack_2451 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2451.children }, - JSCompiler_object_inline_message_2432 + JSCompiler_object_inline_message_2449 )), - (JSCompiler_object_inline_componentStack_2435 = + (JSCompiler_object_inline_componentStack_2452 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_componentStack_2452, + JSCompiler_object_inline_message_2449, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2), - (JSCompiler_object_inline_stack_2434.return = workInProgress), - (JSCompiler_object_inline_componentStack_2435.return = + (JSCompiler_object_inline_componentStack_2452.flags |= 2), + (JSCompiler_object_inline_stack_2451.return = workInProgress), + (JSCompiler_object_inline_componentStack_2452.return = workInProgress), - (JSCompiler_object_inline_stack_2434.sibling = - JSCompiler_object_inline_componentStack_2435), - (workInProgress.child = JSCompiler_object_inline_stack_2434), + (JSCompiler_object_inline_stack_2451.sibling = + JSCompiler_object_inline_componentStack_2452), + (workInProgress.child = JSCompiler_object_inline_stack_2451), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2434 = workInProgress.child), - (JSCompiler_object_inline_stack_2434.memoizedState = + (JSCompiler_object_inline_stack_2451 = workInProgress.child), + (JSCompiler_object_inline_stack_2451.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2434.childLanes = + (JSCompiler_object_inline_stack_2451.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2450, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2435)); + JSCompiler_object_inline_componentStack_2452)); 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_2449.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_2450 = + JSCompiler_object_inline_message_2449.nextSibling && + JSCompiler_object_inline_message_2449.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2450) { + JSCompiler_temp = JSCompiler_object_inline_digest_2450.dgst; + var message = JSCompiler_object_inline_digest_2450.msg; + instance = JSCompiler_object_inline_digest_2450.stck; + var componentStack = JSCompiler_object_inline_digest_2450.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_2449 = message; + JSCompiler_object_inline_digest_2450 = JSCompiler_temp; + JSCompiler_object_inline_stack_2451 = instance; + JSCompiler_object_inline_componentStack_2452 = componentStack; + JSCompiler_object_inline_message_2449 = + JSCompiler_object_inline_message_2449 + ? Error(JSCompiler_object_inline_message_2449) : 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_2449.stack = + JSCompiler_object_inline_stack_2451 || ""; + JSCompiler_object_inline_message_2449.digest = + JSCompiler_object_inline_digest_2450; + JSCompiler_object_inline_digest_2450 = + void 0 === JSCompiler_object_inline_componentStack_2452 ? null - : JSCompiler_object_inline_componentStack_2435; - "string" === typeof JSCompiler_object_inline_digest_2433 && + : JSCompiler_object_inline_componentStack_2452; + "string" === typeof JSCompiler_object_inline_digest_2450 && CapturedStacks.set( - JSCompiler_object_inline_message_2432, - JSCompiler_object_inline_digest_2433 + JSCompiler_object_inline_message_2449, + JSCompiler_object_inline_digest_2450 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2432, + value: JSCompiler_object_inline_message_2449, source: null, - stack: JSCompiler_object_inline_digest_2433 + stack: JSCompiler_object_inline_digest_2450 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9108,25 +9222,25 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2433 = + (JSCompiler_object_inline_digest_2450 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2433) + didReceiveUpdate || JSCompiler_object_inline_digest_2450) ) { - 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 & 42)) - JSCompiler_object_inline_stack_2434 = 1; + JSCompiler_object_inline_digest_2450 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2450) { + JSCompiler_object_inline_stack_2451 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2451 & 42)) + JSCompiler_object_inline_stack_2451 = 1; else - switch (JSCompiler_object_inline_stack_2434) { + switch (JSCompiler_object_inline_stack_2451) { case 2: - JSCompiler_object_inline_stack_2434 = 1; + JSCompiler_object_inline_stack_2451 = 1; break; case 8: - JSCompiler_object_inline_stack_2434 = 4; + JSCompiler_object_inline_stack_2451 = 4; break; case 32: - JSCompiler_object_inline_stack_2434 = 16; + JSCompiler_object_inline_stack_2451 = 16; break; case 128: case 256: @@ -9147,40 +9261,40 @@ __DEV__ && case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2434 = 64; + JSCompiler_object_inline_stack_2451 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2434 = 134217728; + JSCompiler_object_inline_stack_2451 = 134217728; break; default: - JSCompiler_object_inline_stack_2434 = 0; + JSCompiler_object_inline_stack_2451 = 0; } - JSCompiler_object_inline_stack_2434 = + JSCompiler_object_inline_stack_2451 = 0 !== - (JSCompiler_object_inline_stack_2434 & - (JSCompiler_object_inline_digest_2433.suspendedLanes | + (JSCompiler_object_inline_stack_2451 & + (JSCompiler_object_inline_digest_2450.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2434; + : JSCompiler_object_inline_stack_2451; if ( - 0 !== JSCompiler_object_inline_stack_2434 && - JSCompiler_object_inline_stack_2434 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2451 && + JSCompiler_object_inline_stack_2451 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2434), + ((prevState.retryLane = JSCompiler_object_inline_stack_2451), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2451 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2450, current, - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2451 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2449.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9188,7 +9302,7 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2432.data === + JSCompiler_object_inline_message_2449.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9196,12 +9310,12 @@ __DEV__ && null, current )), - (JSCompiler_object_inline_message_2432._reactRetry = + (JSCompiler_object_inline_message_2449._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2432.nextSibling + JSCompiler_object_inline_message_2449.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9219,57 +9333,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2434.children + JSCompiler_object_inline_stack_2451.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2435) + if (JSCompiler_object_inline_componentStack_2452) 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_2452 = + JSCompiler_object_inline_stack_2451.fallback), + (JSCompiler_object_inline_message_2449 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2434 = createWorkInProgress( + (JSCompiler_object_inline_stack_2451 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2451.children } )), - (JSCompiler_object_inline_stack_2434.subtreeFlags = + (JSCompiler_object_inline_stack_2451.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2435 = + ? (JSCompiler_object_inline_componentStack_2452 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2435 + JSCompiler_object_inline_componentStack_2452 )) - : ((JSCompiler_object_inline_componentStack_2435 = + : ((JSCompiler_object_inline_componentStack_2452 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2435, - JSCompiler_object_inline_message_2432, + JSCompiler_object_inline_componentStack_2452, + JSCompiler_object_inline_message_2449, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2435.flags |= 2)), - (JSCompiler_object_inline_componentStack_2435.return = + (JSCompiler_object_inline_componentStack_2452.flags |= 2)), + (JSCompiler_object_inline_componentStack_2452.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_2451.return = workInProgress), + (JSCompiler_object_inline_stack_2451.sibling = + JSCompiler_object_inline_componentStack_2452), + (workInProgress.child = JSCompiler_object_inline_stack_2451), + (JSCompiler_object_inline_stack_2451 = + JSCompiler_object_inline_componentStack_2452), + (JSCompiler_object_inline_componentStack_2452 = workInProgress.child), + (JSCompiler_object_inline_message_2449 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2449 + ? (JSCompiler_object_inline_message_2449 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2432.cachePool), + JSCompiler_object_inline_message_2449.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9277,34 +9391,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2432 = { + (JSCompiler_object_inline_message_2449 = { baseLanes: - JSCompiler_object_inline_message_2432.baseLanes | renderLanes, + JSCompiler_object_inline_message_2449.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2435.memoizedState = - JSCompiler_object_inline_message_2432), + (JSCompiler_object_inline_componentStack_2452.memoizedState = + JSCompiler_object_inline_message_2449), enableTransitionTracing && - ((JSCompiler_object_inline_message_2432 = enableTransitionTracing + ((JSCompiler_object_inline_message_2449 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2432 && + null !== JSCompiler_object_inline_message_2449 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2435.updateQueue), + JSCompiler_object_inline_componentStack_2452.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, + ? (JSCompiler_object_inline_componentStack_2452.updateQueue = { + transitions: JSCompiler_object_inline_message_2449, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2435.updateQueue = + ? (JSCompiler_object_inline_componentStack_2452.updateQueue = { - transitions: JSCompiler_object_inline_message_2432, + transitions: JSCompiler_object_inline_message_2449, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9312,32 +9426,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2432), + JSCompiler_object_inline_message_2449), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2435.childLanes = + (JSCompiler_object_inline_componentStack_2452.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2433, + JSCompiler_object_inline_digest_2450, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2434 + JSCompiler_object_inline_stack_2451 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2434.children + children: JSCompiler_object_inline_stack_2451.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2433 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2433 + ((JSCompiler_object_inline_digest_2450 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2450 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2433.push(current)); + : JSCompiler_object_inline_digest_2450.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -9691,9 +9805,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; @@ -10333,9 +10448,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, @@ -10792,7 +10908,11 @@ __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 }; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; consumer.flags |= 524288; } else lastContextDependency = lastContextDependency.next = context; return value; @@ -10993,12 +11113,13 @@ __DEV__ && ); } 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) { if (!isHydrating) @@ -11825,109 +11946,616 @@ __DEV__ && } } function shouldProfile(current) { - return ( - (current.mode & ProfileMode) !== NoMode && - (executionContext & CommitContext) !== NoContext - ); + return (current.mode & ProfileMode) !== NoMode; } - function safelyCallComponentWillUnmount( - current, + function commitHookLayoutEffects(finishedWork, hookFlags) { + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListMount(hookFlags, finishedWork), + recordEffectDuration()) + : commitHookEffectListMount(hookFlags, finishedWork); + } + function commitHookLayoutUnmountEffects( + finishedWork, nearestMountedAncestor, - instance + hookFlags ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - shouldProfile(current) - ? (startLayoutEffectTimer(), - callComponentWillUnmountInDEV( - current, - nearestMountedAncestor, - instance + shouldProfile(finishedWork) + ? (startEffectTimer(), + commitHookEffectListUnmount( + hookFlags, + finishedWork, + nearestMountedAncestor ), - recordLayoutEffectDuration(current)) - : callComponentWillUnmountInDEV( + 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 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 { - 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); + } + 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 commitPlacement(finishedWork) { + if (27 !== finishedWork.tag) { + a: { + for (var parent = finishedWork.return; null !== parent; ) { + if (isHostParent(parent)) { + var parentFiber = parent; + break a; + } + parent = parent.return; + } + throw Error( + "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." + ); + } + switch (parentFiber.tag) { + case 27: + parent = parentFiber.stateNode; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 5: + parent = parentFiber.stateNode; + parentFiber.flags & 32 && + (resetTextContent(parent), (parentFiber.flags &= -33)); + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + break; + case 3: + case 4: + parent = parentFiber.stateNode.containerInfo; + parentFiber = getHostSibling(finishedWork); + insertOrAppendPlacementNodeIntoContainer( + finishedWork, + parentFiber, + parent + ); + break; + default: + throw Error( + "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." + ); } - } catch (error$11) { - captureCommitPhaseError(current, nearestMountedAncestor, error$11); } } - 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$12) { - captureCommitPhaseError(current, nearestMountedAncestor, error$12); - } 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$13) { - captureCommitPhaseError(current, nearestMountedAncestor, error$13); - } - else ref.current = null; - } function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; eventsEnabled = _enabled; - root = getActiveElementDeep(); + root = getActiveElementDeep(root); if (hasSelectionCapabilities(root)) { if ("selectionStart" in root) var JSCompiler_temp = { @@ -11949,7 +12577,7 @@ __DEV__ && selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$43) { + } catch (e$42) { JSCompiler_temp = null; break a; } @@ -11985,458 +12613,152 @@ __DEV__ && node = parentNode; parentNode = node.parentNode; } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { - focusedElem: root, - selectionRange: JSCompiler_temp - }; - root = null; - JSCompiler_temp = selectionInformation.focusedElem; - null !== JSCompiler_temp && - (root = getClosestInstanceFromNode(JSCompiler_temp)); - _enabled = !1; - focusedInstanceHandle = root; - for (nextEffect = firstChild; null !== nextEffect; ) { - firstChild = nextEffect; - root = firstChild.deletions; - if (null !== root) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - doesFiberContain(anchorOffset, focusedInstanceHandle) && - ((_enabled = shouldFireAfterActiveInstanceBlur = !0), - dispatchBeforeDetachedBlur( - selectionInformation.focusedElem, - anchorOffset - ), - (_enabled = !1)); - 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$14) { - captureCommitPhaseError(firstChild, firstChild.return, error$14); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - 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: - if (0 !== (flags & 1024)) - a: if ( - ((finishedWork = finishedWork.stateNode.containerInfo), - (current = finishedWork.nodeType), - current === DOCUMENT_NODE) - ) - clearContainerSparingly(finishedWork); - else if (1 === current) - switch (finishedWork.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(finishedWork); - break a; - default: - finishedWork.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error( - "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." - ); - } - } - function commitHookEffectListUnmount( - flags, - finishedWork, - nearestMountedAncestor - ) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - var inst = effect.inst, - destroy = inst.destroy; - void 0 !== destroy && - ((inst.destroy = void 0), - enableSchedulingProfiler && - ((flags & Passive) !== NoFlags - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : (flags & Layout) !== NoFlags && - markComponentLayoutEffectUnmountStarted(finishedWork)), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0), - callDestroyInDEV(finishedWork, nearestMountedAncestor, destroy), - (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1), - 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 - )); - (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0); - var destroy = callCreateInDEV(effect); - (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()); - if (void 0 !== destroy && "function" !== typeof destroy) { - var hookName = - 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", - hookName, - null === destroy - ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." - : "function" === typeof destroy.then - ? "\n\nIt looks like you wrote " + - hookName + - "(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\n" + - hookName + - "(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching" - : " You returned: " + destroy - ); - } - } - effect = effect.next; - } while (effect !== updateQueue); - } - } - function 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$15) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$15); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$16) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$16); - } - } - 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$17) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$17); - } - } - } - function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error$18) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$18); - } - } - 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) { + node = next; + } + JSCompiler_temp = + -1 === start || -1 === end ? null : { start: start, end: end }; + } else JSCompiler_temp = null; + } + JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: root, + selectionRange: JSCompiler_temp + }; + root = null; + JSCompiler_temp = selectionInformation.focusedElem; + null !== JSCompiler_temp && + (root = getClosestInstanceFromNode(JSCompiler_temp)); + _enabled = !1; + focusedInstanceHandle = root; + for (nextEffect = firstChild; null !== nextEffect; ) { + firstChild = nextEffect; + root = firstChild.deletions; + if (null !== root) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + doesFiberContain(anchorOffset, focusedInstanceHandle) && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(anchorOffset)); + root = firstChild.child; + if (0 !== (firstChild.subtreeFlags & 9236) && null !== root) + (root.return = firstChild), (nextEffect = root); + else + for (; null !== nextEffect; ) { + 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: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (anchorOffset & 1024)) + if ( + ((root = root.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + JSCompiler_temp === DOCUMENT_NODE) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (anchorOffset & 1024)) + throw Error( + "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." + ); } - parentFiber = parentFiber.return; + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; + } + nextEffect = firstChild.return; } - } catch (error$19) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$19); - } + } + firstChild = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return firstChild; } - function commitLayoutEffectOnFiber( - finishedRoot, - current, - finishedWork, - committedLanes - ) { + function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: case 15: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); flags & 4 && commitHookLayoutEffects(finishedWork, Layout | HasEffect); break; case 1: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) finishedWork.type.defaultProps || @@ -12453,17 +12775,27 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )), shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidMountInDEV(finishedWork, finishedRoot), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidMountInDEV(finishedWork, finishedRoot); + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidMountInDEV, + finishedWork, + finishedRoot + ), + 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 || @@ -12478,20 +12810,24 @@ __DEV__ && getComponentNameFromFiber(finishedWork) || "instance" )); shouldProfile(finishedWork) - ? (startLayoutEffectTimer(), - callComponentDidUpdateInDEV( + ? (startEffectTimer(), + runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ), - recordLayoutEffectDuration(finishedWork)) - : callComponentDidUpdateInDEV( + recordEffectDuration()) + : runWithFiberInDEV( + finishedWork, + callComponentDidUpdateInDEV, finishedWork, finishedRoot, - committedLanes, - prevState, + prevProps, + current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); } @@ -12499,83 +12835,88 @@ __DEV__ && 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$20) { + runWithFiberInDEV( + finishedWork, + commitCallbacks, + flags, + prevProps + ); + } catch (error$15) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$20 + 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: - 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( @@ -12583,11 +12924,7 @@ __DEV__ && finishedWork, 0 !== (finishedWork.subtreeFlags & 8772) ) - : recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } @@ -12597,11 +12934,7 @@ __DEV__ && : safelyDetachRef(finishedWork, finishedWork.return)); break; default: - recursivelyTraverseLayoutEffects( - finishedRoot, - finishedWork, - committedLanes - ); + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); } } function abortRootTransitions( @@ -12810,78 +13143,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, @@ -12941,8 +13202,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; @@ -12961,29 +13226,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: @@ -13003,49 +13302,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), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - )) - : (tag & Layout) !== NoFlags && - (enableSchedulingProfiler && - markComponentLayoutEffectUnmountStarted(deletedFiber), - shouldProfile(deletedFiber) - ? (startLayoutEffectTimer(), - (inst.destroy = void 0), - callDestroyInDEV( - deletedFiber, - nearestMountedAncestor, - destroy - ), - recordLayoutEffectDuration(deletedFiber)) - : ((inst.destroy = void 0), - callDestroyInDEV( - 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, @@ -13104,21 +13373,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$23) { + } catch (error$35) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$23 + error$35 ); } + } } } function getRetryCache(finishedWork) { @@ -13191,74 +13473,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$24) { - captureCommitPhaseError(childToDelete, parentFiber, error$24); + 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) { @@ -13266,57 +13527,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$25) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$25 - ); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$26) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$26 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount( - Layout | HasEffect, - finishedWork, - finishedWork.return - ); - } catch (error$27) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$27 - ); - } - } + 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 && @@ -13333,7 +13560,7 @@ __DEV__ && break; case 26: var hoistableRoot = currentHoistableRoot; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && null !== current && @@ -13352,97 +13579,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( @@ -13451,9 +13677,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 @@ -13468,86 +13694,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$28) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$28 - ); - } + 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 && @@ -13555,30 +13763,23 @@ __DEV__ && if (finishedWork.flags & 32) { root = finishedWork.stateNode; try { - setTextContent(root, ""); - } catch (error$29) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$29 - ); - } - } - 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$30) { + runWithFiberInDEV(finishedWork, resetTextContent, root); + } catch (error$25) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$30 + 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 && @@ -13587,32 +13788,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$31) { + runWithFiberInDEV( + finishedWork, + commitTextUpdate, + root, + current, + flags + ); + } catch (error$24) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$31 + 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 && @@ -13620,28 +13829,40 @@ __DEV__ && current.memoizedState.isDehydrated ) try { - retryIfBlockedOn(root.containerInfo); - } catch (error$32) { + runWithFiberInDEV( + finishedWork, + commitHydratedContainer, + root.containerInfo + ); + } catch (error$31) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$32 + 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), @@ -13661,11 +13882,11 @@ __DEV__ && void 0 !== suspenseCallback && error$jscomp$0("Unexpected type for suspenseCallback."); } - } catch (error$33) { + } catch (error$36) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$33 + error$36 ); } flags = finishedWork.updateQueue; @@ -13678,15 +13899,15 @@ __DEV__ && flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; - recursivelyTraverseMutationEffects(root, finishedWork, lanes); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + i = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + suspenseCallback = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || i; + offscreenSubtreeWasHidden = suspenseCallback || nextNode; + recursivelyTraverseMutationEffects(root, finishedWork); + offscreenSubtreeWasHidden = suspenseCallback; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -13694,13 +13915,13 @@ __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 || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -13709,47 +13930,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$21) { + (hoistableRoot = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideInstance, + hoistableRoot + ) + : runWithFiberInDEV( + nextNode, + unhideInstance, + nextNode.stateNode, + nextNode.memoizedProps + ); + } catch (error$26) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$21 + 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$22) { + (maybeNodes = nextNode.stateNode), + i + ? runWithFiberInDEV( + nextNode, + hideTextInstance, + maybeNodes + ) + : runWithFiberInDEV( + nextNode, + unhideTextInstance, + maybeNodes, + nextNode.memoizedProps + ); + } catch (error$27) { captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$22 + nextNode, + nextNode.return, + error$27 ); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -13780,7 +14008,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, current)))); break; case 19: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 4 && ((flags = finishedWork.updateQueue), @@ -13789,7 +14017,7 @@ __DEV__ && attachSuspenseRetryListeners(finishedWork, flags))); break; case 21: - recursivelyTraverseMutationEffects(root, finishedWork, lanes); + recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); flags & 512 && (null !== current && @@ -13799,7 +14027,7 @@ __DEV__ && (finishedWork.stateNode[internalInstanceKey] = finishedWork); break; default: - recursivelyTraverseMutationEffects(root, finishedWork, lanes), + recursivelyTraverseMutationEffects(root, finishedWork), commitReconciliationEffects(finishedWork); } } @@ -13807,54 +14035,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$34) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$34); + runWithFiberInDEV(finishedWork, commitPlacement, finishedWork); + } catch (error$28) { + captureCommitPhaseError(finishedWork, finishedWork.return, error$28); } finishedWork.flags &= -3; } @@ -13872,27 +14055,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) { @@ -13901,23 +14070,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: @@ -13975,28 +14132,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$35) { + runWithFiberInDEV( + finishedWork, + commitHiddenCallbacks, + current, + finishedRoot + ); + } catch (error$14) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$35 + 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); @@ -14013,18 +14174,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( @@ -14061,31 +14246,13 @@ __DEV__ && includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reappearLayoutEffects, + reappearLayoutEffects( finishedRoot, parentFiber.alternate, - parentFiber, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); - } - function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$36) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$36); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$37) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$37); - } + parentFiber, + includeWorkInProgressEffects + ), + (parentFiber = parentFiber.sibling); } function commitOffscreenPassiveMountEffects( current, @@ -14161,21 +14328,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, @@ -14184,9 +14336,7 @@ __DEV__ && ) { if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveMountOnFiber, + commitPassiveMountOnFiber( root, parentFiber, committedLanes, @@ -14215,6 +14365,7 @@ __DEV__ && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -14282,6 +14433,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( @@ -14298,9 +14476,9 @@ __DEV__ && ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -14309,18 +14487,16 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14332,7 +14508,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -14376,9 +14552,7 @@ __DEV__ && includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - reconnectPassiveEffects, + reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, @@ -14425,9 +14599,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, @@ -14437,11 +14611,9 @@ __DEV__ && ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork, - committedLanes, - committedTransitions + finishedWork ) - : ((_instance4._visibility |= 4), + : ((_instance2._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -14454,7 +14626,7 @@ __DEV__ && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - _instance4 + _instance2 ); break; case 24: @@ -14494,70 +14666,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) @@ -14618,25 +14766,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)) { @@ -14653,11 +14782,7 @@ __DEV__ && } if (parentFiber.subtreeFlags & 10256) for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV( - parentFiber, - commitPassiveUnmountOnFiber, - parentFiber - ), + commitPassiveUnmountOnFiber(parentFiber), (parentFiber = parentFiber.sibling); } function commitPassiveUnmountOnFiber(finishedWork) { @@ -14673,12 +14798,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; @@ -14701,7 +14838,7 @@ __DEV__ && detachAlternateSiblings(parentFiber); } for (parentFiber = parentFiber.child; null !== parentFiber; ) - runWithFiberInDEV(parentFiber, disconnectPassiveEffect, parentFiber), + disconnectPassiveEffect(parentFiber), (parentFiber = parentFiber.sibling); } function disconnectPassiveEffect(finishedWork) { @@ -14728,116 +14865,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 onCommitRoot() { @@ -14968,7 +15096,8 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if ( @@ -15025,181 +15154,203 @@ __DEV__ && markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout); - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + (enableSiblingPrerendering && checkIfRootIsPrerendering(root, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended(root, lanes, 0); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = 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 (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = shouldTimeSlice; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + if (exitStatus === RootInProgress) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root, lanes, 0, !1); + break; + } else if (exitStatus === RootDidNotComplete) + markRootSuspended( + root, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (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, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane - ); - else { - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || didTimeout === RootSuspended) && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane - ), - didTimeout + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); + else { + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + 0 + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); } } - break; - } while (1); - } + } + break; + } 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 @@ -15216,7 +15367,13 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -15232,10 +15389,21 @@ __DEV__ && root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended( + root, + lanes, + spawnedLane, + !didSkipSuspendedSiblings + ); return; } commitRoot( @@ -15243,31 +15411,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$38) { - 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; ) { @@ -15283,7 +15456,9 @@ __DEV__ && 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 & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -15291,73 +15466,32 @@ __DEV__ && (didIncludeCommitPhaseUpdate = !0), throwIfInfiniteUpdateLoopDetected()); } - function markRootSuspended(root, suspendedLanes, spawnedLane) { + function markRootSuspended( + root, + suspendedLanes, + spawnedLane, + didAttemptEntireTree + ) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { var index = 31 - clz32(lanes), lane = 1 << index; - expirationTimes[index] = -1; + didAttemptEntireTree[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$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -15392,9 +15526,12 @@ __DEV__ && workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -15427,6 +15564,7 @@ __DEV__ && thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -15453,7 +15591,7 @@ __DEV__ && ); else if ( (erroredWork.mode & ProfileMode && - stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), + stopProfilerTimerIfRunningAndRecordDuration(erroredWork), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -15510,16 +15648,22 @@ __DEV__ && } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = RootSuspendedWithDelay; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } - function renderRootSync(root, lanes) { + function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(), @@ -15541,34 +15685,49 @@ __DEV__ && enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = NotSuspended; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = RootInProgress; + break a; + } + break; default: - (workInProgressSuspendedReason = NotSuspended), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$39) { - handleThrow(root, thrownValue$39); + } catch (thrownValue$38) { + handleThrow(root, thrownValue$38); } while (1); lanes && root.shellSuspendCounter++; @@ -15576,16 +15735,13 @@ __DEV__ && executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15609,7 +15765,11 @@ __DEV__ && workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering( + root, + lanes + ); enableDebugTracing && logRenderStarted(lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do @@ -15626,7 +15786,12 @@ __DEV__ && case SuspendedOnError: workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedOnError + ); break; case SuspendedOnData: if (isThenableResolved(memoizedUpdaters)) { @@ -15658,7 +15823,12 @@ __DEV__ && replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = NotSuspended), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop( + root, + lanes, + memoizedUpdaters, + SuspendedAndReadyToContinue + )); break; case SuspendedOnInstanceAndReadyToContinue: var resource = null; @@ -15690,12 +15860,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(); @@ -15710,8 +15890,8 @@ __DEV__ && ? workLoopSync() : workLoopConcurrent(); break; - } catch (thrownValue$40) { - handleThrow(root, thrownValue$40); + } catch (thrownValue$39) { + handleThrow(root, thrownValue$39); } while (1); resetContextDependencies(); @@ -15749,7 +15929,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current = runWithFiberInDEV( unitOfWork, beginWork, @@ -15757,7 +15937,7 @@ __DEV__ && unitOfWork, entangledRenderLanes )); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current ? completeUnitOfWork(unitOfWork) @@ -15765,7 +15945,7 @@ __DEV__ && } function replaySuspendedUnitOfWork(unitOfWork) { var next = runWithFiberInDEV(unitOfWork, replayBeginWork, unitOfWork); - resetCurrentFiber(); + disableStringRefs || resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === next ? completeUnitOfWork(unitOfWork) : (workInProgress = next); } @@ -15824,10 +16004,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; @@ -15851,9 +16036,9 @@ __DEV__ && workInProgress = null; return; } - } catch (error$41) { + } catch (error$40) { if (null !== returnFiber) - throw ((workInProgress = returnFiber), error$41); + throw ((workInProgress = returnFiber), error$40); workInProgressRootExitStatus = RootFatalErrored; logUncaughtError( root, @@ -15862,62 +16047,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 ((root.mode & ProfileMode) !== NoMode) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = RootDidNotComplete; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + 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; - (completedWork.mode & ProfileMode) === NoMode - ? (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; @@ -15932,12 +16107,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; @@ -15950,13 +16162,17 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15964,7 +16180,9 @@ __DEV__ && transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15977,7 +16195,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;" @@ -16008,7 +16226,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), @@ -16020,58 +16245,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), @@ -16110,7 +16335,7 @@ __DEV__ && ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableDebugTracing && enableDebugTracing && groupEnd(); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { @@ -16150,7 +16375,7 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -16166,7 +16391,7 @@ __DEV__ && return ( (Internals.p = renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), @@ -16176,15 +16401,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; @@ -16200,7 +16416,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;" @@ -16213,12 +16429,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 && @@ -16228,7 +16440,7 @@ __DEV__ && injectedProfilingHooks.markPassiveEffectsStopped(); commitDoubleInvokeEffectsInDEV(root); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -16266,9 +16478,9 @@ __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) { @@ -16349,6 +16561,7 @@ __DEV__ && var pingCache = root.pingCache; null !== pingCache && pingCache.delete(wakeable); root.pingedLanes |= root.suspendedLanes & pingedLanes; + root.warmLanes &= ~pingedLanes; enableInfiniteRenderLoopDetection && (executionContext & RenderContext ? (workInProgressRootDidIncludeRecursiveRenderUpdate = !0) @@ -16369,7 +16582,9 @@ __DEV__ && 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) { @@ -16477,12 +16692,15 @@ __DEV__ && var shouldDoubleInvokePassiveEffects = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : !0; setIsStrictModeForDevtools(!0); - disappearLayoutEffects(fiber); - shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber); - reappearLayoutEffects(root, fiber.alternate, fiber, !1); - shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); - setIsStrictModeForDevtools(!1); + try { + disappearLayoutEffects(fiber), + shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), + reappearLayoutEffects(root, fiber.alternate, fiber, !1), + shouldDoubleInvokePassiveEffects && + reconnectPassiveEffects(root, fiber, 0, null, !1); + } finally { + setIsStrictModeForDevtools(!1); + } } function commitDoubleInvokeEffectsInDEV(root) { var doubleInvokeEffects = !0; @@ -16684,9 +16902,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; @@ -16722,10 +16940,10 @@ __DEV__ && key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0, + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0, _debugInfo: null, _debugOwner: null, _debugNeedsRemount: !1, @@ -16761,8 +16979,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; @@ -16776,7 +16994,8 @@ __DEV__ && ? null : { lanes: pendingProps.lanes, - firstContext: pendingProps.firstContext + firstContext: pendingProps.firstContext, + _debugThenableState: pendingProps._debugThenableState }; workInProgress.sibling = current.sibling; workInProgress.index = current.index; @@ -16829,7 +17048,8 @@ __DEV__ && ? null : { lanes: renderLanes.lanes, - firstContext: renderLanes.firstContext + firstContext: renderLanes.firstContext, + _debugThenableState: renderLanes._debugThenableState }), (workInProgress.selfBaseDuration = current.selfBaseDuration), (workInProgress.treeBaseDuration = current.treeBaseDuration)); @@ -17110,6 +17330,7 @@ __DEV__ && this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -17134,7 +17355,7 @@ __DEV__ && tag++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); @@ -17742,10 +17963,16 @@ __DEV__ && : !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 { @@ -17754,9 +17981,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; } @@ -17774,103 +18001,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( @@ -18069,8 +18291,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$44) { - reportGlobalError(error$44); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -18091,8 +18313,8 @@ __DEV__ && previousInstance.currentTarget = currentTarget; try { _dispatchListeners$i(previousInstance); - } catch (error$44) { - reportGlobalError(error$44); + } catch (error$43) { + reportGlobalError(error$43); } previousInstance.currentTarget = null; previousInstance = instance; @@ -21091,6 +21313,14 @@ __DEV__ && ? HostContextNamespaceNone : parentNamespace; } + function beforeActiveInstanceBlur(internalInstanceHandle) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("beforeblur", !0); + event._detachedInterceptFiber = internalInstanceHandle; + target.dispatchEvent(event); + _enabled = !1; + } function shouldSetTextContent(type, props) { return ( "textarea" === type || @@ -21122,21 +21352,48 @@ __DEV__ && throw error; }); } + function commitMount(domElement, type, newProps) { + switch (type) { + case "button": + case "input": + case "select": + case "textarea": + newProps.autoFocus && domElement.focus(); + break; + case "img": + newProps.src + ? (domElement.src = newProps.src) + : newProps.srcSet && (domElement.srcset = newProps.srcSet); + } + } + function commitUpdate(domElement, type, oldProps, newProps) { + updateProperties(domElement, type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } + function resetTextContent(domElement) { + setTextContent(domElement, ""); + } + function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; + } function createEvent(type, bubbles) { var event = document.createEvent("Event"); event.initEvent(type, bubbles, !1); return event; } - function dispatchBeforeDetachedBlur(target, internalInstanceHandle) { - var event = createEvent("beforeblur", !0); - event._detachedInterceptFiber = internalInstanceHandle; - target.dispatchEvent(event); - } function dispatchAfterDetachedBlur(target) { var event = createEvent("afterblur", !1); event.relatedTarget = target; document.dispatchEvent(event); } + function removeChild(parentInstance, child) { + parentInstance.removeChild(child); + } + function removeChildFromContainer(container, child) { + container.nodeType === COMMENT_NODE + ? container.parentNode.removeChild(child) + : container.removeChild(child); + } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -21160,6 +21417,27 @@ __DEV__ && } while (node); retryIfBlockedOn(suspenseInstance); } + function hideInstance(instance) { + instance = instance.style; + "function" === typeof instance.setProperty + ? instance.setProperty("display", "none", "important") + : (instance.display = "none"); + } + function hideTextInstance(textInstance) { + textInstance.nodeValue = ""; + } + function unhideInstance(instance, props) { + props = props[STYLE]; + props = + void 0 !== props && null !== props && props.hasOwnProperty("display") + ? props.display + : null; + instance.style.display = + null == props || "boolean" === typeof props ? "" : ("" + props).trim(); + } + function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; + } function clearContainerSparingly(container) { var nextNode = container.firstChild; nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling); @@ -21360,6 +21638,12 @@ __DEV__ && } return null; } + function commitHydratedContainer(container) { + retryIfBlockedOn(container); + } + function commitHydratedSuspenseInstance(suspenseInstance) { + retryIfBlockedOn(suspenseInstance); + } function requestPostPaintCallback(callback) { localRequestAnimationFrame(function () { localRequestAnimationFrame(function (time) { @@ -21405,6 +21689,37 @@ __DEV__ && ); } } + function acquireSingletonInstance( + type, + props, + instance, + internalInstanceHandle + ) { + if (getInstanceFromNode(instance)) { + var tagName = instance.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.", + tagName, + tagName, + tagName + ); + } + switch (type) { + 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." + ); + } + for (tagName = instance.attributes; tagName.length; ) + instance.removeAttributeNode(tagName[0]); + setInitialProperties(instance, type, props); + instance[internalInstanceKey] = internalInstanceHandle; + instance[internalPropsKey] = props; + } function getHoistableRoot(container) { return "function" === typeof container.getRootNode ? container.getRootNode() @@ -22067,7 +22382,7 @@ __DEV__ && ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -22612,7 +22927,7 @@ __DEV__ && NoContext && ((workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -22882,17 +23197,21 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -23903,6 +24222,13 @@ __DEV__ && concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0, + now = Scheduler.unstable_now, + renderStartTime = -0, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0, + currentUpdateIsNested = !1, + nestedUpdateScheduled = !1, firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -25494,14 +25820,7 @@ __DEV__ && updateHookTypesDev(); return unstable_useContextWithBailout(context, select); }; - var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1, - fakeInternalInstance = {}; + var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent = new Set(); var didWarnAboutUninitializedState = new Set(); var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); @@ -25583,7 +25902,7 @@ __DEV__ && ((callback = getComponentNameFromFiber(inst) || "Unknown"), enableDebugTracing && log( - "%c\u269b\ufe0f%c " + + "%c\u269b%c " + callback + " forced update %c(" + formatLanes(lane) + @@ -25763,6 +26082,8 @@ __DEV__ && SuspendedOnHydration = 8, workInProgressSuspendedReason = NotSuspended, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = RootInProgress, @@ -25770,6 +26091,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -25785,7 +26107,6 @@ __DEV__ && rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, NESTED_UPDATE_LIMIT = 50, @@ -25797,6 +26118,9 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -25899,7 +26223,7 @@ __DEV__ && }); window.addEventListener("test", options$jscomp$0, options$jscomp$0); window.removeEventListener("test", options$jscomp$0, options$jscomp$0); - } catch (e$42) { + } catch (e$41) { passiveBrowserEventsSupported = !1; } var root = null, @@ -26613,11 +26937,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-www-modern-0ad0fac1-20240814" !== isomorphicReactPackageVersion) + if ("19.0.0-www-modern-28668d39-20241023" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-www-modern-0ad0fac1-20240814\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-www-modern-28668d39-20241023\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -26660,11 +26984,11 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.0.0-www-modern-0ad0fac1-20240814", + version: "19.0.0-www-modern-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-modern-28668d39-20241023" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27269,7 +27593,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; + exports.version = "19.0.0-www-modern-28668d39-20241023"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index cc5c83269320a..bb7268ab2e2b7 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -40,17 +40,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -243,62 +247,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -633,31 +639,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -701,11 +729,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -722,39 +745,54 @@ 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$8 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$8; - remainingLanes[index$8] = 0; - expirationTimes[index$8] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$8]; + var index$9 = 31 - clz32(remainingLanes), + lane = 1 << index$9; + entanglements[index$9] = 0; + expirationTimes[index$9] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$9]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$8] = null, index$8 = 0; - index$8 < hiddenUpdatesForLane.length; - index$8++ + hiddenUpdates[index$9] = null, index$9 = 0; + index$9 < hiddenUpdatesForLane.length; + index$9++ ) { - var update = hiddenUpdatesForLane[index$8]; + var update = hiddenUpdatesForLane[index$9]; 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; @@ -769,21 +807,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$9 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$9; - (lane & entangledLanes) | (root[index$9] & entangledLanes) && - (root[index$9] |= entangledLanes); + var index$10 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$10; + (lane & entangledLanes) | (root[index$10] & entangledLanes) && + (root[index$10] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$12 = 31 - clz32(lanes), - lane = 1 << index$12; - index$12 = root.transitionLanes[index$12]; - null !== index$12 && - index$12.forEach(function (transition) { + var index$13 = 31 - clz32(lanes), + lane = 1 << index$13; + index$13 = root.transitionLanes[index$13]; + null !== index$13 && + index$13.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -793,10 +831,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$13 = 31 - clz32(lanes), - lane = 1 << index$13; - null !== root.transitionLanes[index$13] && - (root.transitionLanes[index$13] = null); + var index$14 = 31 - clz32(lanes), + lane = 1 << index$14; + null !== root.transitionLanes[index$14] && + (root.transitionLanes[index$14] = null); lanes &= ~lane; } } @@ -970,8 +1008,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$14 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$14 && "aria-" !== prefix$14) { + var prefix$15 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$15 && "aria-" !== prefix$15) { node.removeAttribute(name); return; } @@ -1312,15 +1350,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$20 in styles) - (styleName = styles[styleName$20]), - styles.hasOwnProperty(styleName$20) && - prevStyles[styleName$20] !== styleName && - setValueForStyle(node, styleName$20, styleName); - } else for (var styleName$21 in styles) - styles.hasOwnProperty(styleName$21) && - setValueForStyle(node, styleName$21, styles[styleName$21]); + (styleName = styles[styleName$21]), + styles.hasOwnProperty(styleName$21) && + prevStyles[styleName$21] !== styleName && + setValueForStyle(node, styleName$21, styleName); + } else + for (var styleName$22 in styles) + styles.hasOwnProperty(styleName$22) && + setValueForStyle(node, styleName$22, styles[styleName$22]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1921,25 +1959,44 @@ 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$26 = firstScheduledRoot; null !== root$26; ) { - if (!onlyLegacy || (!disableLegacyMode && 0 === root$26.tag)) { - var workInProgressRootRenderLanes$28 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$28 = getNextLanes( - root$26, - root$26 === workInProgressRoot - ? workInProgressRootRenderLanes$28 - : 0 - ); - 0 !== (workInProgressRootRenderLanes$28 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$26, workInProgressRootRenderLanes$28)); - } - root$26 = root$26.next; + for (var root$27 = firstScheduledRoot; null !== root$27; ) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root$27.tag)) + if (0 !== syncTransitionLanes) { + var pendingLanes = root$27.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root$27.suspendedLanes, + pingedLanes = root$27.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$27, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root$27, + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root$27, JSCompiler_inline_result)); + root$27 = root$27.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -1947,30 +2004,29 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + var syncTransitionLanes = 0; + 0 !== currentEventTransitionLane && + (shouldAttemptEagerTransition() && + (syncTransitionLanes = currentEventTransitionLane), + (currentEventTransitionLane = 0)); for ( var currentTime = now(), 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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -1984,12 +2040,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$6 = 31 - clz32(pendingLanes), - lane = 1 << index$6, - expirationTime = expirationTimes[index$6]; + var index$7 = 31 - clz32(pendingLanes), + lane = 1 << index$7, + expirationTime = expirationTimes[index$7]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + expirationTimes[index$7] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -2012,39 +2068,62 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 scheduleImmediateTask(cb) { scheduleMicrotask(function () { @@ -2081,8 +2160,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2241,20 +2320,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$30 = workInProgress$jscomp$0.alternate; - null !== current$30 && - ((current$30 = current$30.updateQueue), - (pendingQueue = current$30.lastBaseUpdate), + var current$32 = workInProgress$jscomp$0.alternate; + null !== current$32 && + ((current$32 = current$32.updateQueue), + (pendingQueue = current$32.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$30.firstBaseUpdate = firstPendingUpdate) + ? (current$32.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$30.lastBaseUpdate = lastPendingUpdate))); + (current$32.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$30 = firstPendingUpdate = lastPendingUpdate = null; + current$32 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -2267,8 +2346,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$30 && - (current$30 = current$30.next = + null !== current$32 && + (current$32 = current$32.next = { lane: 0, tag: pendingQueue.tag, @@ -2321,10 +2400,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$30 - ? ((firstPendingUpdate = current$30 = isHiddenUpdate), + null === current$32 + ? ((firstPendingUpdate = current$32 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$30 = current$30.next = isHiddenUpdate), + : (current$32 = current$32.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -2337,10 +2416,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$30 && (lastPendingUpdate = newState); + null === current$32 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$30; + queue.lastBaseUpdate = current$32; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -3219,9 +3298,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$65 = fiber.alternate; - null !== current$65 && - null !== current$65.memoizedState && + var current$67 = fiber.alternate; + null !== current$67 && + null !== current$67.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -3339,9 +3418,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; } @@ -3491,16 +3576,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$67 = currentlyRenderingFiber$1.alternate; - null !== current$67 && - ((current$67 = current$67.updateQueue), - null !== current$67 && - ((current$67 = current$67.memoCache), - null != current$67 && + var current$69 = currentlyRenderingFiber$1.alternate; + null !== current$69 && + ((current$69 = current$69.updateQueue), + null !== current$69 && + ((current$69 = current$69.memoCache), + null != current$69 && (memoCache = { data: enableNoCloningMemoCache - ? current$67.data - : current$67.data.map(function (array) { + ? current$69.data + : current$69.data.map(function (array) { return array.slice(); }), index: 0 @@ -3515,11 +3600,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$67 = 0; - current$67 < size; - current$67++ + current$69 = 0; + current$69 < size; + current$69++ ) - updateQueue[current$67] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$69] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -3552,7 +3637,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$68 = !1; + didReadFromEntangledAsyncAction$70 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3573,11 +3658,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$68 = !0); + (didReadFromEntangledAsyncAction$70 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$68 = !0); + (didReadFromEntangledAsyncAction$70 = !0); continue; } else (updateLane = { @@ -3623,7 +3708,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$68 && + didReadFromEntangledAsyncAction$70 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3740,10 +3825,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -3821,8 +3910,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$74) { - onActionError(actionQueue, node, error$74); + } catch (error$76) { + onActionError(actionQueue, node, error$76); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4013,17 +4102,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() { @@ -4122,10 +4210,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -4187,14 +4279,26 @@ 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 { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition); } @@ -4253,7 +4357,12 @@ function ensureFormComponentIsStateful(formFiber) { } function requestFormReset$1(formFiber) { var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetState(formFiber, resetStateQueue, {}); + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } function useHostTransitionStatus() { return readContext(HostTransitionContext); @@ -4271,14 +4380,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$77 = enqueueUpdate(provider, fiber, lane); - null !== root$77 && - (scheduleUpdateOnFiber(root$77, provider, lane), - entangleTransitions(root$77, provider, lane)); + var root$79 = enqueueUpdate(provider, fiber, lane); + null !== root$79 && + (scheduleUpdateOnFiber(root$79, provider, lane), + entangleTransitions(root$79, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$77 && + null !== root$79 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4304,15 +4413,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; @@ -4326,19 +4438,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 = { @@ -4444,10 +4561,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -4455,10 +4576,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4877,9 +5002,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$81 in Component) - void 0 === newProps[propName$81] && - (newProps[propName$81] = Component[propName$81]); + for (var propName$83 in Component) + void 0 === newProps[propName$83] && + (newProps[propName$83] = Component[propName$83]); } return newProps; } @@ -5321,10 +5446,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$95 = workInProgress.stateNode; + root$97 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$95.incompleteTransitions.has(transition)) { + if (!root$97.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5332,11 +5457,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$95.incompleteTransitions.set(transition, markerInstance); + root$97.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$95.incompleteTransitions.forEach(function (markerInstance) { + root$97.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5595,6 +5720,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 && @@ -5653,6 +5779,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -5904,7 +6031,7 @@ function finishClassComponent( ) ); shouldUpdate = workInProgress.stateNode; - current = workInProgress; + disableStringRefs || (current = workInProgress); var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null @@ -7707,12 +7834,13 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } 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) { if (!isHydrating) @@ -7729,14 +7857,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$137 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$137 = lastTailNode), + for (var lastTailNode$139 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$139 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$137 + null === lastTailNode$139 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$137.sibling = null); + : (lastTailNode$139.sibling = null); } } function bubbleProperties(completedWork) { @@ -7746,19 +7874,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags & 31457280), - (subtreeFlags |= child$138.flags & 31457280), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (var child$140 = completedWork.child; null !== child$140; ) + (newChildLanes |= child$140.lanes | child$140.childLanes), + (subtreeFlags |= child$140.subtreeFlags & 31457280), + (subtreeFlags |= child$140.flags & 31457280), + (child$140.return = completedWork), + (child$140 = child$140.sibling); else - for (child$138 = completedWork.child; null !== child$138; ) - (newChildLanes |= child$138.lanes | child$138.childLanes), - (subtreeFlags |= child$138.subtreeFlags), - (subtreeFlags |= child$138.flags), - (child$138.return = completedWork), - (child$138 = child$138.sibling); + for (child$140 = completedWork.child; null !== child$140; ) + (newChildLanes |= child$140.lanes | child$140.childLanes), + (subtreeFlags |= child$140.subtreeFlags), + (subtreeFlags |= child$140.flags), + (child$140.return = completedWork), + (child$140 = child$140.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -8055,11 +8183,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$150 = null; + var cache$152 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$150 = newProps.memoizedState.cachePool.pool); - cache$150 !== type && (newProps.flags |= 2048); + (cache$152 = newProps.memoizedState.cachePool.pool); + cache$152 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -8098,8 +8226,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$150 = type.rendering; - if (null === cache$150) + cache$152 = type.rendering; + if (null === cache$152) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -8107,11 +8235,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$150 = findFirstSuspended(current); - if (null !== cache$150) { + cache$152 = findFirstSuspended(current); + if (null !== cache$152) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$150.updateQueue; + current = cache$152.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -8136,7 +8264,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$150)), null !== current)) { + if (((current = findFirstSuspended(cache$152)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -8146,7 +8274,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$150.alternate && + !cache$152.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -8159,13 +8287,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$150.sibling = workInProgress.child), - (workInProgress.child = cache$150)) + ? ((cache$152.sibling = workInProgress.child), + (workInProgress.child = cache$152)) : ((current = type.last), null !== current - ? (current.sibling = cache$150) - : (workInProgress.child = cache$150), - (type.last = cache$150)); + ? (current.sibling = cache$152) + : (workInProgress.child = cache$152), + (type.last = cache$152)); } if (null !== type.tail) return ( @@ -8388,11 +8516,76 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; +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, @@ -8450,90 +8643,209 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$168) { - captureCommitPhaseError(current, nearestMountedAncestor, error$168); + } catch (error$171) { + captureCommitPhaseError(current, nearestMountedAncestor, error$171); } 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, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$228) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - root = null; +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + focusedInstanceHandle = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; + eventsEnabled = _enabled; + root = getActiveElementDeep(root); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode; + selection = selection.focusOffset; + try { + JSCompiler_temp.nodeType, focusNode.nodeType; + } catch (e$225) { + JSCompiler_temp = null; + break a; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = root, + parentNode = null; + b: for (;;) { + for (var next; ; ) { + node !== JSCompiler_temp || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== selection && 3 !== node.nodeType) || + (end = length + selection); + 3 === node.nodeType && (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === root) break b; + parentNode === JSCompiler_temp && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === selection && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + JSCompiler_temp = + -1 === start || -1 === end ? null : { start: start, end: end }; + } else JSCompiler_temp = null; + } + JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; + root = null; JSCompiler_temp = selectionInformation.focusedElem; null !== JSCompiler_temp && (root = getClosestInstanceFromNode(JSCompiler_temp)); @@ -8558,84 +8870,93 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags, - JSCompiler_temp$jscomp$0; - if ( - (JSCompiler_temp$jscomp$0 = - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle) - ) { - var JSCompiler_temp$jscomp$1; - if ((JSCompiler_temp$jscomp$1 = 13 === firstChild.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = firstChild.memoizedState; - JSCompiler_temp$jscomp$1 = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp$jscomp$1 = !1; - } - JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$1 && - doesFiberContain(firstChild, focusedInstanceHandle); - } - JSCompiler_temp$jscomp$0 && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(firstChild)); - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } + root = firstChild.alternate; + JSCompiler_temp = firstChild.flags; + if ( + (anchorOffset = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((anchorOffset = 13 === firstChild.tag)) + a: { + if ( + null !== root && + ((anchorOffset = root.memoizedState), + null === anchorOffset || null !== anchorOffset.dehydrated) + ) { + anchorOffset = firstChild.memoizedState; + anchorOffset = + null !== anchorOffset && null === anchorOffset.dehydrated; + break a; } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps, - firstChild.elementType === firstChild.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + anchorOffset = !1; + } + anchorOffset = + anchorOffset && doesFiberContain(firstChild, focusedInstanceHandle); + } + anchorOffset && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (JSCompiler_temp & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (JSCompiler_temp & 1024) && null !== root) { + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; + root = root.memoizedState; + selection = anchorOffset.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + root + ); + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + anchorOffset, + anchorOffset.return, + error + ); } - break; - case 3: - 0 !== (flags & 1024) && - clearContainer(firstChild.stateNode.containerInfo); - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + 0 !== (JSCompiler_temp & 1024) && + clearContainer(firstChild.stateNode.containerInfo); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (JSCompiler_temp & 1024)) + throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -8646,86 +8967,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.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 destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8734,7 +8979,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); @@ -8796,7 +9041,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9043,75 +9288,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -9159,8 +9335,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -9169,39 +9349,63 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$179 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$179; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParentIsContainer = finishedRoot.onDeleted) && + prevHostParentIsContainer(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -9221,36 +9425,11 @@ function commitDeletionEffectsOnFiber( 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, @@ -9315,9 +9494,13 @@ function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { ((current$182 = current$182.memoizedState), null !== current$182 && ((current$182 = current$182.dehydrated), null !== current$182)) - ) + ) { try { retryIfBlockedOn(current$182); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + try { var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; @@ -9326,6 +9509,7 @@ function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } + } } } function getRetryCache(finishedWork) { @@ -9380,39 +9564,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; ) @@ -9430,19 +9610,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$184) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$184); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9467,56 +9638,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -9524,36 +9694,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -9561,16 +9731,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -9585,64 +9755,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$185) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$185 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9651,24 +9820,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$186) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$186); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$188) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$188); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -9677,12 +9843,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$189) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$189); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -9696,8 +9862,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$190) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$190); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9711,15 +9877,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { commitReconciliationEffects(finishedWork); currentHoistableRoot = flags; break; + case 12: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); + break; case 13: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((root = null !== finishedWork.memoizedState), + ((hoistableRoot = null !== finishedWork.memoizedState), (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? root !== current && (globalMostRecentFallbackTime = now()) - : root && !current && (globalMostRecentFallbackTime = now())); + ? hoistableRoot !== current && (globalMostRecentFallbackTime = now()) + : hoistableRoot && + !current && + (globalMostRecentFallbackTime = now())); if (flags & 4) { try { if (null !== finishedWork.memoizedState) { @@ -9729,8 +9901,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$192) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$192); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -9742,16 +9914,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; disableLegacyMode || finishedWork.mode & 1 - ? ((suspenseCallback = offscreenSubtreeIsHidden), - (retryQueue = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = suspenseCallback || domElement), - (offscreenSubtreeWasHidden = retryQueue || newProps), + ? ((nodeName = offscreenSubtreeIsHidden), + (type = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = nodeName || node), + (offscreenSubtreeWasHidden = type || nextNode), recursivelyTraverseMutationEffects(root, finishedWork), - (offscreenSubtreeWasHidden = retryQueue), - (offscreenSubtreeIsHidden = suspenseCallback)) + (offscreenSubtreeWasHidden = type), + (offscreenSubtreeIsHidden = nodeName)) : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; @@ -9760,13 +9932,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), @@ -9776,45 +9948,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; - try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); - } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + nextNode = current = root; + try { + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$173) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$173 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -9870,11 +10041,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -9887,21 +10058,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$174 = JSCompiler_inline_result.stateNode; + var parent$172 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$174, ""), + (setTextContent(parent$172, ""), (JSCompiler_inline_result.flags &= -33)); - var before$175 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$175, parent$174); + var before$173 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$173, parent$172); break; case 3: case 4: - var parent$176 = JSCompiler_inline_result.stateNode.containerInfo, - before$177 = getHostSibling(finishedWork); + var parent$174 = JSCompiler_inline_result.stateNode.containerInfo, + before$175 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$177, - parent$176 + before$175, + parent$174 ); break; default: @@ -9977,7 +10148,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$196 = parentFiber.alternate, + var current$188 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9990,7 +10161,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -9998,23 +10169,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current$188 = finishedWork; + finishedRoot = current$188.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current$188, current$188.return, error); + } + current$188 = finishedWork; + finishedRoot = current$188.updateQueue; + if (null !== finishedRoot) { + var instance = current$188.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current$188, current$188.return, error); } - current$196 = finishedWork.updateQueue; - if (null !== current$196) { - var hiddenCallbacks = current$196.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current$196.shared.hiddenCallbacks = null, current$196 = 0; - current$196 < hiddenCallbacks.length; - current$196++ - ) - callCallback(hiddenCallbacks[current$196], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10030,9 +10208,9 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$196 && + null === current$188 && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -10071,13 +10249,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 && @@ -10181,7 +10352,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -10244,6 +10415,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, @@ -10358,7 +10550,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -10377,9 +10569,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$203 = finishedWork.stateNode; + var instance$195 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$203._visibility & 4 + ? instance$195._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10392,7 +10584,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$203._visibility |= 4), + : ((instance$195._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10400,7 +10592,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$203._visibility |= 4), + : ((instance$195._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10413,7 +10605,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$203 + instance$195 ); break; case 24: @@ -10570,6 +10762,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 && @@ -10718,19 +10916,20 @@ 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; - } - }, - postPaintCallbackScheduled = !1, + 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 postPaintCallbackScheduled = !1, callbacks = []; function schedulePostPaintCallback(callback) { callbacks.push(callback); @@ -10749,6 +10948,8 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10756,6 +10957,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10864,7 +11066,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -10877,11 +11080,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing) ) { var transitionLanesMap = root.transitionLanes, - index$11 = 31 - clz32(lane), - transitions = transitionLanesMap[index$11]; + index$12 = 31 - clz32(lane), + transitions = transitionLanesMap[index$12]; null === transitions && (transitions = new Set()); transitions.add(transition); - transitionLanesMap[index$11] = transitions; + transitionLanesMap[index$12] = transitions; } } root === workInProgressRoot && @@ -10891,7 +11094,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); 2 !== lane || @@ -10899,160 +11103,178 @@ 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if ((disableLegacyMode || 0 !== root$jscomp$0.tag) && 2 === exitStatus) { + renderWasConcurrent = lanes; + 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; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + 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, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -11069,7 +11291,13 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -11085,10 +11313,16 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings); return; } commitRoot( @@ -11096,31 +11330,36 @@ function commitRootWhenReady( 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) { - 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; ) { @@ -11136,74 +11375,36 @@ 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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7; - expirationTimes[index$7] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + didAttemptEntireTree[index$8] = -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 batchedUpdates$1(fn, a) { if (disableLegacyMode) return fn(a); var prevExecutionContext = executionContext; @@ -11214,12 +11415,12 @@ function batchedUpdates$1(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now() + 500), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } function flushSyncWork$1() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -11254,8 +11455,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -11272,9 +11476,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$5 = 31 - clz32(allEntangledLanes), - lane = 1 << index$5; - lanes |= root[index$5]; + var index$6 = 31 - clz32(allEntangledLanes), + lane = 1 << index$6; + lanes |= root[index$6]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11284,10 +11488,11 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -11339,16 +11544,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -11357,6 +11568,7 @@ function renderRootSync(root, lanes) { (workInProgressTransitions = getTransitionsForLanes(root, lanes)), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11365,23 +11577,37 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + exitStatus = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$214) { - handleThrow(root, thrownValue$214); + } catch (thrownValue$211) { + handleThrow(root, thrownValue$211); } while (1); lanes && root.shellSuspendCounter++; @@ -11389,11 +11615,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11403,10 +11629,14 @@ 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 = checkIfRootIsPrerendering( + root, + lanes + )); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11416,7 +11646,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: if (isThenableResolved(thrownValue)) { @@ -11446,7 +11676,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: var resource = null; @@ -11473,12 +11703,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(); @@ -11490,8 +11720,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$216) { - handleThrow(root, thrownValue$216); + } catch (thrownValue$213) { + handleThrow(root, thrownValue$213); } while (1); resetContextDependencies(); @@ -11510,7 +11740,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); } @@ -11563,11 +11793,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; @@ -11601,31 +11836,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 (isHydrating || 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, @@ -11645,12 +11889,40 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = Internals.p; @@ -11663,13 +11935,17 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11677,7 +11953,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11693,7 +11971,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), @@ -11705,36 +11990,33 @@ 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 = Internals.p; - Internals.p = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$222 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$222 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - Internals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = Internals.p), + (Internals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + (suspendedRetryLanes = commitBeforeMutationEffects(root, finishedWork)), + commitMutationEffectsOnFiber(finishedWork, root), + suspendedRetryLanes && + ((_enabled = !0), + dispatchAfterDetachedBlur(selectionInformation.focusedElem), + (_enabled = !1)), + restoreSelection(selectionInformation, root.containerInfo), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + requestPaint(), + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11765,7 +12047,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; null !== prevRootTransitionCallbacks && @@ -11791,9 +12073,9 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { - var root$223 = rootWithPendingPassiveEffects, + var root$220 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11803,12 +12085,12 @@ function flushPassiveEffects() { return ( (Internals.p = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$223, remainingLanes); + releaseRootPooledCache(root$220, remainingLanes); } } return !1; @@ -11827,7 +12109,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, @@ -11916,6 +12198,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) @@ -11929,7 +12212,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) { @@ -12340,6 +12625,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -13123,19 +13409,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$388; + var JSCompiler_inline_result$jscomp$385; if (canUseDOM) { - var isSupported$jscomp$inline_1539 = "oninput" in document; - if (!isSupported$jscomp$inline_1539) { - var element$jscomp$inline_1540 = document.createElement("div"); - element$jscomp$inline_1540.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1539 = - "function" === typeof element$jscomp$inline_1540.oninput; + var isSupported$jscomp$inline_1567 = "oninput" in document; + if (!isSupported$jscomp$inline_1567) { + var element$jscomp$inline_1568 = document.createElement("div"); + element$jscomp$inline_1568.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1567 = + "function" === typeof element$jscomp$inline_1568.oninput; } - JSCompiler_inline_result$jscomp$388 = isSupported$jscomp$inline_1539; - } else JSCompiler_inline_result$jscomp$388 = !1; + JSCompiler_inline_result$jscomp$385 = isSupported$jscomp$inline_1567; + } else JSCompiler_inline_result$jscomp$385 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$388 && + JSCompiler_inline_result$jscomp$385 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13223,10 +13509,16 @@ function containsNode(outerNode, innerNode) { : !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 { @@ -13235,9 +13527,9 @@ function getActiveElementDeep() { } 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; } @@ -13255,101 +13547,95 @@ function hasSelectionCapabilities(elem) { "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) - ) + if (null !== priorSelectionRange && 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); } } var skipSelectionChangeEvent = @@ -13546,20 +13832,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1580 = 0; - i$jscomp$inline_1580 < simpleEventPluginEvents.length; - i$jscomp$inline_1580++ + var i$jscomp$inline_1608 = 0; + i$jscomp$inline_1608 < simpleEventPluginEvents.length; + i$jscomp$inline_1608++ ) { - var eventName$jscomp$inline_1581 = - simpleEventPluginEvents[i$jscomp$inline_1580], - domEventName$jscomp$inline_1582 = - eventName$jscomp$inline_1581.toLowerCase(), - capitalizedEvent$jscomp$inline_1583 = - eventName$jscomp$inline_1581[0].toUpperCase() + - eventName$jscomp$inline_1581.slice(1); + var eventName$jscomp$inline_1609 = + simpleEventPluginEvents[i$jscomp$inline_1608], + domEventName$jscomp$inline_1610 = + eventName$jscomp$inline_1609.toLowerCase(), + capitalizedEvent$jscomp$inline_1611 = + eventName$jscomp$inline_1609[0].toUpperCase() + + eventName$jscomp$inline_1609.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1582, - "on" + capitalizedEvent$jscomp$inline_1583 + domEventName$jscomp$inline_1610, + "on" + capitalizedEvent$jscomp$inline_1611 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14852,34 +15138,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$242 = props[hasSrc]; - if (null != propValue$242) + var propValue$239 = props[hasSrc]; + if (null != propValue$239) switch (hasSrc) { case "name": - hasSrcSet = propValue$242; + hasSrcSet = propValue$239; break; case "type": - propValue = propValue$242; + propValue = propValue$239; break; case "checked": - checked = propValue$242; + checked = propValue$239; break; case "defaultChecked": - defaultChecked = propValue$242; + defaultChecked = propValue$239; break; case "value": - propKey = propValue$242; + propKey = propValue$239; break; case "defaultValue": - defaultValue = propValue$242; + defaultValue = propValue$239; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$242) + if (null != propValue$239) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$242, props, null); + setProp(domElement, tag, hasSrc, propValue$239, props, null); } } initInput( @@ -15016,14 +15302,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$242 in props) - props.hasOwnProperty(propValue$242) && - ((hasSrc = props[propValue$242]), + for (propValue$239 in props) + props.hasOwnProperty(propValue$239) && + ((hasSrc = props[propValue$239]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$242, + propValue$239, hasSrc, props, void 0 @@ -15071,14 +15357,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$259 in nextProps) { - var propKey = nextProps[propKey$259]; - lastProp = lastProps[propKey$259]; + for (var propKey$256 in nextProps) { + var propKey = nextProps[propKey$256]; + lastProp = lastProps[propKey$256]; if ( - nextProps.hasOwnProperty(propKey$259) && + nextProps.hasOwnProperty(propKey$256) && (null != propKey || null != lastProp) ) - switch (propKey$259) { + switch (propKey$256) { case "type": type = propKey; break; @@ -15107,7 +15393,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$259, + propKey$256, propKey, nextProps, lastProp @@ -15126,7 +15412,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$259 = null; + propKey = value = defaultValue = propKey$256 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15157,7 +15443,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$259 = type; + propKey$256 = type; break; case "defaultValue": defaultValue = type; @@ -15178,15 +15464,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$259 - ? updateOptions(domElement, !!lastProps, propKey$259, !1) + null != propKey$256 + ? updateOptions(domElement, !!lastProps, propKey$256, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$259 = null; + propKey = propKey$256 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15210,7 +15496,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$259 = name; + propKey$256 = name; break; case "defaultValue": propKey = name; @@ -15224,17 +15510,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$259, propKey); + updateTextarea(domElement, propKey$256, propKey); return; case "option": - for (var propKey$275 in lastProps) + for (var propKey$272 in lastProps) if ( - ((propKey$259 = lastProps[propKey$275]), - lastProps.hasOwnProperty(propKey$275) && - null != propKey$259 && - !nextProps.hasOwnProperty(propKey$275)) + ((propKey$256 = lastProps[propKey$272]), + lastProps.hasOwnProperty(propKey$272) && + null != propKey$256 && + !nextProps.hasOwnProperty(propKey$272)) ) - switch (propKey$275) { + switch (propKey$272) { case "selected": domElement.selected = !1; break; @@ -15242,33 +15528,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$275, + propKey$272, null, nextProps, - propKey$259 + propKey$256 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$259 = nextProps[lastDefaultValue]), + ((propKey$256 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$259 !== propKey && - (null != propKey$259 || null != propKey)) + propKey$256 !== propKey && + (null != propKey$256 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$259 && - "function" !== typeof propKey$259 && - "symbol" !== typeof propKey$259; + propKey$256 && + "function" !== typeof propKey$256 && + "symbol" !== typeof propKey$256; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$259, + propKey$256, nextProps, propKey ); @@ -15289,24 +15575,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$280 in lastProps) - (propKey$259 = lastProps[propKey$280]), - lastProps.hasOwnProperty(propKey$280) && - null != propKey$259 && - !nextProps.hasOwnProperty(propKey$280) && - setProp(domElement, tag, propKey$280, null, nextProps, propKey$259); + for (var propKey$277 in lastProps) + (propKey$256 = lastProps[propKey$277]), + lastProps.hasOwnProperty(propKey$277) && + null != propKey$256 && + !nextProps.hasOwnProperty(propKey$277) && + setProp(domElement, tag, propKey$277, null, nextProps, propKey$256); for (checked in nextProps) if ( - ((propKey$259 = nextProps[checked]), + ((propKey$256 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$259 !== propKey && - (null != propKey$259 || null != propKey)) + propKey$256 !== propKey && + (null != propKey$256 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$259) + if (null != propKey$256) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15314,7 +15600,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$259, + propKey$256, nextProps, propKey ); @@ -15322,49 +15608,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$285 in lastProps) - (propKey$259 = lastProps[propKey$285]), - lastProps.hasOwnProperty(propKey$285) && - void 0 !== propKey$259 && - !nextProps.hasOwnProperty(propKey$285) && + for (var propKey$282 in lastProps) + (propKey$256 = lastProps[propKey$282]), + lastProps.hasOwnProperty(propKey$282) && + void 0 !== propKey$256 && + !nextProps.hasOwnProperty(propKey$282) && setPropOnCustomElement( domElement, tag, - propKey$285, + propKey$282, void 0, nextProps, - propKey$259 + propKey$256 ); for (defaultChecked in nextProps) - (propKey$259 = nextProps[defaultChecked]), + (propKey$256 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$259 === propKey || - (void 0 === propKey$259 && void 0 === propKey) || + propKey$256 === propKey || + (void 0 === propKey$256 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$259, + propKey$256, nextProps, propKey ); return; } } - for (var propKey$290 in lastProps) - (propKey$259 = lastProps[propKey$290]), - lastProps.hasOwnProperty(propKey$290) && - null != propKey$259 && - !nextProps.hasOwnProperty(propKey$290) && - setProp(domElement, tag, propKey$290, null, nextProps, propKey$259); + for (var propKey$287 in lastProps) + (propKey$256 = lastProps[propKey$287]), + lastProps.hasOwnProperty(propKey$287) && + null != propKey$256 && + !nextProps.hasOwnProperty(propKey$287) && + setProp(domElement, tag, propKey$287, null, nextProps, propKey$256); for (lastProp in nextProps) - (propKey$259 = nextProps[lastProp]), + (propKey$256 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$259 === propKey || - (null == propKey$259 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$259, nextProps, propKey); + propKey$256 === propKey || + (null == propKey$256 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$256, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15959,26 +16245,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$298 = getResourcesFromRoot( + var styles$295 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$299 = styles$298.get(type); - resource$299 || + resource$296 = styles$295.get(type); + resource$296 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$299 = { + (resource$296 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$298.set(type, resource$299), - (styles$298 = JSCompiler_inline_result.querySelector( + styles$295.set(type, resource$296), + (styles$295 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$298._p && - ((resource$299.instance = styles$298), - (resource$299.state.loading = 5)), + !styles$295._p && + ((resource$296.instance = styles$295), + (resource$296.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15991,16 +16277,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$298 || + styles$295 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$299.state + resource$296.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$299; + return resource$296; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16097,37 +16383,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$304 = hoistableRoot.querySelector( + var instance$301 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$304) + if (instance$301) return ( (resource.state.loading |= 4), - (resource.instance = instance$304), - markNodeAsHoistable(instance$304), - instance$304 + (resource.instance = instance$301), + markNodeAsHoistable(instance$301), + instance$301 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$304 = ( + instance$301 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$304); - var linkInstance = instance$304; + markNodeAsHoistable(instance$301); + var linkInstance = instance$301; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$304, "link", instance); + setInitialProperties(instance$301, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$304, props.precedence, hoistableRoot); - return (resource.instance = instance$304); + insertStylesheet(instance$301, props.precedence, hoistableRoot); + return (resource.instance = instance$301); case "script": - instance$304 = getScriptKey(props.src); + instance$301 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$304) + getScriptSelectorFromKey(instance$301) )) ) return ( @@ -16136,7 +16422,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$304))) + if ((styleProps = preloadPropsMap.get(instance$301))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16397,7 +16683,7 @@ function insertStylesheetIntoRoot(root, resource) { ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -16948,7 +17234,7 @@ function dispatchEvent( ensureRootIsScheduled(fiber); 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -17168,16 +17454,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1753 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1781 = React.version; if ( - "19.0.0-www-classic-0ad0fac1-20240814" !== - isomorphicReactPackageVersion$jscomp$inline_1753 + "19.0.0-www-classic-28668d39-20241023" !== + isomorphicReactPackageVersion$jscomp$inline_1781 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1753, - "19.0.0-www-classic-0ad0fac1-20240814" + isomorphicReactPackageVersion$jscomp$inline_1781, + "19.0.0-www-classic-28668d39-20241023" ) ); function flushSyncFromReconciler(fn) { @@ -17200,7 +17486,7 @@ function flushSyncFromReconciler(fn) { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), (executionContext = prevExecutionContext), - 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(0, !1); } JSCompiler_inline_result = void 0; } @@ -17220,25 +17506,25 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2208 = { +var internals$jscomp$inline_2294 = { bundleType: 0, - version: "19.0.0-www-classic-0ad0fac1-20240814", + version: "19.0.0-www-classic-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-classic-28668d39-20241023" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2209 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2295 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2209.isDisabled && - hook$jscomp$inline_2209.supportsFiber + !hook$jscomp$inline_2295.isDisabled && + hook$jscomp$inline_2295.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2209.inject( - internals$jscomp$inline_2208 + (rendererID = hook$jscomp$inline_2295.inject( + internals$jscomp$inline_2294 )), - (injectedHook = hook$jscomp$inline_2209); + (injectedHook = hook$jscomp$inline_2295); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17312,11 +17598,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$325); + var instance = getPublicRootInstance(root$322); originalCallback.call(instance); }; } - var root$325 = createHydrationContainer( + var root$322 = createHydrationContainer( initialChildren, callback, container, @@ -17331,23 +17617,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$325; - container[internalContainerInstanceKey] = root$325.current; + container._reactRootContainer = root$322; + container[internalContainerInstanceKey] = root$322.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSyncWork$1(); - return root$325; + return root$322; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$326 = callback; + var originalCallback$323 = callback; callback = function () { - var instance = getPublicRootInstance(root$327); - originalCallback$326.call(instance); + var instance = getPublicRootInstance(root$324); + originalCallback$323.call(instance); }; } - var root$327 = createFiberRoot( + var root$324 = createFiberRoot( container, 0, !1, @@ -17361,14 +17647,14 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$327; - container[internalContainerInstanceKey] = root$327.current; + container._reactRootContainer = root$324; + container[internalContainerInstanceKey] = root$324.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); - updateContainerSync(initialChildren, root$327, parentComponent, callback); + updateContainerSync(initialChildren, root$324, parentComponent, callback); flushSyncWork$1(); - return root$327; + return root$324; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -17682,4 +17968,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; +exports.version = "19.0.0-www-classic-28668d39-20241023"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 909e3e1c5714d..2fbb2caaa21cd 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -38,17 +38,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -174,62 +178,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -564,31 +570,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -632,11 +660,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -653,39 +676,54 @@ 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$8 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$8; - remainingLanes[index$8] = 0; - expirationTimes[index$8] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$8]; + var index$9 = 31 - clz32(remainingLanes), + lane = 1 << index$9; + entanglements[index$9] = 0; + expirationTimes[index$9] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$9]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$8] = null, index$8 = 0; - index$8 < hiddenUpdatesForLane.length; - index$8++ + hiddenUpdates[index$9] = null, index$9 = 0; + index$9 < hiddenUpdatesForLane.length; + index$9++ ) { - var update = hiddenUpdatesForLane[index$8]; + var update = hiddenUpdatesForLane[index$9]; 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; @@ -700,21 +738,21 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$9 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$9; - (lane & entangledLanes) | (root[index$9] & entangledLanes) && - (root[index$9] |= entangledLanes); + var index$10 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$10; + (lane & entangledLanes) | (root[index$10] & entangledLanes) && + (root[index$10] |= entangledLanes); rootEntangledLanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$12 = 31 - clz32(lanes), - lane = 1 << index$12; - index$12 = root.transitionLanes[index$12]; - null !== index$12 && - index$12.forEach(function (transition) { + var index$13 = 31 - clz32(lanes), + lane = 1 << index$13; + index$13 = root.transitionLanes[index$13]; + null !== index$13 && + index$13.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -724,10 +762,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$13 = 31 - clz32(lanes), - lane = 1 << index$13; - null !== root.transitionLanes[index$13] && - (root.transitionLanes[index$13] = null); + var index$14 = 31 - clz32(lanes), + lane = 1 << index$14; + null !== root.transitionLanes[index$14] && + (root.transitionLanes[index$14] = null); lanes &= ~lane; } } @@ -901,8 +939,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$14 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$14 && "aria-" !== prefix$14) { + var prefix$15 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$15 && "aria-" !== prefix$15) { node.removeAttribute(name); return; } @@ -1233,15 +1271,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$20 in styles) - (styleName = styles[styleName$20]), - styles.hasOwnProperty(styleName$20) && - prevStyles[styleName$20] !== styleName && - setValueForStyle(node, styleName$20, styleName); - } else for (var styleName$21 in styles) - styles.hasOwnProperty(styleName$21) && - setValueForStyle(node, styleName$21, styles[styleName$21]); + (styleName = styles[styleName$21]), + styles.hasOwnProperty(styleName$21) && + prevStyles[styleName$21] !== styleName && + setValueForStyle(node, styleName$21, styleName); + } else + for (var styleName$22 in styles) + styles.hasOwnProperty(styleName$22) && + setValueForStyle(node, styleName$22, styles[styleName$22]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1764,25 +1802,44 @@ 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$26 = firstScheduledRoot; null !== root$26; ) { - if (!onlyLegacy) { - var workInProgressRootRenderLanes$28 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$28 = getNextLanes( - root$26, - root$26 === workInProgressRoot - ? workInProgressRootRenderLanes$28 - : 0 - ); - 0 !== (workInProgressRootRenderLanes$28 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$26, workInProgressRootRenderLanes$28)); - } - root$26 = root$26.next; + for (var root$27 = firstScheduledRoot; null !== root$27; ) { + if (!onlyLegacy) + if (0 !== syncTransitionLanes) { + var pendingLanes = root$27.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root$27.suspendedLanes, + pingedLanes = root$27.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$27, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root$27, + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root$27, JSCompiler_inline_result)); + root$27 = root$27.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -1790,30 +1847,29 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; + var syncTransitionLanes = 0; + 0 !== currentEventTransitionLane && + (shouldAttemptEagerTransition() && + (syncTransitionLanes = currentEventTransitionLane), + (currentEventTransitionLane = 0)); for ( var currentTime = now(), 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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -1827,12 +1883,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$6 = 31 - clz32(pendingLanes), - lane = 1 << index$6, - expirationTime = expirationTimes[index$6]; + var index$7 = 31 - clz32(pendingLanes), + lane = 1 << index$7, + expirationTime = expirationTimes[index$7]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + expirationTimes[index$7] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1855,39 +1911,62 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 scheduleImmediateTask(cb) { scheduleMicrotask(function () { @@ -1924,8 +2003,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2084,20 +2163,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$30 = workInProgress$jscomp$0.alternate; - null !== current$30 && - ((current$30 = current$30.updateQueue), - (pendingQueue = current$30.lastBaseUpdate), + var current$32 = workInProgress$jscomp$0.alternate; + null !== current$32 && + ((current$32 = current$32.updateQueue), + (pendingQueue = current$32.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$30.firstBaseUpdate = firstPendingUpdate) + ? (current$32.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$30.lastBaseUpdate = lastPendingUpdate))); + (current$32.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$30 = firstPendingUpdate = lastPendingUpdate = null; + current$32 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -2110,8 +2189,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$30 && - (current$30 = current$30.next = + null !== current$32 && + (current$32 = current$32.next = { lane: 0, tag: pendingQueue.tag, @@ -2164,10 +2243,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$30 - ? ((firstPendingUpdate = current$30 = isHiddenUpdate), + null === current$32 + ? ((firstPendingUpdate = current$32 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$30 = current$30.next = isHiddenUpdate), + : (current$32 = current$32.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -2180,10 +2259,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$30 && (lastPendingUpdate = newState); + null === current$32 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$30; + queue.lastBaseUpdate = current$32; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -3054,9 +3133,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$65 = fiber.alternate; - null !== current$65 && - null !== current$65.memoizedState && + var current$67 = fiber.alternate; + null !== current$67 && + null !== current$67.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -3174,9 +3253,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; } @@ -3326,16 +3411,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$67 = currentlyRenderingFiber$1.alternate; - null !== current$67 && - ((current$67 = current$67.updateQueue), - null !== current$67 && - ((current$67 = current$67.memoCache), - null != current$67 && + var current$69 = currentlyRenderingFiber$1.alternate; + null !== current$69 && + ((current$69 = current$69.updateQueue), + null !== current$69 && + ((current$69 = current$69.memoCache), + null != current$69 && (memoCache = { data: enableNoCloningMemoCache - ? current$67.data - : current$67.data.map(function (array) { + ? current$69.data + : current$69.data.map(function (array) { return array.slice(); }), index: 0 @@ -3350,11 +3435,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$67 = 0; - current$67 < size; - current$67++ + current$69 = 0; + current$69 < size; + current$69++ ) - updateQueue[current$67] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$69] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -3387,7 +3472,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$68 = !1; + didReadFromEntangledAsyncAction$70 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3408,11 +3493,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$68 = !0); + (didReadFromEntangledAsyncAction$70 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$68 = !0); + (didReadFromEntangledAsyncAction$70 = !0); continue; } else (updateLane = { @@ -3458,7 +3543,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$68 && + didReadFromEntangledAsyncAction$70 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3575,10 +3660,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -3656,8 +3745,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$74) { - onActionError(actionQueue, node, error$74); + } catch (error$76) { + onActionError(actionQueue, node, error$76); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3848,17 +3937,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() { @@ -3957,10 +4045,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -4022,14 +4114,26 @@ 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 { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition); } @@ -4088,7 +4192,7 @@ function ensureFormComponentIsStateful(formFiber) { } function requestFormReset$1(formFiber) { var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetState(formFiber, resetStateQueue, {}); + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); } function useHostTransitionStatus() { return readContext(HostTransitionContext); @@ -4106,14 +4210,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$77 = enqueueUpdate(provider, fiber, lane); - null !== root$77 && - (scheduleUpdateOnFiber(root$77, provider, lane), - entangleTransitions(root$77, provider, lane)); + var root$79 = enqueueUpdate(provider, fiber, lane); + null !== root$79 && + (scheduleUpdateOnFiber(root$79, provider, lane), + entangleTransitions(root$79, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$77 && + null !== root$79 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4139,15 +4243,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; @@ -4161,19 +4268,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 = { @@ -4279,10 +4391,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -4290,10 +4406,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4650,9 +4770,9 @@ function resolveClassComponentProps( (disableDefaultPropsExceptForClasses || !alreadyResolvedDefaultProps) ) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$81 in Component) - void 0 === newProps[propName$81] && - (newProps[propName$81] = Component[propName$81]); + for (var propName$83 in Component) + void 0 === newProps[propName$83] && + (newProps[propName$83] = Component[propName$83]); } return newProps; } @@ -5028,10 +5148,10 @@ var markerInstanceStack = createCursor(null); function pushRootMarkerInstance(workInProgress) { if (enableTransitionTracing) { var transitions = workInProgressTransitions, - root$94 = workInProgress.stateNode; + root$96 = workInProgress.stateNode; null !== transitions && transitions.forEach(function (transition) { - if (!root$94.incompleteTransitions.has(transition)) { + if (!root$96.incompleteTransitions.has(transition)) { var markerInstance = { tag: 0, transitions: new Set([transition]), @@ -5039,11 +5159,11 @@ function pushRootMarkerInstance(workInProgress) { aborts: null, name: null }; - root$94.incompleteTransitions.set(transition, markerInstance); + root$96.incompleteTransitions.set(transition, markerInstance); } }); var markerInstances = []; - root$94.incompleteTransitions.forEach(function (markerInstance) { + root$96.incompleteTransitions.forEach(function (markerInstance) { markerInstances.push(markerInstance); }); push(markerInstanceStack, markerInstances); @@ -5294,6 +5414,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 && @@ -5346,6 +5467,7 @@ function replayFunctionComponent( renderLanes ) { prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -5605,7 +5727,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 @@ -7299,12 +7421,13 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } 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) { if (!isHydrating) @@ -7321,14 +7444,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$129 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$129 = lastTailNode), + for (var lastTailNode$131 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$131 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$129 + null === lastTailNode$131 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$129.sibling = null); + : (lastTailNode$131.sibling = null); } } function bubbleProperties(completedWork) { @@ -7338,19 +7461,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags & 31457280), - (subtreeFlags |= child$130.flags & 31457280), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (var child$132 = completedWork.child; null !== child$132; ) + (newChildLanes |= child$132.lanes | child$132.childLanes), + (subtreeFlags |= child$132.subtreeFlags & 31457280), + (subtreeFlags |= child$132.flags & 31457280), + (child$132.return = completedWork), + (child$132 = child$132.sibling); else - for (child$130 = completedWork.child; null !== child$130; ) - (newChildLanes |= child$130.lanes | child$130.childLanes), - (subtreeFlags |= child$130.subtreeFlags), - (subtreeFlags |= child$130.flags), - (child$130.return = completedWork), - (child$130 = child$130.sibling); + for (child$132 = completedWork.child; null !== child$132; ) + (newChildLanes |= child$132.lanes | child$132.childLanes), + (subtreeFlags |= child$132.subtreeFlags), + (subtreeFlags |= child$132.flags), + (child$132.return = completedWork), + (child$132 = child$132.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -7639,11 +7762,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$142 = null; + var cache$144 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$142 = newProps.memoizedState.cachePool.pool); - cache$142 !== type && (newProps.flags |= 2048); + (cache$144 = newProps.memoizedState.cachePool.pool); + cache$144 !== type && (newProps.flags |= 2048); } renderLanes !== current && (enableTransitionTracing && (workInProgress.child.flags |= 2048), @@ -7677,8 +7800,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$142 = type.rendering; - if (null === cache$142) + cache$144 = type.rendering; + if (null === cache$144) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -7686,11 +7809,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$142 = findFirstSuspended(current); - if (null !== cache$142) { + cache$144 = findFirstSuspended(current); + if (null !== cache$144) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$142.updateQueue; + current = cache$144.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -7715,7 +7838,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$142)), null !== current)) { + if (((current = findFirstSuspended(cache$144)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -7725,7 +7848,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$142.alternate && + !cache$144.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -7738,13 +7861,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$142.sibling = workInProgress.child), - (workInProgress.child = cache$142)) + ? ((cache$144.sibling = workInProgress.child), + (workInProgress.child = cache$144)) : ((current = type.last), null !== current - ? (current.sibling = cache$142) - : (workInProgress.child = cache$142), - (type.last = cache$142)); + ? (current.sibling = cache$144) + : (workInProgress.child = cache$144), + (type.last = cache$144)); } if (null !== type.tail) return ( @@ -7956,11 +8079,76 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null; +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, @@ -8018,93 +8206,212 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$159) { - captureCommitPhaseError(current, nearestMountedAncestor, error$159); + } catch (error$162) { + captureCommitPhaseError(current, nearestMountedAncestor, error$162); } 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, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - eventsEnabled = _enabled; - root = getActiveElementDeep(); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$219) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - root = null; - JSCompiler_temp = selectionInformation.focusedElem; - null !== JSCompiler_temp && - (root = getClosestInstanceFromNode(JSCompiler_temp)); +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + focusedInstanceHandle = null, + shouldFireAfterActiveInstanceBlur = !1; +function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; + eventsEnabled = _enabled; + root = getActiveElementDeep(root); + if (hasSelectionCapabilities(root)) { + if ("selectionStart" in root) + var JSCompiler_temp = { + start: root.selectionStart, + end: root.selectionEnd + }; + else + a: { + JSCompiler_temp = + ((JSCompiler_temp = root.ownerDocument) && + JSCompiler_temp.defaultView) || + window; + var selection = + JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); + if (selection && 0 !== selection.rangeCount) { + JSCompiler_temp = selection.anchorNode; + var anchorOffset = selection.anchorOffset, + focusNode = selection.focusNode; + selection = selection.focusOffset; + try { + JSCompiler_temp.nodeType, focusNode.nodeType; + } catch (e$216) { + JSCompiler_temp = null; + break a; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = root, + parentNode = null; + b: for (;;) { + for (var next; ; ) { + node !== JSCompiler_temp || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== selection && 3 !== node.nodeType) || + (end = length + selection); + 3 === node.nodeType && (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === root) break b; + parentNode === JSCompiler_temp && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === selection && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + JSCompiler_temp = + -1 === start || -1 === end ? null : { start: start, end: end }; + } else JSCompiler_temp = null; + } + JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; + root = null; + JSCompiler_temp = selectionInformation.focusedElem; + null !== JSCompiler_temp && + (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; for (nextEffect = firstChild; null !== nextEffect; ) { @@ -8126,97 +8433,108 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags, - JSCompiler_temp$jscomp$0; - if ( - (JSCompiler_temp$jscomp$0 = - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle) - ) { - var JSCompiler_temp$jscomp$1; - if ((JSCompiler_temp$jscomp$1 = 13 === firstChild.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = firstChild.memoizedState; - JSCompiler_temp$jscomp$1 = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp$jscomp$1 = !1; - } - JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$1 && - doesFiberContain(firstChild, focusedInstanceHandle); - } - JSCompiler_temp$jscomp$0 && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(firstChild)); - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps, - firstChild.elementType === firstChild.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + root = firstChild.alternate; + JSCompiler_temp = firstChild.flags; + if ( + (anchorOffset = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((anchorOffset = 13 === firstChild.tag)) + a: { + if ( + null !== root && + ((anchorOffset = root.memoizedState), + null === anchorOffset || null !== anchorOffset.dehydrated) + ) { + anchorOffset = firstChild.memoizedState; + anchorOffset = + null !== anchorOffset && null === anchorOffset.dehydrated; + break a; } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + anchorOffset = !1; + } + anchorOffset = + anchorOffset && doesFiberContain(firstChild, focusedInstanceHandle); + } + anchorOffset && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (JSCompiler_temp & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (JSCompiler_temp & 1024) && null !== root) { + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; + root = root.memoizedState; + selection = anchorOffset.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + root + ); + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + anchorOffset, + anchorOffset.return, + error + ); } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + if (0 !== (JSCompiler_temp & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (JSCompiler_temp & 1024)) + throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -8227,86 +8545,10 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.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 destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - } - effect = effect.next; - } while (effect !== finishedWork); - } -} -function commitHookLayoutEffects(finishedWork, hookFlags) { - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8315,7 +8557,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); @@ -8377,7 +8619,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -8619,75 +8861,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -8735,8 +8908,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -8745,39 +8922,63 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$170 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$170; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParentIsContainer = finishedRoot.onDeleted) && + prevHostParentIsContainer(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -8797,36 +8998,11 @@ function commitDeletionEffectsOnFiber( 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, @@ -8885,9 +9061,13 @@ function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { ((current$173 = current$173.memoizedState), null !== current$173 && ((current$173 = current$173.dehydrated), null !== current$173)) - ) + ) { try { retryIfBlockedOn(current$173); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } + try { var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; @@ -8896,6 +9076,7 @@ function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } + } } } function getRetryCache(finishedWork) { @@ -8950,39 +9131,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; ) @@ -9000,19 +9177,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$175) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$175); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookEffectListUnmount(5, finishedWork, finishedWork.return)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9037,56 +9205,55 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - if (flags & 4) - if ( - ((root = null !== current ? current.memoizedState : null), - (flags = finishedWork.memoizedState), - null === current) - ) + if (flags & 4) { + var currentResource = null !== current ? current.memoizedState : null; + flags = finishedWork.memoizedState; + if (null === current) if (null === flags) if (null === finishedWork.stateNode) { a: { flags = finishedWork.type; current = finishedWork.memoizedProps; - root = hoistableRoot.ownerDocument || hoistableRoot; + hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; b: switch (flags) { case "title": - hoistableRoot = root.getElementsByTagName("title")[0]; + currentResource = + hoistableRoot.getElementsByTagName("title")[0]; if ( - !hoistableRoot || - hoistableRoot[internalHoistableMarker] || - hoistableRoot[internalInstanceKey] || + !currentResource || + currentResource[internalHoistableMarker] || + currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === - hoistableRoot.namespaceURI || - hoistableRoot.hasAttribute("itemprop") + currentResource.namespaceURI || + currentResource.hasAttribute("itemprop") ) - (hoistableRoot = root.createElement(flags)), - root.head.insertBefore( - hoistableRoot, - root.querySelector("head > title") + (currentResource = hoistableRoot.createElement(flags)), + hoistableRoot.head.insertBefore( + currentResource, + hoistableRoot.querySelector("head > title") ); - setInitialProperties(hoistableRoot, flags, current); - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + setInitialProperties(currentResource, flags, current); + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; break a; case "link": var maybeNodes = getHydratableHoistableCache( "link", "href", - root + hoistableRoot ).get(flags + (current.href || "")); if (maybeNodes) for (var i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("href") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("href") === (null == current.href ? null : current.href) && - hoistableRoot.getAttribute("rel") === + currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && - hoistableRoot.getAttribute("title") === + currentResource.getAttribute("title") === (null == current.title ? null : current.title) && - hoistableRoot.getAttribute("crossorigin") === + currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) @@ -9094,36 +9261,36 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; case "meta": if ( (maybeNodes = getHydratableHoistableCache( "meta", "content", - root + hoistableRoot ).get(flags + (current.content || ""))) ) for (i = 0; i < maybeNodes.length; i++) if ( - ((hoistableRoot = maybeNodes[i]), - hoistableRoot.getAttribute("content") === + ((currentResource = maybeNodes[i]), + currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && - hoistableRoot.getAttribute("name") === + currentResource.getAttribute("name") === (null == current.name ? null : current.name) && - hoistableRoot.getAttribute("property") === + currentResource.getAttribute("property") === (null == current.property ? null : current.property) && - hoistableRoot.getAttribute("http-equiv") === + currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && - hoistableRoot.getAttribute("charset") === + currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) @@ -9131,16 +9298,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { maybeNodes.splice(i, 1); break b; } - hoistableRoot = root.createElement(flags); - setInitialProperties(hoistableRoot, flags, current); - root.head.appendChild(hoistableRoot); + currentResource = hoistableRoot.createElement(flags); + setInitialProperties(currentResource, flags, current); + hoistableRoot.head.appendChild(currentResource); break; default: throw Error(formatProdErrorMessage(468, flags)); } - hoistableRoot[internalInstanceKey] = finishedWork; - markNodeAsHoistable(hoistableRoot); - flags = hoistableRoot; + currentResource[internalInstanceKey] = finishedWork; + markNodeAsHoistable(currentResource); + flags = currentResource; } finishedWork.stateNode = flags; } else @@ -9155,64 +9322,63 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$176) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$176 - ); - } + else + currentResource !== flags + ? (null === currentResource + ? null !== current.stateNode && + ((current = current.stateNode), + current.parentNode.removeChild(current)) + : currentResource.count--, + null === flags + ? mountHoistable( + hoistableRoot, + finishedWork.type, + finishedWork.stateNode + ) + : acquireResource( + hoistableRoot, + flags, + finishedWork.memoizedProps + )) + : null === flags && + null !== finishedWork.stateNode && + commitHostUpdate( + finishedWork, + finishedWork.memoizedProps, + current.memoizedProps + ); + } break; case 27: if (flags & 4 && null === finishedWork.alternate) { hoistableRoot = finishedWork.stateNode; - maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + currentResource = finishedWork.memoizedProps; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, currentResource); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = currentResource; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9221,24 +9387,21 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== current && safelyDetachRef(current, current.return); if (finishedWork.flags & 32) { - root = finishedWork.stateNode; - try { - setTextContent(root, ""); - } catch (error$177) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$177); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; + hoistableRoot = finishedWork.stateNode; try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$179) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$179); + setTextContent(hoistableRoot, ""); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((hoistableRoot = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + hoistableRoot, + null !== current ? current.memoizedProps : hoistableRoot + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -9247,12 +9410,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$180) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$180); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; @@ -9266,8 +9429,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$181) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$181); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); @@ -9279,17 +9442,23 @@ function commitMutationEffectsOnFiber(finishedWork, root) { ); recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); - currentHoistableRoot = flags; + currentHoistableRoot = flags; + break; + case 12: + recursivelyTraverseMutationEffects(root, finishedWork); + commitReconciliationEffects(finishedWork); break; case 13: recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); finishedWork.child.flags & 8192 && - ((root = null !== finishedWork.memoizedState), + ((hoistableRoot = null !== finishedWork.memoizedState), (current = null !== current && null !== current.memoizedState), alwaysThrottleRetries - ? root !== current && (globalMostRecentFallbackTime = now()) - : root && !current && (globalMostRecentFallbackTime = now())); + ? hoistableRoot !== current && (globalMostRecentFallbackTime = now()) + : hoistableRoot && + !current && + (globalMostRecentFallbackTime = now())); if (flags & 4) { try { if (null !== finishedWork.memoizedState) { @@ -9299,8 +9468,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -9312,15 +9481,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9328,13 +9497,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9343,45 +9512,44 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (currentResource = hoistableRoot.style), + "function" === typeof currentResource.setProperty + ? currentResource.setProperty( + "display", + "none", + "important" + ) + : (currentResource.display = "none"); + else { + maybeNodes = nextNode.stateNode; + i = nextNode.memoizedProps.style; + var display = + void 0 !== i && null !== i && i.hasOwnProperty("display") + ? i.display + : null; + maybeNodes.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$164) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$164 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -9437,11 +9605,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -9454,21 +9622,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$165 = JSCompiler_inline_result.stateNode; + var parent$163 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$165, ""), + (setTextContent(parent$163, ""), (JSCompiler_inline_result.flags &= -33)); - var before$166 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$166, parent$165); + var before$164 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$164, parent$163); break; case 3: case 4: - var parent$167 = JSCompiler_inline_result.stateNode.containerInfo, - before$168 = getHostSibling(finishedWork); + var parent$165 = JSCompiler_inline_result.stateNode.containerInfo, + before$166 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$168, - parent$167 + before$166, + parent$165 ); break; default: @@ -9544,7 +9712,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$187 = parentFiber.alternate, + var current$179 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -9557,7 +9725,7 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - commitHookLayoutEffects(finishedWork, 4); + commitHookEffectListMount(4, finishedWork); break; case 1: recursivelyTraverseReappearLayoutEffects( @@ -9565,23 +9733,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current$179 = finishedWork; + finishedRoot = current$179.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current$179, current$179.return, error); + } + current$179 = finishedWork; + finishedRoot = current$179.updateQueue; + if (null !== finishedRoot) { + var instance = current$179.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current$179, current$179.return, error); } - current$187 = finishedWork.updateQueue; - if (null !== current$187) { - var hiddenCallbacks = current$187.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current$187.shared.hiddenCallbacks = null, current$187 = 0; - current$187 < hiddenCallbacks.length; - current$187++ - ) - callCallback(hiddenCallbacks[current$187], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -9597,9 +9772,9 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$187 && + null === current$179 && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: @@ -9638,13 +9813,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 && @@ -9748,7 +9916,7 @@ function commitPassiveMountOnFiber( committedLanes, committedTransitions ); - flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookEffectListMount(9, finishedWork); break; case 3: recursivelyTraversePassiveMountEffects( @@ -9811,6 +9979,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, @@ -9914,7 +10103,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookEffectListMount(8, finishedWork); break; case 23: recursivelyTraverseReconnectPassiveEffects( @@ -9933,9 +10122,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$194 = finishedWork.stateNode; + var instance$186 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$194._visibility & 4 + ? instance$186._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9947,7 +10136,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$194._visibility |= 4), + : ((instance$186._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -9960,7 +10149,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$194 + instance$186 ); break; case 24: @@ -10117,6 +10306,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 && @@ -10265,19 +10460,20 @@ 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; - } - }, - postPaintCallbackScheduled = !1, + 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 postPaintCallbackScheduled = !1, callbacks = []; function schedulePostPaintCallback(callback) { callbacks.push(callback); @@ -10296,6 +10492,8 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10303,6 +10501,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10409,7 +10608,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -10422,11 +10622,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$11 = 31 - clz32(lane), - transitions = transitionLanesMap[index$11]; + index$12 = 31 - clz32(lane), + transitions = transitionLanesMap[index$12]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$11] = transitions; + transitionLanesMap[index$12] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -10435,162 +10635,181 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); 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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + 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; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent + ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + 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, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -10607,7 +10826,13 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -10623,10 +10848,16 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings); return; } commitRoot( @@ -10634,31 +10865,36 @@ function commitRootWhenReady( 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) { - 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; ) { @@ -10674,77 +10910,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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7; - expirationTimes[index$7] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + didAttemptEntireTree[index$8] = -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$1() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -10779,8 +10977,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -10797,9 +10998,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$5 = 31 - clz32(allEntangledLanes), - lane = 1 << index$5; - lanes |= root[index$5]; + var index$6 = 31 - clz32(allEntangledLanes), + lane = 1 << index$6; + lanes |= root[index$6]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10809,10 +11010,11 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -10864,16 +11066,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -10882,6 +11090,7 @@ function renderRootSync(root, lanes) { (workInProgressTransitions = getTransitionsForLanes(root, lanes)), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -10890,23 +11099,37 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + exitStatus = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, unitOfWork, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$205) { - handleThrow(root, thrownValue$205); + } catch (thrownValue$202) { + handleThrow(root, thrownValue$202); } while (1); lanes && root.shellSuspendCounter++; @@ -10914,11 +11137,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -10928,10 +11151,14 @@ 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 = checkIfRootIsPrerendering( + root, + lanes + )); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -10941,7 +11168,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, thrownValue); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 1); break; case 2: if (isThenableResolved(thrownValue)) { @@ -10971,7 +11198,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, thrownValue)); + throwAndUnwindWorkLoop(root, lanes, thrownValue, 7)); break; case 5: var resource = null; @@ -10998,12 +11225,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(); @@ -11015,8 +11242,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$207) { - handleThrow(root, thrownValue$207); + } catch (thrownValue$204) { + handleThrow(root, thrownValue$204); } while (1); resetContextDependencies(); @@ -11035,7 +11262,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); } @@ -11084,11 +11311,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; @@ -11122,31 +11354,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 (isHydrating || 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, @@ -11166,12 +11407,40 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + next = unitOfWork.return; + null !== next && + ((next.flags |= 32768), (next.subtreeFlags = 0), (next.deletions = null)); + if ( + !skipSiblings && + ((unitOfWork = unitOfWork.sibling), null !== unitOfWork) + ) { + workInProgress = unitOfWork; + return; + } + workInProgress = unitOfWork = next; + } while (null !== unitOfWork); + workInProgressRootExitStatus = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = Internals.p; @@ -11184,13 +11453,17 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11198,7 +11471,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11214,7 +11489,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), @@ -11226,36 +11508,33 @@ 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 = Internals.p; - Internals.p = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$213 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$213 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - requestPaint(); - executionContext = prevExecutionContext; - Internals.p = spawnedLane; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = Internals.p), + (Internals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + (suspendedRetryLanes = commitBeforeMutationEffects(root, finishedWork)), + commitMutationEffectsOnFiber(finishedWork, root), + suspendedRetryLanes && + ((_enabled = !0), + dispatchAfterDetachedBlur(selectionInformation.focusedElem), + (_enabled = !1)), + restoreSelection(selectionInformation, root.containerInfo), + (_enabled = !!eventsEnabled), + (selectionInformation = eventsEnabled = null), + (root.current = finishedWork), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + requestPaint(), + (executionContext = updatedLanes), + (Internals.p = spawnedLane), + (ReactSharedInternals.T = transitions)) + : (root.current = finishedWork); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11284,7 +11563,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; null !== prevRootTransitionCallbacks && @@ -11310,9 +11589,9 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { - var root$214 = rootWithPendingPassiveEffects, + var root$211 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11322,12 +11601,12 @@ function flushPassiveEffects() { return ( (Internals.p = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$214, remainingLanes); + releaseRootPooledCache(root$211, remainingLanes); } } return !1; @@ -11346,7 +11625,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, @@ -11435,6 +11714,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) @@ -11448,7 +11728,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) { @@ -11854,6 +12136,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -12548,19 +12831,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$375; + var JSCompiler_inline_result$jscomp$372; if (canUseDOM) { - var isSupported$jscomp$inline_1510 = "oninput" in document; - if (!isSupported$jscomp$inline_1510) { - var element$jscomp$inline_1511 = document.createElement("div"); - element$jscomp$inline_1511.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1510 = - "function" === typeof element$jscomp$inline_1511.oninput; + var isSupported$jscomp$inline_1538 = "oninput" in document; + if (!isSupported$jscomp$inline_1538) { + var element$jscomp$inline_1539 = document.createElement("div"); + element$jscomp$inline_1539.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1538 = + "function" === typeof element$jscomp$inline_1539.oninput; } - JSCompiler_inline_result$jscomp$375 = isSupported$jscomp$inline_1510; - } else JSCompiler_inline_result$jscomp$375 = !1; + JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1538; + } else JSCompiler_inline_result$jscomp$372 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$375 && + JSCompiler_inline_result$jscomp$372 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -12648,10 +12931,16 @@ function containsNode(outerNode, innerNode) { : !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 { @@ -12660,9 +12949,9 @@ function getActiveElementDeep() { } 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; } @@ -12680,101 +12969,95 @@ function hasSelectionCapabilities(elem) { "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) - ) + if (null !== priorSelectionRange && 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); } } var skipSelectionChangeEvent = @@ -12971,20 +13254,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1551 = 0; - i$jscomp$inline_1551 < simpleEventPluginEvents.length; - i$jscomp$inline_1551++ + var i$jscomp$inline_1579 = 0; + i$jscomp$inline_1579 < simpleEventPluginEvents.length; + i$jscomp$inline_1579++ ) { - var eventName$jscomp$inline_1552 = - simpleEventPluginEvents[i$jscomp$inline_1551], - domEventName$jscomp$inline_1553 = - eventName$jscomp$inline_1552.toLowerCase(), - capitalizedEvent$jscomp$inline_1554 = - eventName$jscomp$inline_1552[0].toUpperCase() + - eventName$jscomp$inline_1552.slice(1); + var eventName$jscomp$inline_1580 = + simpleEventPluginEvents[i$jscomp$inline_1579], + domEventName$jscomp$inline_1581 = + eventName$jscomp$inline_1580.toLowerCase(), + capitalizedEvent$jscomp$inline_1582 = + eventName$jscomp$inline_1580[0].toUpperCase() + + eventName$jscomp$inline_1580.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1553, - "on" + capitalizedEvent$jscomp$inline_1554 + domEventName$jscomp$inline_1581, + "on" + capitalizedEvent$jscomp$inline_1582 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14273,34 +14556,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$233 = props[hasSrc]; - if (null != propValue$233) + var propValue$230 = props[hasSrc]; + if (null != propValue$230) switch (hasSrc) { case "name": - hasSrcSet = propValue$233; + hasSrcSet = propValue$230; break; case "type": - propKey = propValue$233; + propKey = propValue$230; break; case "checked": - checked = propValue$233; + checked = propValue$230; break; case "defaultChecked": - defaultChecked = propValue$233; + defaultChecked = propValue$230; break; case "value": - propValue = propValue$233; + propValue = propValue$230; break; case "defaultValue": - defaultValue = propValue$233; + defaultValue = propValue$230; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$233) + if (null != propValue$230) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$233, props, null); + setProp(domElement, tag, hasSrc, propValue$230, props, null); } } initInput( @@ -14436,14 +14719,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$233 in props) - props.hasOwnProperty(propValue$233) && - ((hasSrc = props[propValue$233]), + for (propValue$230 in props) + props.hasOwnProperty(propValue$230) && + ((hasSrc = props[propValue$230]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$233, + propValue$230, hasSrc, props, void 0 @@ -14491,14 +14774,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$250 in nextProps) { - var propKey = nextProps[propKey$250]; - lastProp = lastProps[propKey$250]; + for (var propKey$247 in nextProps) { + var propKey = nextProps[propKey$247]; + lastProp = lastProps[propKey$247]; if ( - nextProps.hasOwnProperty(propKey$250) && + nextProps.hasOwnProperty(propKey$247) && (null != propKey || null != lastProp) ) - switch (propKey$250) { + switch (propKey$247) { case "type": type = propKey; break; @@ -14527,7 +14810,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$250, + propKey$247, propKey, nextProps, lastProp @@ -14546,7 +14829,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$250 = null; + propKey = value = defaultValue = propKey$247 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14577,7 +14860,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$250 = type; + propKey$247 = type; break; case "defaultValue": defaultValue = type; @@ -14598,15 +14881,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$250 - ? updateOptions(domElement, !!lastProps, propKey$250, !1) + null != propKey$247 + ? updateOptions(domElement, !!lastProps, propKey$247, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$250 = null; + propKey = propKey$247 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14630,7 +14913,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$250 = name; + propKey$247 = name; break; case "defaultValue": propKey = name; @@ -14644,17 +14927,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$250, propKey); + updateTextarea(domElement, propKey$247, propKey); return; case "option": - for (var propKey$266 in lastProps) + for (var propKey$263 in lastProps) if ( - ((propKey$250 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$250 && - !nextProps.hasOwnProperty(propKey$266)) + ((propKey$247 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$263)) ) - switch (propKey$266) { + switch (propKey$263) { case "selected": domElement.selected = !1; break; @@ -14662,33 +14945,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$266, + propKey$263, null, nextProps, - propKey$250 + propKey$247 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$250 = nextProps[lastDefaultValue]), + ((propKey$247 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$247 !== propKey && + (null != propKey$247 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$250 && - "function" !== typeof propKey$250 && - "symbol" !== typeof propKey$250; + propKey$247 && + "function" !== typeof propKey$247 && + "symbol" !== typeof propKey$247; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$250, + propKey$247, nextProps, propKey ); @@ -14709,24 +14992,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$271 in lastProps) - (propKey$250 = lastProps[propKey$271]), - lastProps.hasOwnProperty(propKey$271) && - null != propKey$250 && - !nextProps.hasOwnProperty(propKey$271) && - setProp(domElement, tag, propKey$271, null, nextProps, propKey$250); + for (var propKey$268 in lastProps) + (propKey$247 = lastProps[propKey$268]), + lastProps.hasOwnProperty(propKey$268) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$268) && + setProp(domElement, tag, propKey$268, null, nextProps, propKey$247); for (checked in nextProps) if ( - ((propKey$250 = nextProps[checked]), + ((propKey$247 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$247 !== propKey && + (null != propKey$247 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$250) + if (null != propKey$247) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14734,7 +15017,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$250, + propKey$247, nextProps, propKey ); @@ -14742,49 +15025,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$276 in lastProps) - (propKey$250 = lastProps[propKey$276]), - lastProps.hasOwnProperty(propKey$276) && - void 0 !== propKey$250 && - !nextProps.hasOwnProperty(propKey$276) && + for (var propKey$273 in lastProps) + (propKey$247 = lastProps[propKey$273]), + lastProps.hasOwnProperty(propKey$273) && + void 0 !== propKey$247 && + !nextProps.hasOwnProperty(propKey$273) && setPropOnCustomElement( domElement, tag, - propKey$276, + propKey$273, void 0, nextProps, - propKey$250 + propKey$247 ); for (defaultChecked in nextProps) - (propKey$250 = nextProps[defaultChecked]), + (propKey$247 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$250 === propKey || - (void 0 === propKey$250 && void 0 === propKey) || + propKey$247 === propKey || + (void 0 === propKey$247 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$250, + propKey$247, nextProps, propKey ); return; } } - for (var propKey$281 in lastProps) - (propKey$250 = lastProps[propKey$281]), - lastProps.hasOwnProperty(propKey$281) && - null != propKey$250 && - !nextProps.hasOwnProperty(propKey$281) && - setProp(domElement, tag, propKey$281, null, nextProps, propKey$250); + for (var propKey$278 in lastProps) + (propKey$247 = lastProps[propKey$278]), + lastProps.hasOwnProperty(propKey$278) && + null != propKey$247 && + !nextProps.hasOwnProperty(propKey$278) && + setProp(domElement, tag, propKey$278, null, nextProps, propKey$247); for (lastProp in nextProps) - (propKey$250 = nextProps[lastProp]), + (propKey$247 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$250 === propKey || - (null == propKey$250 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$250, nextProps, propKey); + propKey$247 === propKey || + (null == propKey$247 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$247, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15362,26 +15645,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$289 = getResourcesFromRoot( + var styles$286 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$290 = styles$289.get(type); - resource$290 || + resource$287 = styles$286.get(type); + resource$287 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$290 = { + (resource$287 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$289.set(type, resource$290), - (styles$289 = JSCompiler_inline_result.querySelector( + styles$286.set(type, resource$287), + (styles$286 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$289._p && - ((resource$290.instance = styles$289), - (resource$290.state.loading = 5)), + !styles$286._p && + ((resource$287.instance = styles$286), + (resource$287.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15394,16 +15677,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$289 || + styles$286 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$290.state + resource$287.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$290; + return resource$287; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15500,37 +15783,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$295 = hoistableRoot.querySelector( + var instance$292 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$295) + if (instance$292) return ( (resource.state.loading |= 4), - (resource.instance = instance$295), - markNodeAsHoistable(instance$295), - instance$295 + (resource.instance = instance$292), + markNodeAsHoistable(instance$292), + instance$292 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$295 = ( + instance$292 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$295); - var linkInstance = instance$295; + markNodeAsHoistable(instance$292); + var linkInstance = instance$292; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$295, "link", instance); + setInitialProperties(instance$292, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$295, props.precedence, hoistableRoot); - return (resource.instance = instance$295); + insertStylesheet(instance$292, props.precedence, hoistableRoot); + return (resource.instance = instance$292); case "script": - instance$295 = getScriptKey(props.src); + instance$292 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$295) + getScriptSelectorFromKey(instance$292) )) ) return ( @@ -15539,7 +15822,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$295))) + if ((styleProps = preloadPropsMap.get(instance$292))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15800,7 +16083,7 @@ function insertStylesheetIntoRoot(root, resource) { ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -16351,7 +16634,7 @@ function dispatchEvent( ensureRootIsScheduled(fiber); 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now() + 500), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -16542,16 +16825,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1724 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1752 = React.version; if ( - "19.0.0-www-modern-0ad0fac1-20240814" !== - isomorphicReactPackageVersion$jscomp$inline_1724 + "19.0.0-www-modern-28668d39-20241023" !== + isomorphicReactPackageVersion$jscomp$inline_1752 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1724, - "19.0.0-www-modern-0ad0fac1-20240814" + isomorphicReactPackageVersion$jscomp$inline_1752, + "19.0.0-www-modern-28668d39-20241023" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16567,25 +16850,25 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2199 = { +var internals$jscomp$inline_2286 = { bundleType: 0, - version: "19.0.0-www-modern-0ad0fac1-20240814", + version: "19.0.0-www-modern-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-modern-28668d39-20241023" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2200 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2287 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2200.isDisabled && - hook$jscomp$inline_2200.supportsFiber + !hook$jscomp$inline_2287.isDisabled && + hook$jscomp$inline_2287.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2200.inject( - internals$jscomp$inline_2199 + (rendererID = hook$jscomp$inline_2287.inject( + internals$jscomp$inline_2286 )), - (injectedHook = hook$jscomp$inline_2200); + (injectedHook = hook$jscomp$inline_2287); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -16936,4 +17219,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; +exports.version = "19.0.0-www-modern-28668d39-20241023"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 40b8219232de2..81e8c4524bc01 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -44,17 +44,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -248,62 +252,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -612,20 +618,6 @@ function markComponentRenderStopped() { "function" === 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 && @@ -728,31 +720,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -796,11 +810,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -817,39 +826,54 @@ 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$8 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$8; - remainingLanes[index$8] = 0; - expirationTimes[index$8] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$8]; + var index$9 = 31 - clz32(remainingLanes), + lane = 1 << index$9; + entanglements[index$9] = 0; + expirationTimes[index$9] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$9]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$8] = null, index$8 = 0; - index$8 < hiddenUpdatesForLane.length; - index$8++ + hiddenUpdates[index$9] = null, index$9 = 0; + index$9 < hiddenUpdatesForLane.length; + index$9++ ) { - var update = hiddenUpdatesForLane[index$8]; + var update = hiddenUpdatesForLane[index$9]; 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; @@ -864,19 +888,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$9 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$9; - (lane & entangledLanes) | (root[index$9] & entangledLanes) && - (root[index$9] |= entangledLanes); + var index$10 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$10; + (lane & entangledLanes) | (root[index$10] & entangledLanes) && + (root[index$10] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$11 = 31 - clz32(lanes), - lane = 1 << index$11; - root[index$11].add(fiber); + var index$12 = 31 - clz32(lanes), + lane = 1 << index$12; + root[index$12].add(fiber); lanes &= ~lane; } } @@ -888,27 +912,27 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$12 = 31 - clz32(lanes); - root = 1 << index$12; - index$12 = pendingUpdatersLaneMap[index$12]; - 0 < index$12.size && - (index$12.forEach(function (fiber) { + var index$13 = 31 - clz32(lanes); + root = 1 << index$13; + index$13 = pendingUpdatersLaneMap[index$13]; + 0 < index$13.size && + (index$13.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$12.clear()); + index$13.clear()); lanes &= ~root; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$14 = 31 - clz32(lanes), - lane = 1 << index$14; - index$14 = root.transitionLanes[index$14]; - null !== index$14 && - index$14.forEach(function (transition) { + var index$15 = 31 - clz32(lanes), + lane = 1 << index$15; + index$15 = root.transitionLanes[index$15]; + null !== index$15 && + index$15.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -918,10 +942,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$15 = 31 - clz32(lanes), - lane = 1 << index$15; - null !== root.transitionLanes[index$15] && - (root.transitionLanes[index$15] = null); + var index$16 = 31 - clz32(lanes), + lane = 1 << index$16; + null !== root.transitionLanes[index$16] && + (root.transitionLanes[index$16] = null); lanes &= ~lane; } } @@ -1095,8 +1119,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$16 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$16 && "aria-" !== prefix$16) { + var prefix$17 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$17 && "aria-" !== prefix$17) { node.removeAttribute(name); return; } @@ -1437,15 +1461,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$22 in styles) - (styleName = styles[styleName$22]), - styles.hasOwnProperty(styleName$22) && - prevStyles[styleName$22] !== styleName && - setValueForStyle(node, styleName$22, styleName); - } else for (var styleName$23 in styles) - styles.hasOwnProperty(styleName$23) && - setValueForStyle(node, styleName$23, styles[styleName$23]); + (styleName = styles[styleName$23]), + styles.hasOwnProperty(styleName$23) && + prevStyles[styleName$23] !== styleName && + setValueForStyle(node, styleName$23, styleName); + } else + for (var styleName$24 in styles) + styles.hasOwnProperty(styleName$24) && + setValueForStyle(node, styleName$24, styles[styleName$24]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2027,6 +2051,60 @@ function getRootForUpdatedFiber(sourceFiber) { (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } +var now = Scheduler.unstable_now, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0; +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; +} +var currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +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); +} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -2046,25 +2124,44 @@ function ensureRootIsScheduled(root) { 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$28 = firstScheduledRoot; null !== root$28; ) { - if (!onlyLegacy || (!disableLegacyMode && 0 === root$28.tag)) { - var workInProgressRootRenderLanes$30 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$30 = getNextLanes( - root$28, - root$28 === workInProgressRoot - ? workInProgressRootRenderLanes$30 - : 0 - ); - 0 !== (workInProgressRootRenderLanes$30 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$28, workInProgressRootRenderLanes$30)); - } - root$28 = root$28.next; + for (var root$29 = firstScheduledRoot; null !== root$29; ) { + if (!onlyLegacy || (!disableLegacyMode && 0 === root$29.tag)) + if (0 !== syncTransitionLanes) { + var pendingLanes = root$29.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root$29.suspendedLanes, + pingedLanes = root$29.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$29, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root$29, + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root$29, JSCompiler_inline_result)); + root$29 = root$29.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -2072,30 +2169,29 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = 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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -2109,12 +2205,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$6 = 31 - clz32(pendingLanes), - lane = 1 << index$6, - expirationTime = expirationTimes[index$6]; + var index$7 = 31 - clz32(pendingLanes), + lane = 1 << index$7, + expirationTime = expirationTimes[index$7]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + expirationTimes[index$7] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -2137,39 +2233,65 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 scheduleImmediateTask(cb) { scheduleMicrotask(function () { @@ -2206,8 +2328,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2366,20 +2488,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$32 = workInProgress$jscomp$0.alternate; - null !== current$32 && - ((current$32 = current$32.updateQueue), - (pendingQueue = current$32.lastBaseUpdate), + var current$34 = workInProgress$jscomp$0.alternate; + null !== current$34 && + ((current$34 = current$34.updateQueue), + (pendingQueue = current$34.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$32.firstBaseUpdate = firstPendingUpdate) + ? (current$34.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$32.lastBaseUpdate = lastPendingUpdate))); + (current$34.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$32 = firstPendingUpdate = lastPendingUpdate = null; + current$34 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -2392,8 +2514,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$32 && - (current$32 = current$32.next = + null !== current$34 && + (current$34 = current$34.next = { lane: 0, tag: pendingQueue.tag, @@ -2446,10 +2568,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$32 - ? ((firstPendingUpdate = current$32 = isHiddenUpdate), + null === current$34 + ? ((firstPendingUpdate = current$34 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$32 = current$32.next = isHiddenUpdate), + : (current$34 = current$34.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -2462,10 +2584,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$32 && (lastPendingUpdate = newState); + null === current$34 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$32; + queue.lastBaseUpdate = current$34; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -3344,9 +3466,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$67 = fiber.alternate; - null !== current$67 && - null !== current$67.memoizedState && + var current$69 = fiber.alternate; + null !== current$69 && + null !== current$69.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -3464,9 +3586,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; } @@ -3616,16 +3744,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$69 = currentlyRenderingFiber$1.alternate; - null !== current$69 && - ((current$69 = current$69.updateQueue), - null !== current$69 && - ((current$69 = current$69.memoCache), - null != current$69 && + var current$71 = currentlyRenderingFiber$1.alternate; + null !== current$71 && + ((current$71 = current$71.updateQueue), + null !== current$71 && + ((current$71 = current$71.memoCache), + null != current$71 && (memoCache = { data: enableNoCloningMemoCache - ? current$69.data - : current$69.data.map(function (array) { + ? current$71.data + : current$71.data.map(function (array) { return array.slice(); }), index: 0 @@ -3640,11 +3768,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$69 = 0; - current$69 < size; - current$69++ + current$71 = 0; + current$71 < size; + current$71++ ) - updateQueue[current$69] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$71] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -3677,7 +3805,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$70 = !1; + didReadFromEntangledAsyncAction$72 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3698,11 +3826,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$70 = !0); + (didReadFromEntangledAsyncAction$72 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$70 = !0); + (didReadFromEntangledAsyncAction$72 = !0); continue; } else (updateLane = { @@ -3748,7 +3876,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$70 && + didReadFromEntangledAsyncAction$72 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3865,10 +3993,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -3946,8 +4078,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$76) { - onActionError(actionQueue, node, error$76); + } catch (error$78) { + onActionError(actionQueue, node, error$78); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4138,17 +4270,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() { @@ -4247,10 +4378,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -4312,14 +4447,26 @@ 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 { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition); } @@ -4378,7 +4525,12 @@ function ensureFormComponentIsStateful(formFiber) { } function requestFormReset$1(formFiber) { var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetState(formFiber, resetStateQueue, {}); + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) + ); } function useHostTransitionStatus() { return readContext(HostTransitionContext); @@ -4396,14 +4548,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(provider); fiber = createUpdate(lane); - var root$79 = enqueueUpdate(provider, fiber, lane); - null !== root$79 && - (scheduleUpdateOnFiber(root$79, provider, lane), - entangleTransitions(root$79, provider, lane)); + var root$81 = enqueueUpdate(provider, fiber, lane); + null !== root$81 && + (scheduleUpdateOnFiber(root$81, provider, lane), + entangleTransitions(root$81, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$79 && + null !== root$81 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4430,15 +4582,19 @@ function dispatchReducerAction(fiber, queue, action) { enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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; @@ -4452,20 +4608,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 + ); } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); + return !1; } function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { action = { @@ -4572,10 +4732,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -4583,10 +4747,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4840,68 +5008,6 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { }; HooksDispatcherOnRerender.unstable_useContextWithBailout = unstable_useContextWithBailout; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); -} -function 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 applyDerivedStateFromProps( workInProgress, ctor, @@ -5795,6 +5901,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 && @@ -5856,6 +5963,7 @@ function replayFunctionComponent( ) { prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -6108,7 +6216,7 @@ function finishClassComponent( ) ); shouldUpdate = workInProgress.stateNode; - current = workInProgress; + disableStringRefs || (current = workInProgress); if ( didCaptureError && "function" !== typeof Component.getDerivedStateFromError @@ -6510,8 +6618,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { (nextProps.childLanes = 0), (nextProps.pendingProps = didSuspend), workInProgress.mode & 2 && - ((nextProps.actualDuration = 0), - (nextProps.actualStartTime = -1), + ((nextProps.actualDuration = -0), + (nextProps.actualStartTime = -1.1), (nextProps.selfBaseDuration = JSCompiler_temp$jscomp$0.selfBaseDuration), (nextProps.treeBaseDuration = @@ -6630,10 +6738,10 @@ function mountSuspenseFallbackChildren( : ((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, @@ -6859,9 +6967,10 @@ function attemptEarlyBailoutIfNoScheduledUpdate( 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; @@ -7323,9 +7432,10 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), (props = workInProgress.stateNode), - (props.effectDuration = 0), - (props.passiveEffectDuration = 0), + (props.effectDuration = -0), + (props.passiveEffectDuration = -0), reconcileChildren( current, workInProgress, @@ -7944,12 +8054,13 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } 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) { if (!isHydrating) @@ -8691,47 +8802,222 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); + 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 ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) { - startLayoutEffectTimer(); - try { - instance.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - recordLayoutEffectDuration(current); - } else - try { - instance.componentWillUnmount(); - } catch (error$178) { - captureCommitPhaseError(current, nearestMountedAncestor, error$178); - } + 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; + 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 && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + )); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped()); + } + 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; + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && + injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( + finishedWork + )); + lastEffect = finishedWork; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + try { + destroy(); + } catch (error) { + captureCommitPhaseError( + lastEffect, + nearestMountedAncestor, + error + ); + } + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); + } + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +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; + 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; + if (shouldProfile(current)) { + startEffectTimer(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + recordEffectDuration(); + } else + try { + instance.componentWillUnmount(); + } catch (error$181) { + captureCommitPhaseError(current, nearestMountedAncestor, error$181); + } +} +function safelyAttachRef(current, nearestMountedAncestor) { + try { + var ref = current.ref; + if (null !== ref) { + var instance = current.stateNode; switch (current.tag) { case 26: case 27: @@ -8745,9 +9031,9 @@ function safelyAttachRef(current, nearestMountedAncestor) { if ("function" === typeof ref) if (shouldProfile(current)) try { - startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); + startEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(); } else current.refCleanup = ref(instanceToUse); else ref.current = instanceToUse; @@ -8764,9 +9050,9 @@ function safelyDetachRef(current, nearestMountedAncestor) { try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), refCleanup(); + startEffectTimer(), refCleanup(); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } else refCleanup(); } catch (error) { @@ -8780,28 +9066,179 @@ function safelyDetachRef(current, nearestMountedAncestor) { try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), ref(null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } else ref(null); - } catch (error$179) { - captureCommitPhaseError(current, nearestMountedAncestor, error$179); + } catch (error$182) { + captureCommitPhaseError(current, nearestMountedAncestor, error$182); } else ref.current = null; } -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { +function commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + effectDuration +) { try { - destroy(); + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitStartTime + ); } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration +) { + try { + var _finishedWork$memoize2 = finishedWork.memoizedProps, + id = _finishedWork$memoize2.id, + onPostCommit = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onPostCommit && + onPostCommit(id, current, passiveEffectDuration, commitStartTime); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; } } -var focusedInstanceHandle = null, +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null, + focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; eventsEnabled = _enabled; - root = getActiveElementDeep(); + root = getActiveElementDeep(root); if (hasSelectionCapabilities(root)) { if ("selectionStart" in root) var JSCompiler_temp = { @@ -8823,7 +9260,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$250) { + } catch (e$242) { JSCompiler_temp = null; break a; } @@ -8893,84 +9330,93 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags, - JSCompiler_temp$jscomp$0; - if ( - (JSCompiler_temp$jscomp$0 = - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle) - ) { - var JSCompiler_temp$jscomp$1; - if ((JSCompiler_temp$jscomp$1 = 13 === firstChild.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = firstChild.memoizedState; - JSCompiler_temp$jscomp$1 = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp$jscomp$1 = !1; - } - JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$1 && - doesFiberContain(firstChild, focusedInstanceHandle); - } - JSCompiler_temp$jscomp$0 && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(firstChild)); - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } + root = firstChild.alternate; + JSCompiler_temp = firstChild.flags; + if ( + (anchorOffset = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((anchorOffset = 13 === firstChild.tag)) + a: { + if ( + null !== root && + ((anchorOffset = root.memoizedState), + null === anchorOffset || null !== anchorOffset.dehydrated) + ) { + anchorOffset = firstChild.memoizedState; + anchorOffset = + null !== anchorOffset && null === anchorOffset.dehydrated; + break a; } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps, - firstChild.elementType === firstChild.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; + anchorOffset = !1; + } + anchorOffset = + anchorOffset && doesFiberContain(firstChild, focusedInstanceHandle); + } + anchorOffset && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (JSCompiler_temp & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ + ) + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (JSCompiler_temp & 1024) && null !== root) { + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; + root = root.memoizedState; + selection = anchorOffset.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + root + ); + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + anchorOffset, + anchorOffset.return, + error + ); } - break; - case 3: - 0 !== (flags & 1024) && - clearContainer(firstChild.stateNode.containerInfo); - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); + } + break; + case 3: + 0 !== (JSCompiler_temp & 1024) && + clearContainer(firstChild.stateNode.containerInfo); + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (JSCompiler_temp & 1024)) + throw Error(formatProdErrorMessage(163)); } root = firstChild.sibling; if (null !== root) { @@ -8978,218 +9424,13 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root; break; } - nextEffect = firstChild.return; - } - } - current = 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), - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork)), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStopped())); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - )); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitPassiveEffectDurations(finishedRoot, finishedWork) { - if (executionContext & 4 && 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$181 = commitTime, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$181); - 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) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$183) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$183); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { - case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + } + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9205,21 +9446,21 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) if (shouldProfile(finishedWork)) { - startLayoutEffectTimer(); + startEffectTimer(); try { finishedRoot.componentDidMount(); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - recordLayoutEffectDuration(finishedWork); + recordEffectDuration(); } else try { finishedRoot.componentDidMount(); - } catch (error$184) { + } catch (error$178) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$184 + error$178 ); } else { @@ -9230,21 +9471,21 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { ); current = current.memoizedState; if (shouldProfile(finishedWork)) { - startLayoutEffectTimer(); + startEffectTimer(); try { finishedRoot.componentDidUpdate( prevProps, current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$185) { + } catch (error$179) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$185 + error$179 ); } - recordLayoutEffectDuration(finishedWork); + recordEffectDuration(); } else try { finishedRoot.componentDidUpdate( @@ -9252,11 +9493,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$186) { + } catch (error$180) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$186 + error$180 ); } } @@ -9264,24 +9505,26 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: + 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); + commitCallbacks(flags, prevProps); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + finishedRoot.effectDuration += popNestedEffectDurations(current); break; case 26: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -9290,12 +9533,22 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -9538,75 +9791,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -9654,8 +9838,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -9664,39 +9852,63 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$191 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$191; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParentIsContainer = finishedRoot.onDeleted) && + prevHostParentIsContainer(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -9716,49 +9928,11 @@ function commitDeletionEffectsOnFiber( 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) && - (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(2, deletedFiber, nearestMountedAncestor); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects(deletedFiber, nearestMountedAncestor, 4); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -9817,23 +9991,28 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$200 = finishedWork.alternate; + var current$194 = finishedWork.alternate; if ( - null !== current$200 && - ((current$200 = current$200.memoizedState), - null !== current$200 && - ((current$200 = current$200.dehydrated), null !== current$200)) - ) + null !== current$194 && + ((current$194 = current$194.memoizedState), + null !== current$194 && + ((current$194 = current$194.dehydrated), null !== current$194)) + ) { + try { + retryIfBlockedOn(current$194); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } try { - retryIfBlockedOn(current$200); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$200); + onHydrated && onHydrated(current$194); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } + } } } function getRetryCache(finishedWork) { @@ -9900,39 +10079,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; ) @@ -9950,36 +10125,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); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$202) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$202 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$203) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$203 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 5)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -10122,64 +10271,62 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$204) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$204 - ); - } + 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; maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, maybeNodes); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = maybeNodes; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -10191,21 +10338,18 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$205) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$205); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; - try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$207) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$207); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((root = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + root, + null !== current ? current.memoizedProps : root + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -10214,30 +10358,32 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$208) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$208); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 3: + hoistableRoot = pushNestedEffectDurations(); tagCaches = null; - hoistableRoot = currentHoistableRoot; + maybeNodes = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); recursivelyTraverseMutationEffects(root, finishedWork); - currentHoistableRoot = hoistableRoot; + currentHoistableRoot = maybeNodes; commitReconciliationEffects(finishedWork); if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$209) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$209); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); + root.effectDuration += popNestedEffectDurations(hoistableRoot); break; case 4: flags = currentHoistableRoot; @@ -10248,6 +10394,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { 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); commitReconciliationEffects(finishedWork); @@ -10266,8 +10419,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$211) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$211); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -10279,16 +10432,16 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; disableLegacyMode || finishedWork.mode & 1 - ? ((suspenseCallback = offscreenSubtreeIsHidden), - (retryQueue = offscreenSubtreeWasHidden), - (offscreenSubtreeIsHidden = suspenseCallback || domElement), - (offscreenSubtreeWasHidden = retryQueue || newProps), + ? ((nodeName = offscreenSubtreeIsHidden), + (type = offscreenSubtreeWasHidden), + (offscreenSubtreeIsHidden = nodeName || node), + (offscreenSubtreeWasHidden = type || nextNode), recursivelyTraverseMutationEffects(root, finishedWork), - (offscreenSubtreeWasHidden = retryQueue), - (offscreenSubtreeIsHidden = suspenseCallback)) + (offscreenSubtreeWasHidden = type), + (offscreenSubtreeIsHidden = nodeName)) : recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; @@ -10297,13 +10450,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || ((disableLegacyMode || 0 !== (finishedWork.mode & 1)) && recursivelyTraverseDisappearLayoutEffects(finishedWork))), @@ -10313,45 +10466,42 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (maybeNodes = hoistableRoot.style), + "function" === typeof maybeNodes.setProperty + ? maybeNodes.setProperty("display", "none", "important") + : (maybeNodes.display = "none"); + else { + i = nextNode.stateNode; + var styleProp = nextNode.memoizedProps.style, + display = + void 0 !== styleProp && + null !== styleProp && + styleProp.hasOwnProperty("display") + ? styleProp.display + : null; + i.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$191) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$191 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -10407,11 +10557,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -10424,21 +10574,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$192 = JSCompiler_inline_result.stateNode; + var parent$183 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$192, ""), + (setTextContent(parent$183, ""), (JSCompiler_inline_result.flags &= -33)); - var before$193 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$193, parent$192); + var before$184 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$184, parent$183); break; case 3: case 4: - var parent$194 = JSCompiler_inline_result.stateNode.containerInfo, - before$195 = getHostSibling(finishedWork); + var parent$185 = JSCompiler_inline_result.stateNode.containerInfo, + before$186 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$195, - parent$194 + before$186, + parent$185 ); break; default: @@ -10481,14 +10631,7 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 11: case 14: case 15: - if (shouldProfile(finishedWork)) - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(4, finishedWork, finishedWork.return); - } finally { - recordLayoutEffectDuration(finishedWork); - } - else commitHookEffectListUnmount(4, finishedWork, finishedWork.return); + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 4); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 1: @@ -10527,7 +10670,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$215 = parentFiber.alternate, + var current$201 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10548,23 +10691,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current$201 = finishedWork; + finishedRoot = current$201.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current$201, current$201.return, error); + } + current$201 = finishedWork; + finishedRoot = current$201.updateQueue; + if (null !== finishedRoot) { + var instance = current$201.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current$201, current$201.return, error); } - current$215 = finishedWork.updateQueue; - if (null !== current$215) { - var hiddenCallbacks = current$215.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current$215.shared.hiddenCallbacks = null, current$215 = 0; - current$215 < hiddenCallbacks.length; - current$215++ - ) - callCallback(hiddenCallbacks[current$215], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10580,20 +10730,32 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$215 && + null === current$201 && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current$215); + includeWorkInProgressEffects && flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current$201, + commitStartTime, + finishedRoot.effectDuration + )) + : recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -10624,22 +10786,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$216) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$216); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { var previousCache = null; null !== current && @@ -10746,6 +10892,7 @@ function commitPassiveMountOnFiber( flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -10805,6 +10952,33 @@ function commitPassiveMountOnFiber( 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( @@ -10821,9 +10995,9 @@ function commitPassiveMountOnFiber( ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -10835,21 +11009,21 @@ function commitPassiveMountOnFiber( finishedRoot, finishedWork ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions )) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10861,7 +11035,7 @@ function commitPassiveMountOnFiber( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -10939,9 +11113,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$223 = finishedWork.stateNode; + var instance$209 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$223._visibility & 4 + ? instance$209._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10954,7 +11128,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$223._visibility |= 4), + : ((instance$209._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10962,7 +11136,7 @@ function recursivelyTraverseReconnectPassiveEffects( committedTransitions, includeWorkInProgressEffects )) - : ((instance$223._visibility |= 4), + : ((instance$209._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10975,7 +11149,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$223 + instance$209 ); break; case 24: @@ -11104,25 +11278,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -11151,12 +11306,24 @@ function commitPassiveUnmountOnFiber(finishedWork) { finishedWork.flags & 2048 && commitHookPassiveUnmountEffects(finishedWork, finishedWork.return, 9); 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; @@ -11299,19 +11466,20 @@ 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; - } - }, - postPaintCallbackScheduled = !1, + 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 postPaintCallbackScheduled = !1, callbacks = []; function schedulePostPaintCallback(callback) { callbacks.push(callback); @@ -11330,6 +11498,8 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -11337,6 +11507,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -11411,7 +11582,6 @@ var legacyErrorBoundariesThatAlreadyFailed = null, rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, nestedUpdateCount = 0, @@ -11446,7 +11616,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -11460,11 +11631,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing) ) { var transitionLanesMap = root.transitionLanes, - index$13 = 31 - clz32(lane), - transitions = transitionLanesMap[index$13]; + index$14 = 31 - clz32(lane), + transitions = transitionLanesMap[index$14]; null === transitions && (transitions = new Set()); transitions.add(transition); - transitionLanesMap[index$13] = transitions; + transitionLanesMap[index$14] = transitions; } } root === workInProgressRoot && @@ -11474,7 +11645,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); 2 !== lane || @@ -11482,161 +11654,178 @@ function scheduleUpdateOnFiber(root, fiber, lane) { disableLegacyMode || 0 !== (fiber.mode & 1) || ((workInProgressRootRenderTargetTime = now$1() + 500), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } -function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; +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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if ((disableLegacyMode || 0 !== root$jscomp$0.tag) && 2 === exitStatus) { + renderWasConcurrent = lanes; + 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; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now$1()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } 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 (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -11653,7 +11842,13 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -11669,10 +11864,16 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings); return; } commitRoot( @@ -11680,31 +11881,36 @@ function commitRootWhenReady( 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) { - 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; ) { @@ -11720,76 +11926,36 @@ 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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7; - expirationTimes[index$7] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + didAttemptEntireTree[index$8] = -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; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - 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 batchedUpdates$1(fn, a) { if (disableLegacyMode) return fn(a); var prevExecutionContext = executionContext; @@ -11800,12 +11966,12 @@ function batchedUpdates$1(fn, a) { (executionContext = prevExecutionContext), 0 === executionContext && ((workInProgressRootRenderTargetTime = now$1() + 500), - disableLegacyMode || flushSyncWorkAcrossRoots_impl(!0)); + disableLegacyMode || flushSyncWorkAcrossRoots_impl(0, !0)); } } function flushSyncWork$1() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -11840,8 +12006,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -11858,9 +12027,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$5 = 31 - clz32(allEntangledLanes), - lane = 1 << index$5; - lanes |= root[index$5]; + var index$6 = 31 - clz32(allEntangledLanes), + lane = 1 << index$6; + lanes |= root[index$6]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11870,10 +12039,11 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -11900,7 +12070,7 @@ function handleThrow(root, thrownValue) { ); else if ( (erroredWork.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), + stopProfilerTimerIfRunningAndRecordDuration(erroredWork), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -11955,16 +12125,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -11982,31 +12158,46 @@ function renderRootSync(root, lanes) { } enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + memoizedUpdaters = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$234) { - handleThrow(root, thrownValue$234); + } catch (thrownValue$226) { + handleThrow(root, thrownValue$226); } while (1); lanes && root.shellSuspendCounter++; @@ -12014,12 +12205,12 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -12040,7 +12231,8 @@ function renderRootConcurrent(root, lanes) { workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + 500; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -12053,7 +12245,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); break; case 2: if (isThenableResolved(memoizedUpdaters)) { @@ -12083,7 +12275,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); break; case 5: var resource = null; @@ -12110,12 +12302,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); break; case 8: resetWorkInProgressStack(); @@ -12126,8 +12318,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$236) { - handleThrow(root, thrownValue$236); + } catch (thrownValue$228) { + handleThrow(root, thrownValue$228); } while (1); resetContextDependencies(); @@ -12162,13 +12354,13 @@ function performUnitOfWork(unitOfWork) { unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current$jscomp$0 = beginWork( current$jscomp$0, unitOfWork, entangledRenderLanes )); - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current$jscomp$0 ? completeUnitOfWork(unitOfWork) @@ -12229,13 +12421,18 @@ function replaySuspendedUnitOfWork(unitOfWork) { entangledRenderLanes )); } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDelta(next, !0); + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); next = current$jscomp$0; - 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; @@ -12269,56 +12466,52 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (isHydrating || 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 { - var current$240 = completedWork.alternate; + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } + var current$232 = completedWork.alternate; unitOfWork = completedWork.return; - 0 === (completedWork.mode & 2) - ? (current$240 = completeWork( - current$240, - completedWork, - entangledRenderLanes - )) - : (startProfilerTimer(completedWork), - (current$240 = completeWork( - current$240, - completedWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); - if (null !== current$240) { - workInProgress = current$240; + startProfilerTimer(completedWork); + current$232 = completeWork( + current$232, + completedWork, + entangledRenderLanes + ); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); + if (null !== current$232) { + workInProgress = current$232; return; } completedWork = completedWork.sibling; @@ -12330,12 +12523,47 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + 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 = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = Internals.p; @@ -12348,13 +12576,17 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -12362,7 +12594,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -12384,7 +12618,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), @@ -12396,47 +12637,44 @@ function commitRootImpl( (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 = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$242 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$242 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = Internals.p), + (Internals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + (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), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), 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); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -12469,7 +12707,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; @@ -12496,9 +12734,9 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { - var root$243 = rootWithPendingPassiveEffects, + var root$235 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12508,25 +12746,16 @@ function flushPassiveEffects() { return ( (Internals.p = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$243, remainingLanes); + releaseRootPooledCache(root$235, remainingLanes); } } 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; @@ -12545,17 +12774,13 @@ function flushPassiveEffectsImpl() { executionContext |= 4; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - transitions = pendingPassiveProfilerEffects; - pendingPassiveProfilerEffects = []; - for (lanes = 0; lanes < transitions.length; lanes++) - commitPassiveEffectDurations(root, transitions[lanes]); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -12576,9 +12801,9 @@ function flushPassiveEffectsImpl() { try { injectedHook.onPostCommitFiberRoot(rendererID, root); } catch (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) { @@ -12648,6 +12873,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) @@ -12661,7 +12887,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now$1() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -12745,9 +12973,9 @@ function FiberNode(tag, pendingProps, key, mode) { 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; } function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); @@ -12777,10 +13005,10 @@ function createFiberImplObject(tag, pendingProps, key, mode) { key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0 + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0 }; } var createFiber = enableObjectFiber @@ -12809,8 +13037,8 @@ function createWorkInProgress(current, pendingProps) { (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; @@ -13094,6 +13322,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -13118,7 +13347,7 @@ function FiberRootNode( tag++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); @@ -13354,9 +13583,9 @@ function attemptContinuousHydration(fiber) { function getLaneLabelMap() { if (enableSchedulingProfiler) { for ( - var map = new Map(), lane = 1, index$248 = 0; - 31 > index$248; - index$248++ + var map = new Map(), lane = 1, index$240 = 0; + 31 > index$240; + index$240++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -13902,19 +14131,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$410; + var JSCompiler_inline_result$jscomp$402; if (canUseDOM) { - var isSupported$jscomp$inline_1627 = "oninput" in document; - if (!isSupported$jscomp$inline_1627) { - var element$jscomp$inline_1628 = document.createElement("div"); - element$jscomp$inline_1628.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1627 = - "function" === typeof element$jscomp$inline_1628.oninput; + var isSupported$jscomp$inline_1660 = "oninput" in document; + if (!isSupported$jscomp$inline_1660) { + var element$jscomp$inline_1661 = document.createElement("div"); + element$jscomp$inline_1661.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1660 = + "function" === typeof element$jscomp$inline_1661.oninput; } - JSCompiler_inline_result$jscomp$410 = isSupported$jscomp$inline_1627; - } else JSCompiler_inline_result$jscomp$410 = !1; + JSCompiler_inline_result$jscomp$402 = isSupported$jscomp$inline_1660; + } else JSCompiler_inline_result$jscomp$402 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$410 && + JSCompiler_inline_result$jscomp$402 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14002,10 +14231,16 @@ function containsNode(outerNode, innerNode) { : !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 { @@ -14014,9 +14249,9 @@ function getActiveElementDeep() { } 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; } @@ -14034,101 +14269,95 @@ function hasSelectionCapabilities(elem) { "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) - ) + if (null !== priorSelectionRange && 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); } } var skipSelectionChangeEvent = @@ -14325,20 +14554,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1668 = 0; - i$jscomp$inline_1668 < simpleEventPluginEvents.length; - i$jscomp$inline_1668++ + var i$jscomp$inline_1701 = 0; + i$jscomp$inline_1701 < simpleEventPluginEvents.length; + i$jscomp$inline_1701++ ) { - var eventName$jscomp$inline_1669 = - simpleEventPluginEvents[i$jscomp$inline_1668], - domEventName$jscomp$inline_1670 = - eventName$jscomp$inline_1669.toLowerCase(), - capitalizedEvent$jscomp$inline_1671 = - eventName$jscomp$inline_1669[0].toUpperCase() + - eventName$jscomp$inline_1669.slice(1); + var eventName$jscomp$inline_1702 = + simpleEventPluginEvents[i$jscomp$inline_1701], + domEventName$jscomp$inline_1703 = + eventName$jscomp$inline_1702.toLowerCase(), + capitalizedEvent$jscomp$inline_1704 = + eventName$jscomp$inline_1702[0].toUpperCase() + + eventName$jscomp$inline_1702.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1670, - "on" + capitalizedEvent$jscomp$inline_1671 + domEventName$jscomp$inline_1703, + "on" + capitalizedEvent$jscomp$inline_1704 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15631,34 +15860,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$264 = props[hasSrc]; - if (null != propValue$264) + var propValue$256 = props[hasSrc]; + if (null != propValue$256) switch (hasSrc) { case "name": - hasSrcSet = propValue$264; + hasSrcSet = propValue$256; break; case "type": - propValue = propValue$264; + propValue = propValue$256; break; case "checked": - checked = propValue$264; + checked = propValue$256; break; case "defaultChecked": - defaultChecked = propValue$264; + defaultChecked = propValue$256; break; case "value": - propKey = propValue$264; + propKey = propValue$256; break; case "defaultValue": - defaultValue = propValue$264; + defaultValue = propValue$256; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$264) + if (null != propValue$256) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$264, props, null); + setProp(domElement, tag, hasSrc, propValue$256, props, null); } } initInput( @@ -15795,14 +16024,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$264 in props) - props.hasOwnProperty(propValue$264) && - ((hasSrc = props[propValue$264]), + for (propValue$256 in props) + props.hasOwnProperty(propValue$256) && + ((hasSrc = props[propValue$256]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$264, + propValue$256, hasSrc, props, void 0 @@ -15850,14 +16079,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$281 in nextProps) { - var propKey = nextProps[propKey$281]; - lastProp = lastProps[propKey$281]; + for (var propKey$273 in nextProps) { + var propKey = nextProps[propKey$273]; + lastProp = lastProps[propKey$273]; if ( - nextProps.hasOwnProperty(propKey$281) && + nextProps.hasOwnProperty(propKey$273) && (null != propKey || null != lastProp) ) - switch (propKey$281) { + switch (propKey$273) { case "type": type = propKey; break; @@ -15886,7 +16115,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$281, + propKey$273, propKey, nextProps, lastProp @@ -15905,7 +16134,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$281 = null; + propKey = value = defaultValue = propKey$273 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15936,7 +16165,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$281 = type; + propKey$273 = type; break; case "defaultValue": defaultValue = type; @@ -15957,15 +16186,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$281 - ? updateOptions(domElement, !!lastProps, propKey$281, !1) + null != propKey$273 + ? updateOptions(domElement, !!lastProps, propKey$273, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$281 = null; + propKey = propKey$273 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15989,7 +16218,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$281 = name; + propKey$273 = name; break; case "defaultValue": propKey = name; @@ -16003,17 +16232,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$281, propKey); + updateTextarea(domElement, propKey$273, propKey); return; case "option": - for (var propKey$297 in lastProps) + for (var propKey$289 in lastProps) if ( - ((propKey$281 = lastProps[propKey$297]), - lastProps.hasOwnProperty(propKey$297) && - null != propKey$281 && - !nextProps.hasOwnProperty(propKey$297)) + ((propKey$273 = lastProps[propKey$289]), + lastProps.hasOwnProperty(propKey$289) && + null != propKey$273 && + !nextProps.hasOwnProperty(propKey$289)) ) - switch (propKey$297) { + switch (propKey$289) { case "selected": domElement.selected = !1; break; @@ -16021,33 +16250,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$297, + propKey$289, null, nextProps, - propKey$281 + propKey$273 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$281 = nextProps[lastDefaultValue]), + ((propKey$273 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$281 !== propKey && - (null != propKey$281 || null != propKey)) + propKey$273 !== propKey && + (null != propKey$273 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$281 && - "function" !== typeof propKey$281 && - "symbol" !== typeof propKey$281; + propKey$273 && + "function" !== typeof propKey$273 && + "symbol" !== typeof propKey$273; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$281, + propKey$273, nextProps, propKey ); @@ -16068,24 +16297,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$302 in lastProps) - (propKey$281 = lastProps[propKey$302]), - lastProps.hasOwnProperty(propKey$302) && - null != propKey$281 && - !nextProps.hasOwnProperty(propKey$302) && - setProp(domElement, tag, propKey$302, null, nextProps, propKey$281); + for (var propKey$294 in lastProps) + (propKey$273 = lastProps[propKey$294]), + lastProps.hasOwnProperty(propKey$294) && + null != propKey$273 && + !nextProps.hasOwnProperty(propKey$294) && + setProp(domElement, tag, propKey$294, null, nextProps, propKey$273); for (checked in nextProps) if ( - ((propKey$281 = nextProps[checked]), + ((propKey$273 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$281 !== propKey && - (null != propKey$281 || null != propKey)) + propKey$273 !== propKey && + (null != propKey$273 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$281) + if (null != propKey$273) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -16093,7 +16322,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$281, + propKey$273, nextProps, propKey ); @@ -16101,49 +16330,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$307 in lastProps) - (propKey$281 = lastProps[propKey$307]), - lastProps.hasOwnProperty(propKey$307) && - void 0 !== propKey$281 && - !nextProps.hasOwnProperty(propKey$307) && + for (var propKey$299 in lastProps) + (propKey$273 = lastProps[propKey$299]), + lastProps.hasOwnProperty(propKey$299) && + void 0 !== propKey$273 && + !nextProps.hasOwnProperty(propKey$299) && setPropOnCustomElement( domElement, tag, - propKey$307, + propKey$299, void 0, nextProps, - propKey$281 + propKey$273 ); for (defaultChecked in nextProps) - (propKey$281 = nextProps[defaultChecked]), + (propKey$273 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$281 === propKey || - (void 0 === propKey$281 && void 0 === propKey) || + propKey$273 === propKey || + (void 0 === propKey$273 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$281, + propKey$273, nextProps, propKey ); return; } } - for (var propKey$312 in lastProps) - (propKey$281 = lastProps[propKey$312]), - lastProps.hasOwnProperty(propKey$312) && - null != propKey$281 && - !nextProps.hasOwnProperty(propKey$312) && - setProp(domElement, tag, propKey$312, null, nextProps, propKey$281); + for (var propKey$304 in lastProps) + (propKey$273 = lastProps[propKey$304]), + lastProps.hasOwnProperty(propKey$304) && + null != propKey$273 && + !nextProps.hasOwnProperty(propKey$304) && + setProp(domElement, tag, propKey$304, null, nextProps, propKey$273); for (lastProp in nextProps) - (propKey$281 = nextProps[lastProp]), + (propKey$273 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$281 === propKey || - (null == propKey$281 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$281, nextProps, propKey); + propKey$273 === propKey || + (null == propKey$273 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$273, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16738,26 +16967,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$320 = getResourcesFromRoot( + var styles$312 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$321 = styles$320.get(type); - resource$321 || + resource$313 = styles$312.get(type); + resource$313 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$321 = { + (resource$313 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$320.set(type, resource$321), - (styles$320 = JSCompiler_inline_result.querySelector( + styles$312.set(type, resource$313), + (styles$312 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$320._p && - ((resource$321.instance = styles$320), - (resource$321.state.loading = 5)), + !styles$312._p && + ((resource$313.instance = styles$312), + (resource$313.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16770,16 +16999,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$320 || + styles$312 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$321.state + resource$313.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$321; + return resource$313; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16876,37 +17105,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$326 = hoistableRoot.querySelector( + var instance$318 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$326) + if (instance$318) return ( (resource.state.loading |= 4), - (resource.instance = instance$326), - markNodeAsHoistable(instance$326), - instance$326 + (resource.instance = instance$318), + markNodeAsHoistable(instance$318), + instance$318 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$326 = ( + instance$318 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$326); - var linkInstance = instance$326; + markNodeAsHoistable(instance$318); + var linkInstance = instance$318; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$326, "link", instance); + setInitialProperties(instance$318, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$326, props.precedence, hoistableRoot); - return (resource.instance = instance$326); + insertStylesheet(instance$318, props.precedence, hoistableRoot); + return (resource.instance = instance$318); case "script": - instance$326 = getScriptKey(props.src); + instance$318 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$326) + getScriptSelectorFromKey(instance$318) )) ) return ( @@ -16915,7 +17144,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$326))) + if ((styleProps = preloadPropsMap.get(instance$318))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17176,7 +17405,7 @@ function insertStylesheetIntoRoot(root, resource) { ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -17727,7 +17956,7 @@ function dispatchEvent( ensureRootIsScheduled(fiber); 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -17947,16 +18176,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1841 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1874 = React.version; if ( - "19.0.0-www-classic-0ad0fac1-20240814" !== - isomorphicReactPackageVersion$jscomp$inline_1841 + "19.0.0-www-classic-28668d39-20241023" !== + isomorphicReactPackageVersion$jscomp$inline_1874 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1841, - "19.0.0-www-classic-0ad0fac1-20240814" + isomorphicReactPackageVersion$jscomp$inline_1874, + "19.0.0-www-classic-28668d39-20241023" ) ); function flushSyncFromReconciler(fn) { @@ -17979,7 +18208,7 @@ function flushSyncFromReconciler(fn) { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), (executionContext = prevExecutionContext), - 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); + 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(0, !1); } JSCompiler_inline_result = void 0; } @@ -17999,28 +18228,28 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1848 = { +var internals$jscomp$inline_1881 = { bundleType: 0, - version: "19.0.0-www-classic-0ad0fac1-20240814", + version: "19.0.0-www-classic-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-classic-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-classic-28668d39-20241023" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1848.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1848.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1881.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1881.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2281 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2345 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2281.isDisabled && - hook$jscomp$inline_2281.supportsFiber + !hook$jscomp$inline_2345.isDisabled && + hook$jscomp$inline_2345.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2281.inject( - internals$jscomp$inline_1848 + (rendererID = hook$jscomp$inline_2345.inject( + internals$jscomp$inline_1881 )), - (injectedHook = hook$jscomp$inline_2281); + (injectedHook = hook$jscomp$inline_2345); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18094,11 +18323,11 @@ function legacyCreateRootFromDOMContainer( if ("function" === typeof callback) { var originalCallback = callback; callback = function () { - var instance = getPublicRootInstance(root$347); + var instance = getPublicRootInstance(root$339); originalCallback.call(instance); }; } - var root$347 = createHydrationContainer( + var root$339 = createHydrationContainer( initialChildren, callback, container, @@ -18113,23 +18342,23 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$347; - container[internalContainerInstanceKey] = root$347.current; + container._reactRootContainer = root$339; + container[internalContainerInstanceKey] = root$339.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); flushSyncWork$1(); - return root$347; + return root$339; } clearContainer(container); if ("function" === typeof callback) { - var originalCallback$348 = callback; + var originalCallback$340 = callback; callback = function () { - var instance = getPublicRootInstance(root$349); - originalCallback$348.call(instance); + var instance = getPublicRootInstance(root$341); + originalCallback$340.call(instance); }; } - var root$349 = createFiberRoot( + var root$341 = createFiberRoot( container, 0, !1, @@ -18143,14 +18372,14 @@ function legacyCreateRootFromDOMContainer( null, null ); - container._reactRootContainer = root$349; - container[internalContainerInstanceKey] = root$349.current; + container._reactRootContainer = root$341; + container[internalContainerInstanceKey] = root$341.current; listenToAllSupportedEvents( 8 === container.nodeType ? container.parentNode : container ); - updateContainerSync(initialChildren, root$349, parentComponent, callback); + updateContainerSync(initialChildren, root$341, parentComponent, callback); flushSyncWork$1(); - return root$349; + return root$341; } function legacyRenderSubtreeIntoContainer( parentComponent, @@ -18464,7 +18693,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; +exports.version = "19.0.0-www-classic-28668d39-20241023"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index 5fb43cc6fee66..4ee2256e1856f 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -42,17 +42,21 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableSchedulerTimeoutInWorkLoop = dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableDebugTracing = dynamicFeatureFlags.enableDebugTracing, enableDeferRootSchedulingToMicrotask = dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask, enableDO_NOT_USE_disableStrictPassiveEffect = dynamicFeatureFlags.enableDO_NOT_USE_disableStrictPassiveEffect, + enableHiddenSubtreeInsertionEffectCleanup = + dynamicFeatureFlags.enableHiddenSubtreeInsertionEffectCleanup, enableInfiniteRenderLoopDetection = dynamicFeatureFlags.enableInfiniteRenderLoopDetection, enableNoCloningMemoCache = dynamicFeatureFlags.enableNoCloningMemoCache, enableObjectFiber = dynamicFeatureFlags.enableObjectFiber, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableRetryLaneExpiration = dynamicFeatureFlags.enableRetryLaneExpiration, + enableSiblingPrerendering = dynamicFeatureFlags.enableSiblingPrerendering, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, enableTrustedTypesIntegration = dynamicFeatureFlags.enableTrustedTypesIntegration, @@ -179,62 +183,64 @@ function describeNativeComponentFrame(fn, construct) { reentry = !0; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$1) { + control = x$1; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$1) { - control = x$1; + throw Error(); + } catch (x$2) { + control = x$2; } - fn.call(Fake.prototype); - } - } else { - try { - throw Error(); - } catch (x$2) { - control = x$2; + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", { - value: "DetermineComponentFrameRoot" - }); - try { + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( + RunInRootFrame.DetermineComponentFrameRoot, + "name" + ); + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1]; @@ -543,20 +549,6 @@ function markComponentRenderStopped() { "function" === 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 && @@ -659,31 +651,53 @@ 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))) + (warmLanes = wipLanes & -wipLanes), + suspendedLanes >= warmLanes || + (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -727,11 +741,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 claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -748,39 +757,54 @@ 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$8 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$8; - remainingLanes[index$8] = 0; - expirationTimes[index$8] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$8]; + var index$9 = 31 - clz32(remainingLanes), + lane = 1 << index$9; + entanglements[index$9] = 0; + expirationTimes[index$9] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$9]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$8] = null, index$8 = 0; - index$8 < hiddenUpdatesForLane.length; - index$8++ + hiddenUpdates[index$9] = null, index$9 = 0; + index$9 < hiddenUpdatesForLane.length; + index$9++ ) { - var update = hiddenUpdatesForLane[index$8]; + var update = hiddenUpdatesForLane[index$9]; 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; @@ -795,19 +819,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$9 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$9; - (lane & entangledLanes) | (root[index$9] & entangledLanes) && - (root[index$9] |= entangledLanes); + var index$10 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$10; + (lane & entangledLanes) | (root[index$10] & entangledLanes) && + (root[index$10] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$11 = 31 - clz32(lanes), - lane = 1 << index$11; - root[index$11].add(fiber); + var index$12 = 31 - clz32(lanes), + lane = 1 << index$12; + root[index$12].add(fiber); lanes &= ~lane; } } @@ -819,27 +843,27 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$12 = 31 - clz32(lanes); - root = 1 << index$12; - index$12 = pendingUpdatersLaneMap[index$12]; - 0 < index$12.size && - (index$12.forEach(function (fiber) { + var index$13 = 31 - clz32(lanes); + root = 1 << index$13; + index$13 = pendingUpdatersLaneMap[index$13]; + 0 < index$13.size && + (index$13.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$12.clear()); + index$13.clear()); lanes &= ~root; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$14 = 31 - clz32(lanes), - lane = 1 << index$14; - index$14 = root.transitionLanes[index$14]; - null !== index$14 && - index$14.forEach(function (transition) { + var index$15 = 31 - clz32(lanes), + lane = 1 << index$15; + index$15 = root.transitionLanes[index$15]; + null !== index$15 && + index$15.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -849,10 +873,10 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$15 = 31 - clz32(lanes), - lane = 1 << index$15; - null !== root.transitionLanes[index$15] && - (root.transitionLanes[index$15] = null); + var index$16 = 31 - clz32(lanes), + lane = 1 << index$16; + null !== root.transitionLanes[index$16] && + (root.transitionLanes[index$16] = null); lanes &= ~lane; } } @@ -1026,8 +1050,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$16 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$16 && "aria-" !== prefix$16) { + var prefix$17 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$17 && "aria-" !== prefix$17) { node.removeAttribute(name); return; } @@ -1358,15 +1382,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$22 in styles) - (styleName = styles[styleName$22]), - styles.hasOwnProperty(styleName$22) && - prevStyles[styleName$22] !== styleName && - setValueForStyle(node, styleName$22, styleName); - } else for (var styleName$23 in styles) - styles.hasOwnProperty(styleName$23) && - setValueForStyle(node, styleName$23, styles[styleName$23]); + (styleName = styles[styleName$23]), + styles.hasOwnProperty(styleName$23) && + prevStyles[styleName$23] !== styleName && + setValueForStyle(node, styleName$23, styleName); + } else + for (var styleName$24 in styles) + styles.hasOwnProperty(styleName$24) && + setValueForStyle(node, styleName$24, styles[styleName$24]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1870,6 +1894,60 @@ function getRootForUpdatedFiber(sourceFiber) { (sourceFiber = parent), (parent = sourceFiber.return); return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } +var now = Scheduler.unstable_now, + commitStartTime = -0, + profilerStartTime = -1.1, + profilerEffectDuration = -0; +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; +} +var currentUpdateIsNested = !1, + nestedUpdateScheduled = !1; +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); +} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -1889,25 +1967,44 @@ function ensureRootIsScheduled(root) { 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$28 = firstScheduledRoot; null !== root$28; ) { - if (!onlyLegacy) { - var workInProgressRootRenderLanes$30 = workInProgressRootRenderLanes; - workInProgressRootRenderLanes$30 = getNextLanes( - root$28, - root$28 === workInProgressRoot - ? workInProgressRootRenderLanes$30 - : 0 - ); - 0 !== (workInProgressRootRenderLanes$30 & 3) && - ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$28, workInProgressRootRenderLanes$30)); - } - root$28 = root$28.next; + for (var root$29 = firstScheduledRoot; null !== root$29; ) { + if (!onlyLegacy) + if (0 !== syncTransitionLanes) { + var pendingLanes = root$29.pendingLanes; + if (0 === pendingLanes) var JSCompiler_inline_result = 0; + else { + var suspendedLanes = root$29.suspendedLanes, + pingedLanes = root$29.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$29, JSCompiler_inline_result)); + } else + (JSCompiler_inline_result = workInProgressRootRenderLanes), + (JSCompiler_inline_result = getNextLanes( + root$29, + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + )), + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || + ((didPerformSomeWork = !0), + performSyncWorkOnRoot(root$29, JSCompiler_inline_result)); + root$29 = root$29.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -1915,30 +2012,29 @@ function flushSyncWorkAcrossRoots_impl(onlyLegacy) { } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = 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 |= 2; - root$jscomp$0.entangledLanes |= 2; - 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 & 3) && (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, @@ -1952,12 +2048,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$6 = 31 - clz32(pendingLanes), - lane = 1 << index$6, - expirationTime = expirationTimes[index$6]; + var index$7 = 31 - clz32(pendingLanes), + lane = 1 << index$7, + expirationTime = expirationTimes[index$7]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + expirationTimes[index$7] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -1980,39 +2076,65 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackNode = null), (root.callbackPriority = 0) ); - if (0 !== (suspendedLanes & 3)) - return ( - null !== pingedLanes && - null !== pingedLanes && - cancelCallback$1(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - suspendedLanes = ImmediatePriority; - break; - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; + if ( + 0 === (suspendedLanes & 3) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root, suspendedLanes)) + ) { + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; + } + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); + root.callbackPriority = 2; + root.callbackNode = null; + return 2; +} +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 scheduleImmediateTask(cb) { scheduleMicrotask(function () { @@ -2049,8 +2171,8 @@ function entangleAsyncAction(transition, thenable) { } function pingEngtangledActionScope() { if ( - null !== currentEntangledListeners && - 0 === --currentEntangledPendingCount + 0 === --currentEntangledPendingCount && + null !== currentEntangledListeners ) { null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled"); @@ -2209,20 +2331,20 @@ function processUpdateQueue( ? (firstBaseUpdate = firstPendingUpdate) : (lastBaseUpdate.next = firstPendingUpdate); lastBaseUpdate = lastPendingUpdate; - var current$32 = workInProgress$jscomp$0.alternate; - null !== current$32 && - ((current$32 = current$32.updateQueue), - (pendingQueue = current$32.lastBaseUpdate), + var current$34 = workInProgress$jscomp$0.alternate; + null !== current$34 && + ((current$34 = current$34.updateQueue), + (pendingQueue = current$34.lastBaseUpdate), pendingQueue !== lastBaseUpdate && (null === pendingQueue - ? (current$32.firstBaseUpdate = firstPendingUpdate) + ? (current$34.firstBaseUpdate = firstPendingUpdate) : (pendingQueue.next = firstPendingUpdate), - (current$32.lastBaseUpdate = lastPendingUpdate))); + (current$34.lastBaseUpdate = lastPendingUpdate))); } if (null !== firstBaseUpdate) { var newState = queue.baseState; lastBaseUpdate = 0; - current$32 = firstPendingUpdate = lastPendingUpdate = null; + current$34 = firstPendingUpdate = lastPendingUpdate = null; pendingQueue = firstBaseUpdate; do { var updateLane = pendingQueue.lane & -536870913, @@ -2235,8 +2357,8 @@ function processUpdateQueue( 0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = !0); - null !== current$32 && - (current$32 = current$32.next = + null !== current$34 && + (current$34 = current$34.next = { lane: 0, tag: pendingQueue.tag, @@ -2289,10 +2411,10 @@ function processUpdateQueue( callback: pendingQueue.callback, next: null }), - null === current$32 - ? ((firstPendingUpdate = current$32 = isHiddenUpdate), + null === current$34 + ? ((firstPendingUpdate = current$34 = isHiddenUpdate), (lastPendingUpdate = newState)) - : (current$32 = current$32.next = isHiddenUpdate), + : (current$34 = current$34.next = isHiddenUpdate), (lastBaseUpdate |= updateLane); pendingQueue = pendingQueue.next; if (null === pendingQueue) @@ -2305,10 +2427,10 @@ function processUpdateQueue( (queue.lastBaseUpdate = isHiddenUpdate), (queue.shared.pending = null); } while (1); - null === current$32 && (lastPendingUpdate = newState); + null === current$34 && (lastPendingUpdate = newState); queue.baseState = lastPendingUpdate; queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current$32; + queue.lastBaseUpdate = current$34; null === firstBaseUpdate && (queue.shared.lanes = 0); workInProgressRootSkippedLanes |= lastBaseUpdate; workInProgress$jscomp$0.lanes = lastBaseUpdate; @@ -3179,9 +3301,9 @@ function pushOffscreenSuspenseHandler(fiber) { push(suspenseHandlerStackCursor, fiber), null === shellBoundary) ) { - var current$67 = fiber.alternate; - null !== current$67 && - null !== current$67.memoizedState && + var current$69 = fiber.alternate; + null !== current$69 && + null !== current$69.memoizedState && (shellBoundary = fiber); } } else reuseSuspenseHandlerOnStack(fiber); @@ -3299,9 +3421,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; } @@ -3451,16 +3579,16 @@ function useMemoCache(size) { updateQueue = currentlyRenderingFiber$1.updateQueue; null !== updateQueue && (memoCache = updateQueue.memoCache); if (null == memoCache) { - var current$69 = currentlyRenderingFiber$1.alternate; - null !== current$69 && - ((current$69 = current$69.updateQueue), - null !== current$69 && - ((current$69 = current$69.memoCache), - null != current$69 && + var current$71 = currentlyRenderingFiber$1.alternate; + null !== current$71 && + ((current$71 = current$71.updateQueue), + null !== current$71 && + ((current$71 = current$71.memoCache), + null != current$71 && (memoCache = { data: enableNoCloningMemoCache - ? current$69.data - : current$69.data.map(function (array) { + ? current$71.data + : current$71.data.map(function (array) { return array.slice(); }), index: 0 @@ -3475,11 +3603,11 @@ function useMemoCache(size) { if (void 0 === updateQueue) for ( updateQueue = memoCache.data[memoCache.index] = Array(size), - current$69 = 0; - current$69 < size; - current$69++ + current$71 = 0; + current$71 < size; + current$71++ ) - updateQueue[current$69] = REACT_MEMO_CACHE_SENTINEL; + updateQueue[current$71] = REACT_MEMO_CACHE_SENTINEL; memoCache.index++; return updateQueue; } @@ -3512,7 +3640,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$70 = !1; + didReadFromEntangledAsyncAction$72 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3533,11 +3661,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$70 = !0); + (didReadFromEntangledAsyncAction$72 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$70 = !0); + (didReadFromEntangledAsyncAction$72 = !0); continue; } else (updateLane = { @@ -3583,7 +3711,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$70 && + didReadFromEntangledAsyncAction$72 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -3700,10 +3828,14 @@ function mountStateImpl(initialState) { if ("function" === typeof initialState) { var initialStateInitializer = initialState; initialState = initialStateInitializer(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - initialStateInitializer(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } hook.memoizedState = hook.baseState = initialState; hook.queue = { @@ -3781,8 +3913,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$76) { - onActionError(actionQueue, node, error$76); + } catch (error$78) { + onActionError(actionQueue, node, error$78); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -3973,17 +4105,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() { @@ -4082,10 +4213,14 @@ function updateMemo(nextCreate, deps) { if (null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; prevState = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [prevState, deps]; return prevState; } @@ -4147,14 +4282,26 @@ 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 { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition); } @@ -4213,7 +4360,7 @@ function ensureFormComponentIsStateful(formFiber) { } function requestFormReset$1(formFiber) { var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetState(formFiber, resetStateQueue, {}); + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); } function useHostTransitionStatus() { return readContext(HostTransitionContext); @@ -4231,14 +4378,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$79 = enqueueUpdate(provider, fiber, lane); - null !== root$79 && - (scheduleUpdateOnFiber(root$79, provider, lane), - entangleTransitions(root$79, provider, lane)); + var root$81 = enqueueUpdate(provider, fiber, lane); + null !== root$81 && + (scheduleUpdateOnFiber(root$81, provider, lane), + entangleTransitions(root$81, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$79 && + null !== root$81 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -4265,15 +4412,19 @@ function dispatchReducerAction(fiber, queue, action) { enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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); + enableSchedulingProfiler && markStateUpdateScheduled(fiber, 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; @@ -4287,20 +4438,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 + ); } - enableSchedulingProfiler && markStateUpdateScheduled(fiber, lane); + return !1; } function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { action = { @@ -4407,10 +4562,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); deps = void 0 === deps ? null : deps; var nextValue = nextCreate(); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - nextCreate(), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } hook.memoizedState = [nextValue, deps]; return nextValue; }, @@ -4418,10 +4577,14 @@ var HooksDispatcherOnMount = { var hook = mountWorkInProgressHook(); if (void 0 !== init) { var initialState = init(initialArg); - shouldDoubleInvokeUserFnsInHooksDEV && - (setIsStrictModeForDevtools(!0), - init(initialArg), - setIsStrictModeForDevtools(!1)); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } } else initialState = initialArg; hook.memoizedState = hook.baseState = initialState; reducer = { @@ -4675,68 +4838,6 @@ HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { }; HooksDispatcherOnRerender.unstable_useContextWithBailout = unstable_useContextWithBailout; -var now = Scheduler.unstable_now, - commitTime = 0, - layoutEffectStartTime = -1, - profilerStartTime = -1, - passiveEffectStartTime = -1, - currentUpdateIsNested = !1, - nestedUpdateScheduled = !1; -function startProfilerTimer(fiber) { - profilerStartTime = now(); - 0 > fiber.actualStartTime && (fiber.actualStartTime = now()); -} -function 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 applyDerivedStateFromProps( workInProgress, ctor, @@ -5494,6 +5595,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 && @@ -5549,6 +5651,7 @@ function replayFunctionComponent( ) { prepareToReadContext(workInProgress); enableSchedulingProfiler && markComponentRenderStarted(workInProgress); + workInProgress.updateQueue = null; nextProps = renderWithHooksAgain( workInProgress, Component, @@ -5809,7 +5912,7 @@ function updateClassComponent( nextProps = 0 !== (workInProgress.flags & 128); context || nextProps ? ((context = workInProgress.stateNode), - (current = workInProgress), + disableStringRefs || (current = workInProgress), nextProps && "function" !== typeof Component.getDerivedStateFromError ? ((Component = null), (profilerStartTime = -1)) : (enableSchedulingProfiler && @@ -6501,9 +6604,10 @@ function attemptEarlyBailoutIfNoScheduledUpdate( 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; @@ -6949,9 +7053,10 @@ function beginWork(current, workInProgress, renderLanes) { case 12: return ( (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), (props = workInProgress.stateNode), - (props.effectDuration = 0), - (props.passiveEffectDuration = 0), + (props.effectDuration = -0), + (props.passiveEffectDuration = -0), reconcileChildren( current, workInProgress, @@ -7519,12 +7624,13 @@ function preloadResourceAndSuspendIfNeeded(workInProgress, resource) { ); } 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) { if (!isHydrating) @@ -8242,50 +8348,225 @@ function unwindInterruptedWork(current, interruptedWork) { pop(markerInstanceStack); } } -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null; function shouldProfile(current) { - return 0 !== (current.mode & 2) && 0 !== (executionContext & 4); + 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 ) { - instance.props = resolveClassComponentProps( - current.type, - current.memoizedProps, - current.elementType === current.type - ); - instance.state = current.memoizedState; - if (shouldProfile(current)) { - startLayoutEffectTimer(); - try { - instance.componentWillUnmount(); - } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); - } - recordLayoutEffectDuration(current); - } else - try { - instance.componentWillUnmount(); - } catch (error$169) { - captureCommitPhaseError(current, nearestMountedAncestor, error$169); - } + 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: + 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 && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && + injectedProfilingHooks.markComponentPassiveEffectMountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && + injectedProfilingHooks.markComponentLayoutEffectMountStarted( + finishedWork + )); + lastEffect = void 0; + var create = updateQueue.create, + inst = updateQueue.inst; + lastEffect = create(); + inst.destroy = lastEffect; + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && + injectedProfilingHooks.markComponentPassiveEffectMountStopped() + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && + injectedProfilingHooks.markComponentLayoutEffectMountStopped()); + } + 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; + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && + injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( + finishedWork + ) + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && + injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( + finishedWork + )); + lastEffect = finishedWork; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + try { + destroy(); + } catch (error) { + captureCommitPhaseError( + lastEffect, + nearestMountedAncestor, + error + ); + } + enableSchedulingProfiler && + (0 !== (flags & 8) + ? enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && + injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() + : 0 !== (flags & 4) && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); + } + } + updateQueue = updateQueue.next; + } while (updateQueue !== firstEffect); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +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; + 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; + if (shouldProfile(current)) { + startEffectTimer(); + try { + instance.componentWillUnmount(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + recordEffectDuration(); + } else + try { + instance.componentWillUnmount(); + } catch (error$172) { + captureCommitPhaseError(current, nearestMountedAncestor, error$172); + } +} +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; @@ -8296,9 +8577,9 @@ function safelyAttachRef(current, nearestMountedAncestor) { if ("function" === typeof ref) if (shouldProfile(current)) try { - startLayoutEffectTimer(), (current.refCleanup = ref(instanceToUse)); + startEffectTimer(), (current.refCleanup = ref(instanceToUse)); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(); } else current.refCleanup = ref(instanceToUse); else ref.current = instanceToUse; @@ -8315,9 +8596,9 @@ function safelyDetachRef(current, nearestMountedAncestor) { try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), refCleanup(); + startEffectTimer(), refCleanup(); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } else refCleanup(); } catch (error) { @@ -8331,28 +8612,179 @@ function safelyDetachRef(current, nearestMountedAncestor) { try { if (shouldProfile(current)) try { - startLayoutEffectTimer(), ref(null); + startEffectTimer(), ref(null); } finally { - recordLayoutEffectDuration(current); + recordEffectDuration(current); } else ref(null); - } catch (error$170) { - captureCommitPhaseError(current, nearestMountedAncestor, error$170); + } catch (error$173) { + captureCommitPhaseError(current, nearestMountedAncestor, error$173); } else ref.current = null; } -function safelyCallDestroy(current, nearestMountedAncestor, destroy) { +function commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + effectDuration +) { try { - destroy(); + var _finishedWork$memoize = finishedWork.memoizedProps, + id = _finishedWork$memoize.id, + onCommit = _finishedWork$memoize.onCommit, + onRender = _finishedWork$memoize.onRender; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onRender && + onRender( + id, + current, + finishedWork.actualDuration, + finishedWork.treeBaseDuration, + finishedWork.actualStartTime, + commitStartTime + ); + "function" === typeof onCommit && + onCommit( + finishedWork.memoizedProps.id, + current, + effectDuration, + commitStartTime + ); } catch (error) { - captureCommitPhaseError(current, nearestMountedAncestor, error); + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitProfilerPostCommit( + finishedWork, + current, + commitStartTime, + passiveEffectDuration +) { + try { + var _finishedWork$memoize2 = finishedWork.memoizedProps, + id = _finishedWork$memoize2.id, + onPostCommit = _finishedWork$memoize2.onPostCommit; + current = null === current ? "mount" : "update"; + currentUpdateIsNested && (current = "nested-update"); + "function" === typeof onPostCommit && + onPostCommit(id, current, passiveEffectDuration, commitStartTime); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostMount(finishedWork) { + var type = finishedWork.type, + props = finishedWork.memoizedProps, + instance = finishedWork.stateNode; + try { + a: switch (type) { + case "button": + case "input": + case "select": + case "textarea": + props.autoFocus && instance.focus(); + break a; + case "img": + props.src + ? (instance.src = props.src) + : props.srcSet && (instance.srcset = props.srcSet); + } + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } +} +function commitHostUpdate(finishedWork, newProps, oldProps) { + try { + var domElement = finishedWork.stateNode; + updateProperties(domElement, finishedWork.type, oldProps, newProps); + domElement[internalPropsKey] = newProps; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } -var focusedInstanceHandle = null, +function isHostParent(fiber) { + return ( + 5 === fiber.tag || + 3 === fiber.tag || + 26 === fiber.tag || + 27 === fiber.tag || + 4 === fiber.tag + ); +} +function getHostSibling(fiber) { + a: for (;;) { + for (; null === fiber.sibling; ) { + if (null === fiber.return || isHostParent(fiber.return)) return null; + fiber = fiber.return; + } + fiber.sibling.return = fiber.return; + for ( + fiber = fiber.sibling; + 5 !== fiber.tag && + 6 !== fiber.tag && + 27 !== fiber.tag && + 18 !== fiber.tag; + + ) { + if (fiber.flags & 2) continue a; + if (null === fiber.child || 4 === fiber.tag) continue a; + else (fiber.child.return = fiber), (fiber = fiber.child); + } + if (!(fiber.flags & 2)) return fiber.stateNode; + } +} +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before + ? 8 === parent.nodeType + ? parent.parentNode.insertBefore(node, before) + : parent.insertBefore(node, before) + : (8 === parent.nodeType + ? ((before = parent.parentNode), before.insertBefore(node, parent)) + : ((before = parent), before.appendChild(node)), + (parent = parent._reactRootContainer), + (null !== parent && void 0 !== parent) || + null !== before.onclick || + (before.onclick = noop$1)); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); +} +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null, + focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { + root = root.containerInfo; eventsEnabled = _enabled; - root = getActiveElementDeep(); + root = getActiveElementDeep(root); if (hasSelectionCapabilities(root)) { if ("selectionStart" in root) var JSCompiler_temp = { @@ -8374,7 +8806,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$241) { + } catch (e$233) { JSCompiler_temp = null; break a; } @@ -8444,316 +8876,122 @@ function commitBeforeMutationEffects(root, firstChild) { else for (; null !== nextEffect; ) { firstChild = nextEffect; - try { - var current = firstChild.alternate, - flags = firstChild.flags, - JSCompiler_temp$jscomp$0; - if ( - (JSCompiler_temp$jscomp$0 = - !shouldFireAfterActiveInstanceBlur && - null !== focusedInstanceHandle) - ) { - var JSCompiler_temp$jscomp$1; - if ((JSCompiler_temp$jscomp$1 = 13 === firstChild.tag)) - a: { - if (null !== current) { - var oldState = current.memoizedState; - if (null === oldState || null !== oldState.dehydrated) { - var newState = firstChild.memoizedState; - JSCompiler_temp$jscomp$1 = - null !== newState && null === newState.dehydrated; - break a; - } - } - JSCompiler_temp$jscomp$1 = !1; - } - JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$1 && - doesFiberContain(firstChild, focusedInstanceHandle); - } - JSCompiler_temp$jscomp$0 && - ((shouldFireAfterActiveInstanceBlur = !0), - beforeActiveInstanceBlur(firstChild)); - switch (firstChild.tag) { - case 0: - if (0 !== (flags & 4)) { - var updateQueue = firstChild.updateQueue, - eventPayloads = - null !== updateQueue ? updateQueue.events : null; - if (null !== eventPayloads) - for (root = 0; root < eventPayloads.length; root++) { - var _eventPayloads$ii = eventPayloads[root]; - _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; - } - } - break; - case 11: - case 15: - break; - case 1: - if (0 !== (flags & 1024) && null !== current) { - var prevState = current.memoizedState, - instance = firstChild.stateNode, - snapshot = instance.getSnapshotBeforeUpdate( - resolveClassComponentProps( - firstChild.type, - current.memoizedProps, - firstChild.elementType === firstChild.type - ), - prevState - ); - instance.__reactInternalSnapshotBeforeUpdate = snapshot; - } - break; - case 3: - if (0 !== (flags & 1024)) { - var container = firstChild.stateNode.containerInfo, - nodeType = container.nodeType; - if (9 === nodeType) clearContainerSparingly(container); - else if (1 === nodeType) - switch (container.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(container); - break; - default: - container.textContent = ""; - } + root = firstChild.alternate; + JSCompiler_temp = firstChild.flags; + if ( + (anchorOffset = + !shouldFireAfterActiveInstanceBlur && + null !== focusedInstanceHandle) + ) { + if ((anchorOffset = 13 === firstChild.tag)) + a: { + if ( + null !== root && + ((anchorOffset = root.memoizedState), + null === anchorOffset || null !== anchorOffset.dehydrated) + ) { + anchorOffset = firstChild.memoizedState; + anchorOffset = + null !== anchorOffset && null === anchorOffset.dehydrated; + break a; } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (flags & 1024)) - throw Error(formatProdErrorMessage(163)); - } - } catch (error) { - captureCommitPhaseError(firstChild, firstChild.return, error); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; + anchorOffset = !1; + } + anchorOffset = + anchorOffset && doesFiberContain(firstChild, focusedInstanceHandle); } - nextEffect = firstChild.return; - } - } - current = 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), - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted && - injectedProfilingHooks.markComponentPassiveEffectUnmountStarted( - finishedWork - ) - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStarted(finishedWork)), - safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy), - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped && - injectedProfilingHooks.markComponentPassiveEffectUnmountStopped() - : 0 !== (flags & 4) && - markComponentLayoutEffectUnmountStopped())); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitHookEffectListMount(flags, finishedWork) { - var updateQueue = finishedWork.updateQueue; - updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; - if (null !== updateQueue) { - var effect = (updateQueue = updateQueue.next); - do { - if ((effect.tag & flags) === flags) { - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted && - injectedProfilingHooks.markComponentPassiveEffectMountStarted( - finishedWork + anchorOffset && + ((shouldFireAfterActiveInstanceBlur = !0), + beforeActiveInstanceBlur(firstChild)); + switch (firstChild.tag) { + case 0: + if ( + 0 !== (JSCompiler_temp & 4) && + ((root = firstChild.updateQueue), + (root = null !== root ? root.events : null), + null !== root) + ) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < root.length; + JSCompiler_temp++ ) - : 0 !== (flags & 4) && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted && - injectedProfilingHooks.markComponentLayoutEffectMountStarted( - finishedWork - )); - var destroy = effect.create; - var inst = effect.inst; - destroy = destroy(); - inst.destroy = destroy; - enableSchedulingProfiler && - (0 !== (flags & 8) - ? enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped && - injectedProfilingHooks.markComponentPassiveEffectMountStopped() - : 0 !== (flags & 4) && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped && - injectedProfilingHooks.markComponentLayoutEffectMountStopped()); - } - effect = effect.next; - } while (effect !== updateQueue); - } -} -function commitPassiveEffectDurations(finishedRoot, finishedWork) { - if (executionContext & 4 && 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$172 = commitTime, - phase = null === finishedWork.alternate ? "mount" : "update"; - currentUpdateIsNested && (phase = "nested-update"); - "function" === typeof _finishedWork$memoize && - _finishedWork$memoize(id, phase, finishedRoot, commitTime$172); - 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) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$174) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$174); - } -} -function commitClassCallbacks(finishedWork) { - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var instance = finishedWork.stateNode; - try { - commitCallbacks(updateQueue, instance); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - } -} -function commitHostComponentMount(finishedWork) { - var type = finishedWork.type, - props = finishedWork.memoizedProps, - instance = finishedWork.stateNode; - try { - a: switch (type) { - case "button": - case "input": - case "select": - case "textarea": - props.autoFocus && instance.focus(); - break a; - case "img": - props.src - ? (instance.src = props.src) - : props.srcSet && (instance.srcset = props.srcSet); - } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } -} -function commitProfilerUpdate(finishedWork, current) { - if (executionContext & 4) - try { - var _finishedWork$memoize2 = finishedWork.memoizedProps, - onCommit = _finishedWork$memoize2.onCommit, - onRender = _finishedWork$memoize2.onRender, - effectDuration = finishedWork.stateNode.effectDuration; - _finishedWork$memoize2 = commitTime; - current = null === current ? "mount" : "update"; - currentUpdateIsNested && (current = "nested-update"); - "function" === typeof onRender && - onRender( - finishedWork.memoizedProps.id, - current, - finishedWork.actualDuration, - finishedWork.treeBaseDuration, - finishedWork.actualStartTime, - _finishedWork$memoize2 - ); - "function" === typeof onCommit && - onCommit( - finishedWork.memoizedProps.id, - current, - effectDuration, - _finishedWork$memoize2 - ); - enqueuePendingPassiveProfilerEffect(finishedWork); - var parentFiber = finishedWork.return; - a: for (; null !== parentFiber; ) { - switch (parentFiber.tag) { + (anchorOffset = root[JSCompiler_temp]), + (anchorOffset.ref.impl = anchorOffset.nextImpl); + break; + case 11: + case 15: + break; + case 1: + if (0 !== (JSCompiler_temp & 1024) && null !== root) { + JSCompiler_temp = void 0; + anchorOffset = firstChild; + focusNode = root.memoizedProps; + root = root.memoizedState; + selection = anchorOffset.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + anchorOffset.type, + focusNode, + anchorOffset.elementType === anchorOffset.type + ); + JSCompiler_temp = selection.getSnapshotBeforeUpdate( + resolvedPrevProps, + root + ); + selection.__reactInternalSnapshotBeforeUpdate = JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + anchorOffset, + anchorOffset.return, + error + ); + } + } + break; case 3: - parentFiber.stateNode.effectDuration += effectDuration; - break a; - case 12: - parentFiber.stateNode.effectDuration += effectDuration; - break a; + if (0 !== (JSCompiler_temp & 1024)) + if ( + ((root = firstChild.stateNode.containerInfo), + (JSCompiler_temp = root.nodeType), + 9 === JSCompiler_temp) + ) + clearContainerSparingly(root); + else if (1 === JSCompiler_temp) + switch (root.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(root); + break; + default: + root.textContent = ""; + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (JSCompiler_temp & 1024)) + throw Error(formatProdErrorMessage(163)); + } + root = firstChild.sibling; + if (null !== root) { + root.return = firstChild.return; + nextEffect = root; + break; } - parentFiber = parentFiber.return; + nextEffect = firstChild.return; } - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } + } + resolvedPrevProps = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = !1; + focusedInstanceHandle = null; + return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8769,21 +9007,21 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { if (flags & 4) if (((finishedRoot = finishedWork.stateNode), null === current)) if (shouldProfile(finishedWork)) { - startLayoutEffectTimer(); + startEffectTimer(); try { finishedRoot.componentDidMount(); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } - recordLayoutEffectDuration(finishedWork); + recordEffectDuration(); } else try { finishedRoot.componentDidMount(); - } catch (error$175) { + } catch (error$169) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$175 + error$169 ); } else { @@ -8794,21 +9032,21 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { ); current = current.memoizedState; if (shouldProfile(finishedWork)) { - startLayoutEffectTimer(); + startEffectTimer(); try { finishedRoot.componentDidUpdate( prevProps, current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$176) { + } catch (error$170) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$176 + error$170 ); } - recordLayoutEffectDuration(finishedWork); + recordEffectDuration(); } else try { finishedRoot.componentDidUpdate( @@ -8816,11 +9054,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$177) { + } catch (error$171) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$177 + error$171 ); } } @@ -8828,24 +9066,26 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 3: + 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); + commitCallbacks(flags, prevProps); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + finishedRoot.effectDuration += popNestedEffectDurations(current); break; case 26: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8854,12 +9094,22 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { case 27: case 5: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - null === current && flags & 4 && commitHostComponentMount(finishedWork); + null === current && flags & 4 && commitHostMount(finishedWork); flags & 512 && safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); - flags & 4 && commitProfilerUpdate(finishedWork, current); + flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseLayoutEffects(finishedRoot, finishedWork), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current, + commitStartTime, + finishedRoot.effectDuration + )) + : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); break; case 13: recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -9097,75 +9347,6 @@ function detachFiberAfterEffects(fiber) { fiber.stateNode = null; fiber.updateQueue = null; } -function isHostParent(fiber) { - return ( - 5 === fiber.tag || - 3 === fiber.tag || - 26 === fiber.tag || - 27 === fiber.tag || - 4 === fiber.tag - ); -} -function getHostSibling(fiber) { - a: for (;;) { - for (; null === fiber.sibling; ) { - if (null === fiber.return || isHostParent(fiber.return)) return null; - fiber = fiber.return; - } - fiber.sibling.return = fiber.return; - for ( - fiber = fiber.sibling; - 5 !== fiber.tag && - 6 !== fiber.tag && - 27 !== fiber.tag && - 18 !== fiber.tag; - - ) { - if (fiber.flags & 2) continue a; - if (null === fiber.child || 4 === fiber.tag) continue a; - else (fiber.child.return = fiber), (fiber = fiber.child); - } - if (!(fiber.flags & 2)) return fiber.stateNode; - } -} -function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before - ? 8 === parent.nodeType - ? parent.parentNode.insertBefore(node, before) - : parent.insertBefore(node, before) - : (8 === parent.nodeType - ? ((before = parent.parentNode), before.insertBefore(node, parent)) - : ((before = parent), before.appendChild(node)), - (parent = parent._reactRootContainer), - (null !== parent && void 0 !== parent) || - null !== before.onclick || - (before.onclick = noop$1)); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} var hostParent = null, hostParentIsContainer = !1; function recursivelyTraverseDeletionEffects( @@ -9213,8 +9394,12 @@ function commitDeletionEffectsOnFiber( deletedFiber ); deletedFiber = deletedFiber.stateNode; - for (finishedRoot = deletedFiber.attributes; finishedRoot.length; ) - deletedFiber.removeAttributeNode(finishedRoot[0]); + for ( + nearestMountedAncestor = deletedFiber.attributes; + nearestMountedAncestor.length; + + ) + deletedFiber.removeAttributeNode(nearestMountedAncestor[0]); detachDeletedInstance(deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; @@ -9223,39 +9408,63 @@ function commitDeletionEffectsOnFiber( offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: - prevHostParent = hostParent; - prevHostParentIsContainer = hostParentIsContainer; + prevHostParentIsContainer = hostParent; + var prevHostParentIsContainer$182 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, deletedFiber ); - hostParent = prevHostParent; - hostParentIsContainer = prevHostParentIsContainer; - null !== hostParent && - (hostParentIsContainer - ? ((finishedRoot = hostParent), - (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? finishedRoot.parentNode.removeChild(deletedFiber) - : finishedRoot.removeChild(deletedFiber)) - : hostParent.removeChild(deletedFiber.stateNode)); + hostParent = prevHostParentIsContainer; + hostParentIsContainer = prevHostParentIsContainer$182; + if (null !== hostParent) + if (hostParentIsContainer) + try { + (finishedRoot = hostParent), + (prevHostParent = deletedFiber.stateNode), + 8 === finishedRoot.nodeType + ? finishedRoot.parentNode.removeChild(prevHostParent) + : finishedRoot.removeChild(prevHostParent); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } + else + try { + hostParent.removeChild(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError( + deletedFiber, + nearestMountedAncestor, + error + ); + } break; case 18: finishedRoot = finishedRoot.hydrationCallbacks; - null !== finishedRoot && - (finishedRoot = finishedRoot.onDeleted) && - finishedRoot(deletedFiber.stateNode); + if (null !== finishedRoot) + try { + (prevHostParentIsContainer = finishedRoot.onDeleted) && + prevHostParentIsContainer(deletedFiber.stateNode); + } catch (error) { + captureCommitPhaseError(deletedFiber, nearestMountedAncestor, error); + } null !== hostParent && (hostParentIsContainer - ? ((finishedRoot = hostParent), + ? ((nearestMountedAncestor = hostParent), (deletedFiber = deletedFiber.stateNode), - 8 === finishedRoot.nodeType - ? clearSuspenseBoundary(finishedRoot.parentNode, deletedFiber) - : 1 === finishedRoot.nodeType && - clearSuspenseBoundary(finishedRoot, deletedFiber), - retryIfBlockedOn(finishedRoot)) + 8 === nearestMountedAncestor.nodeType + ? clearSuspenseBoundary( + nearestMountedAncestor.parentNode, + deletedFiber + ) + : 1 === nearestMountedAncestor.nodeType && + clearSuspenseBoundary(nearestMountedAncestor, deletedFiber), + retryIfBlockedOn(nearestMountedAncestor)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode)); break; case 4: @@ -9275,49 +9484,11 @@ function commitDeletionEffectsOnFiber( 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) && - (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(2, deletedFiber, nearestMountedAncestor); + offscreenSubtreeWasHidden || + commitHookLayoutUnmountEffects(deletedFiber, nearestMountedAncestor, 4); recursivelyTraverseDeletionEffects( finishedRoot, nearestMountedAncestor, @@ -9370,23 +9541,28 @@ function commitDeletionEffectsOnFiber( } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { if (null === finishedWork.memoizedState) { - var current$191 = finishedWork.alternate; + var current$185 = finishedWork.alternate; if ( - null !== current$191 && - ((current$191 = current$191.memoizedState), - null !== current$191 && - ((current$191 = current$191.dehydrated), null !== current$191)) - ) + null !== current$185 && + ((current$185 = current$185.memoizedState), + null !== current$185 && + ((current$185 = current$185.dehydrated), null !== current$185)) + ) { + try { + retryIfBlockedOn(current$185); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); + } try { - retryIfBlockedOn(current$191); var hydrationCallbacks = finishedRoot.hydrationCallbacks; if (null !== hydrationCallbacks) { var onHydrated = hydrationCallbacks.onHydrated; - onHydrated && onHydrated(current$191); + onHydrated && onHydrated(current$185); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } + } } } function getRetryCache(finishedWork) { @@ -9453,39 +9629,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; ) @@ -9503,36 +9675,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); - } - if (shouldProfile(finishedWork)) { - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$193) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$193 - ); - } - recordLayoutEffectDuration(finishedWork); - } else - try { - commitHookEffectListUnmount(5, finishedWork, finishedWork.return); - } catch (error$194) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$194 - ); - } - } + flags & 4 && + (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), + commitHookEffectListMount(3, finishedWork), + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 5)); break; case 1: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9675,64 +9821,62 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags, finishedWork.memoizedProps ); - else if (root !== flags) - null === root - ? null !== current.stateNode && - ((current = current.stateNode), - current.parentNode.removeChild(current)) - : root.count--, - null === flags - ? mountHoistable( - hoistableRoot, - finishedWork.type, - finishedWork.stateNode - ) - : acquireResource( - hoistableRoot, - flags, - finishedWork.memoizedProps - ); - else if (null === flags && null !== finishedWork.stateNode) - try { - var domElement = finishedWork.stateNode, - newProps = finishedWork.memoizedProps; - updateProperties( - domElement, - finishedWork.type, - current.memoizedProps, - newProps - ); - domElement[internalPropsKey] = newProps; - } catch (error$195) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$195 - ); - } + 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; maybeNodes = finishedWork.memoizedProps; - for (i = hoistableRoot.firstChild; i; ) { - var nextNode = i.nextSibling, - nodeName = i.nodeName; - i[internalHoistableMarker] || - "HEAD" === nodeName || - "BODY" === nodeName || - "SCRIPT" === nodeName || - "STYLE" === nodeName || - ("LINK" === nodeName && "stylesheet" === i.rel.toLowerCase()) || - hoistableRoot.removeChild(i); - i = nextNode; + try { + for (var node = hoistableRoot.firstChild; node; ) { + var nextNode = node.nextSibling, + nodeName = node.nodeName; + node[internalHoistableMarker] || + "HEAD" === nodeName || + "BODY" === nodeName || + "SCRIPT" === nodeName || + "STYLE" === nodeName || + ("LINK" === nodeName && + "stylesheet" === node.rel.toLowerCase()) || + hoistableRoot.removeChild(node); + node = nextNode; + } + for ( + var type = finishedWork.type, attributes = hoistableRoot.attributes; + attributes.length; + + ) + hoistableRoot.removeAttributeNode(attributes[0]); + setInitialProperties(hoistableRoot, type, maybeNodes); + hoistableRoot[internalInstanceKey] = finishedWork; + hoistableRoot[internalPropsKey] = maybeNodes; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } - i = finishedWork.type; - for (nextNode = hoistableRoot.attributes; nextNode.length; ) - hoistableRoot.removeAttributeNode(nextNode[0]); - setInitialProperties(hoistableRoot, i, maybeNodes); - hoistableRoot[internalInstanceKey] = finishedWork; - hoistableRoot[internalPropsKey] = maybeNodes; } case 5: recursivelyTraverseMutationEffects(root, finishedWork); @@ -9744,21 +9888,18 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root = finishedWork.stateNode; try { setTextContent(root, ""); - } catch (error$196) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$196); - } - } - if (flags & 4 && ((root = finishedWork.stateNode), null != root)) { - hoistableRoot = finishedWork.memoizedProps; - current = null !== current ? current.memoizedProps : hoistableRoot; - maybeNodes = finishedWork.type; - try { - updateProperties(root, maybeNodes, current, hoistableRoot), - (root[internalPropsKey] = hoistableRoot); - } catch (error$198) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$198); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } + flags & 4 && + null != finishedWork.stateNode && + ((root = finishedWork.memoizedProps), + commitHostUpdate( + finishedWork, + root, + null !== current ? current.memoizedProps : root + )); flags & 1024 && (needsFormReset = !0); break; case 6: @@ -9767,30 +9908,32 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if (flags & 4) { if (null === finishedWork.stateNode) throw Error(formatProdErrorMessage(162)); - flags = finishedWork.stateNode; - current = finishedWork.memoizedProps; + flags = finishedWork.memoizedProps; + current = finishedWork.stateNode; try { - flags.nodeValue = current; - } catch (error$199) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$199); + current.nodeValue = flags; + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } } break; case 3: + hoistableRoot = pushNestedEffectDurations(); tagCaches = null; - hoistableRoot = currentHoistableRoot; + maybeNodes = currentHoistableRoot; currentHoistableRoot = getHoistableRoot(root.containerInfo); recursivelyTraverseMutationEffects(root, finishedWork); - currentHoistableRoot = hoistableRoot; + currentHoistableRoot = maybeNodes; commitReconciliationEffects(finishedWork); if (flags & 4 && null !== current && current.memoizedState.isDehydrated) try { retryIfBlockedOn(root.containerInfo); - } catch (error$200) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$200); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } needsFormReset && ((needsFormReset = !1), recursivelyResetForms(finishedWork)); + root.effectDuration += popNestedEffectDurations(hoistableRoot); break; case 4: flags = currentHoistableRoot; @@ -9801,6 +9944,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { 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); commitReconciliationEffects(finishedWork); @@ -9819,8 +9969,8 @@ function commitMutationEffectsOnFiber(finishedWork, root) { null !== retryQueue && suspenseCallback(new Set(retryQueue)); } } - } catch (error$202) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$202); + } catch (error) { + captureCommitPhaseError(finishedWork, finishedWork.return, error); } flags = finishedWork.updateQueue; null !== flags && @@ -9832,15 +9982,15 @@ function commitMutationEffectsOnFiber(finishedWork, root) { flags & 512 && null !== current && safelyDetachRef(current, current.return); - domElement = null !== finishedWork.memoizedState; - newProps = null !== current && null !== current.memoizedState; - suspenseCallback = offscreenSubtreeIsHidden; - retryQueue = offscreenSubtreeWasHidden; - offscreenSubtreeIsHidden = suspenseCallback || domElement; - offscreenSubtreeWasHidden = retryQueue || newProps; + node = null !== finishedWork.memoizedState; + nextNode = null !== current && null !== current.memoizedState; + nodeName = offscreenSubtreeIsHidden; + type = offscreenSubtreeWasHidden; + offscreenSubtreeIsHidden = nodeName || node; + offscreenSubtreeWasHidden = type || nextNode; recursivelyTraverseMutationEffects(root, finishedWork); - offscreenSubtreeWasHidden = retryQueue; - offscreenSubtreeIsHidden = suspenseCallback; + offscreenSubtreeWasHidden = type; + offscreenSubtreeIsHidden = nodeName; commitReconciliationEffects(finishedWork); root = finishedWork.stateNode; root._current = finishedWork; @@ -9848,13 +9998,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) { root._visibility |= root._pendingVisibility & 2; if ( flags & 8192 && - ((root._visibility = domElement + ((root._visibility = node ? root._visibility & -2 : root._visibility | 1), - domElement && + node && ((root = offscreenSubtreeIsHidden || offscreenSubtreeWasHidden), null === current || - newProps || + nextNode || root || recursivelyTraverseDisappearLayoutEffects(finishedWork)), null === finishedWork.memoizedProps || @@ -9863,45 +10013,42 @@ function commitMutationEffectsOnFiber(finishedWork, root) { a: for (current = null, root = finishedWork; ; ) { if (5 === root.tag || 26 === root.tag || 27 === root.tag) { if (null === current) { - current = root; + nextNode = current = root; try { - (hoistableRoot = root.stateNode), - domElement - ? ((maybeNodes = hoistableRoot.style), - "function" === typeof maybeNodes.setProperty - ? maybeNodes.setProperty("display", "none", "important") - : (maybeNodes.display = "none")) - : ((i = root.stateNode), - (nextNode = root.memoizedProps.style), - (nodeName = - void 0 !== nextNode && - null !== nextNode && - nextNode.hasOwnProperty("display") - ? nextNode.display - : null), - (i.style.display = - null == nodeName || "boolean" === typeof nodeName - ? "" - : ("" + nodeName).trim())); + if (((hoistableRoot = nextNode.stateNode), node)) + (maybeNodes = hoistableRoot.style), + "function" === typeof maybeNodes.setProperty + ? maybeNodes.setProperty("display", "none", "important") + : (maybeNodes.display = "none"); + else { + i = nextNode.stateNode; + var styleProp = nextNode.memoizedProps.style, + display = + void 0 !== styleProp && + null !== styleProp && + styleProp.hasOwnProperty("display") + ? styleProp.display + : null; + i.style.display = + null == display || "boolean" === typeof display + ? "" + : ("" + display).trim(); + } } catch (error) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error - ); + captureCommitPhaseError(nextNode, nextNode.return, error); } } } else if (6 === root.tag) { - if (null === current) + if (null === current) { + nextNode = root; try { - root.stateNode.nodeValue = domElement ? "" : root.memoizedProps; - } catch (error$182) { - captureCommitPhaseError( - finishedWork, - finishedWork.return, - error$182 - ); + nextNode.stateNode.nodeValue = node + ? "" + : nextNode.memoizedProps; + } catch (error) { + captureCommitPhaseError(nextNode, nextNode.return, error); } + } } else if ( ((22 !== root.tag && 23 !== root.tag) || null === root.memoizedState || @@ -9957,11 +10104,11 @@ function commitReconciliationEffects(finishedWork) { if (flags & 2) { try { if (27 !== finishedWork.tag) { - b: { + a: { for (var parent = finishedWork.return; null !== parent; ) { if (isHostParent(parent)) { var JSCompiler_inline_result = parent; - break b; + break a; } parent = parent.return; } @@ -9974,21 +10121,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$183 = JSCompiler_inline_result.stateNode; + var parent$174 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$183, ""), + (setTextContent(parent$174, ""), (JSCompiler_inline_result.flags &= -33)); - var before$184 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$184, parent$183); + var before$175 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$175, parent$174); break; case 3: case 4: - var parent$185 = JSCompiler_inline_result.stateNode.containerInfo, - before$186 = getHostSibling(finishedWork); + var parent$176 = JSCompiler_inline_result.stateNode.containerInfo, + before$177 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$186, - parent$185 + before$177, + parent$176 ); break; default: @@ -10031,14 +10178,7 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { case 11: case 14: case 15: - if (shouldProfile(finishedWork)) - try { - startLayoutEffectTimer(), - commitHookEffectListUnmount(4, finishedWork, finishedWork.return); - } finally { - recordLayoutEffectDuration(finishedWork); - } - else commitHookEffectListUnmount(4, finishedWork, finishedWork.return); + commitHookLayoutUnmountEffects(finishedWork, finishedWork.return, 4); recursivelyTraverseDisappearLayoutEffects(finishedWork); break; case 1: @@ -10077,7 +10217,7 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772); for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var current$206 = parentFiber.alternate, + var current$192 = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags; @@ -10098,23 +10238,30 @@ function recursivelyTraverseReappearLayoutEffects( finishedWork, includeWorkInProgressEffects ); - finishedRoot = finishedWork.stateNode; + current$192 = finishedWork; + finishedRoot = current$192.stateNode; if ("function" === typeof finishedRoot.componentDidMount) try { finishedRoot.componentDidMount(); } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); + captureCommitPhaseError(current$192, current$192.return, error); + } + current$192 = finishedWork; + finishedRoot = current$192.updateQueue; + if (null !== finishedRoot) { + var instance = current$192.stateNode; + try { + var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; + finishedRoot < hiddenCallbacks.length; + finishedRoot++ + ) + callCallback(hiddenCallbacks[finishedRoot], instance); + } catch (error) { + captureCommitPhaseError(current$192, current$192.return, error); } - current$206 = finishedWork.updateQueue; - if (null !== current$206) { - var hiddenCallbacks = current$206.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - current$206.shared.hiddenCallbacks = null, current$206 = 0; - current$206 < hiddenCallbacks.length; - current$206++ - ) - callCallback(hiddenCallbacks[current$206], finishedRoot); } includeWorkInProgressEffects && flags & 64 && @@ -10130,20 +10277,32 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); includeWorkInProgressEffects && - null === current$206 && + null === current$192 && flags & 4 && - commitHostComponentMount(finishedWork); + commitHostMount(finishedWork); safelyAttachRef(finishedWork, finishedWork.return); break; case 12: - recursivelyTraverseReappearLayoutEffects( - finishedRoot, - finishedWork, - includeWorkInProgressEffects - ); - includeWorkInProgressEffects && - flags & 4 && - commitProfilerUpdate(finishedWork, current$206); + includeWorkInProgressEffects && flags & 4 + ? ((flags = pushNestedEffectDurations()), + recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ), + (finishedRoot = finishedWork.stateNode), + (finishedRoot.effectDuration += bubbleNestedEffectDurations(flags)), + commitProfilerUpdate( + finishedWork, + current$192, + commitStartTime, + finishedRoot.effectDuration + )) + : recursivelyTraverseReappearLayoutEffects( + finishedRoot, + finishedWork, + includeWorkInProgressEffects + ); break; case 13: recursivelyTraverseReappearLayoutEffects( @@ -10174,22 +10333,6 @@ function recursivelyTraverseReappearLayoutEffects( parentFiber = parentFiber.sibling; } } -function commitHookPassiveMountEffects(finishedWork, hookFlags) { - if (shouldProfile(finishedWork)) { - passiveEffectStartTime = now(); - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error) { - captureCommitPhaseError(finishedWork, finishedWork.return, error); - } - recordPassiveEffectDuration(finishedWork); - } else - try { - commitHookEffectListMount(hookFlags, finishedWork); - } catch (error$207) { - captureCommitPhaseError(finishedWork, finishedWork.return, error$207); - } -} function commitOffscreenPassiveMountEffects(current, finishedWork, instance) { var previousCache = null; null !== current && @@ -10296,6 +10439,7 @@ function commitPassiveMountOnFiber( flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; case 3: + var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -10355,6 +10499,33 @@ function commitPassiveMountOnFiber( 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( @@ -10371,9 +10542,9 @@ function commitPassiveMountOnFiber( ); break; case 22: - nextCache = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? nextCache._visibility & 4 + ? prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -10381,14 +10552,14 @@ function commitPassiveMountOnFiber( committedTransitions ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) - : nextCache._visibility & 4 + : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, committedLanes, committedTransitions ) - : ((nextCache._visibility |= 4), + : ((prevEffectDuration._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10400,7 +10571,7 @@ function commitPassiveMountOnFiber( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - nextCache + prevEffectDuration ); break; case 24: @@ -10478,9 +10649,9 @@ function recursivelyTraverseReconnectPassiveEffects( ); break; case 22: - var instance$214 = finishedWork.stateNode; + var instance$200 = finishedWork.stateNode; null !== finishedWork.memoizedState - ? instance$214._visibility & 4 + ? instance$200._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10492,7 +10663,7 @@ function recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork ) - : ((instance$214._visibility |= 4), + : ((instance$200._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, @@ -10505,7 +10676,7 @@ function recursivelyTraverseReconnectPassiveEffects( commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork, - instance$214 + instance$200 ); break; case 24: @@ -10634,25 +10805,6 @@ function detachAlternateSiblings(parentFiber) { while (null !== parentFiber); } } -function commitHookPassiveUnmountEffects( - finishedWork, - nearestMountedAncestor, - hookFlags -) { - shouldProfile(finishedWork) - ? ((passiveEffectStartTime = now()), - commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ), - recordPassiveEffectDuration(finishedWork)) - : commitHookEffectListUnmount( - hookFlags, - finishedWork, - nearestMountedAncestor - ); -} function recursivelyTraversePassiveUnmountEffects(parentFiber) { var deletions = parentFiber.deletions; if (0 !== (parentFiber.flags & 16)) { @@ -10681,12 +10833,24 @@ function commitPassiveUnmountOnFiber(finishedWork) { finishedWork.flags & 2048 && commitHookPassiveUnmountEffects(finishedWork, finishedWork.return, 9); 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; @@ -10829,19 +10993,20 @@ 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; - } - }, - postPaintCallbackScheduled = !1, + 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 postPaintCallbackScheduled = !1, callbacks = []; function schedulePostPaintCallback(callback) { callbacks.push(callback); @@ -10860,6 +11025,8 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, + workInProgressRootDidSkipSuspendedSiblings = !1, + workInProgressRootIsPrerendering = !1, workInProgressRootDidAttachPingListener = !1, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, @@ -10867,6 +11034,7 @@ var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, + workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = !1, @@ -10941,7 +11109,6 @@ var legacyErrorBoundariesThatAlreadyFailed = null, rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, - pendingPassiveProfilerEffects = [], pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, nestedUpdateCount = 0, @@ -10974,7 +11141,8 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) { @@ -10988,11 +11156,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$13 = 31 - clz32(lane), - transitions = transitionLanesMap[index$13]; + index$14 = 31 - clz32(lane), + transitions = transitionLanesMap[index$14]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$13] = transitions; + transitionLanesMap[index$14] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -11001,163 +11169,181 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 )); ensureRootIsScheduled(root); } } -function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; +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 = - 0 === (lanes & 60) && - 0 === (lanes & root.expiredLanes) && - (disableSchedulerTimeoutInWorkLoop || !didTimeout)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) markRootSuspended(root, lanes, 0); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + (enableSiblingPrerendering && + checkIfRootIsPrerendering(root$jscomp$0, lanes)), + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) { + enableSiblingPrerendering && + workInProgressRootIsPrerendering && + !shouldTimeSlice && + markRootSuspended(root$jscomp$0, lanes, 0, !1); + break; + } else if (6 === exitStatus) + markRootSuspended( + root$jscomp$0, + lanes, + 0, + !workInProgressRootDidSkipSuspendedSiblings + ); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + 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; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0); - break; - } - root.finishedWork = didTimeout; - root.finishedLanes = lanes; - a: { - renderWasConcurrent = root; - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - if ( - (lanes & 62914560) === lanes && - (alwaysThrottleRetries || 3 === exitStatus) && - ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane - ), - exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + (alwaysThrottleRetries || 3 === renderWasConcurrent) && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now$1()), + 10 < renderWasConcurrent) + ) { + markRootSuspended( + shouldTimeSlice, lanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !workInProgressRootDidSkipSuspendedSiblings + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } 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 (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -11174,7 +11360,13 @@ function commitRootWhenReady( transitions, didIncludeRenderPhaseUpdate, lanes, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var subtreeFlags = finishedWork.subtreeFlags; if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) @@ -11190,10 +11382,16 @@ function commitRootWhenReady( root, recoverableErrors, transitions, - didIncludeRenderPhaseUpdate + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane); + markRootSuspended(root, lanes, spawnedLane, !didSkipSuspendedSiblings); return; } commitRoot( @@ -11201,31 +11399,36 @@ function commitRootWhenReady( 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) { - 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; ) { @@ -11241,79 +11444,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, + didAttemptEntireTree +) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - for ( - var expirationTimes = root.expirationTimes, lanes = suspendedLanes; - 0 < lanes; - - ) { - var index$7 = 31 - clz32(lanes), - lane = 1 << index$7; - expirationTimes[index$7] = -1; + enableSiblingPrerendering && + didAttemptEntireTree && + (root.warmLanes |= suspendedLanes); + didAttemptEntireTree = root.expirationTimes; + for (var lanes = suspendedLanes; 0 < lanes; ) { + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + didAttemptEntireTree[index$8] = -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; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - 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$1() { return 0 === (executionContext & 6) - ? (flushSyncWorkAcrossRoots_impl(!1), !1) + ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) : !0; } function resetWorkInProgressStack() { @@ -11348,8 +11511,11 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; + workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); workInProgressRootDidAttachPingListener = !1; - workInProgressDeferredLane = + workInProgressSuspendedRetryLanes = + workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = @@ -11366,9 +11532,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$5 = 31 - clz32(allEntangledLanes), - lane = 1 << index$5; - lanes |= root[index$5]; + var index$6 = 31 - clz32(allEntangledLanes), + lane = 1 << index$6; + lanes |= root[index$6]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11378,10 +11544,11 @@ function prepareFreshStack(root, lanes) { function handleThrow(root, thrownValue) { currentlyRenderingFiber$1 = null; ReactSharedInternals.H = ContextOnlyDispatcher; - current = null; + disableStringRefs || (current = null); thrownValue === SuspenseException ? ((thrownValue = getSuspendedThenable()), (workInProgressSuspendedReason = + !enableSiblingPrerendering && shouldRemainOnPreviousScreen() && 0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) @@ -11408,7 +11575,7 @@ function handleThrow(root, thrownValue) { ); else if ( (erroredWork.mode & 2 && - stopProfilerTimerIfRunningAndRecordDelta(erroredWork, !0), + stopProfilerTimerIfRunningAndRecordDuration(erroredWork), enableSchedulingProfiler) ) switch ((markComponentRenderStopped(), workInProgressSuspendedReason)) { @@ -11463,16 +11630,22 @@ function pushAsyncDispatcher() { } function renderDidSuspendDelayIfPossible() { workInProgressRootExitStatus = 4; + workInProgressRootDidSkipSuspendedSiblings || + ((workInProgressRootRenderLanes & 4194176) !== + workInProgressRootRenderLanes && + null !== suspenseHandlerStackCursor.current) || + (workInProgressRootIsPrerendering = !0); (0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727)) || null === workInProgressRoot || markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane + workInProgressDeferredLane, + !1 ); } -function renderRootSync(root, lanes) { +function renderRootSync(root, lanes, shouldYieldForPrerendering) { var prevExecutionContext = executionContext; executionContext |= 2; var prevDispatcher = pushDispatcher(), @@ -11490,31 +11663,46 @@ function renderRootSync(root, lanes) { } enableSchedulingProfiler && markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + memoizedUpdaters = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); + var reason = workInProgressSuspendedReason; + workInProgressSuspendedReason = 0; + workInProgressThrownValue = null; + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + if ( + enableSiblingPrerendering && + shouldYieldForPrerendering && + workInProgressRootIsPrerendering + ) { + memoizedUpdaters = 0; + break a; + } + break; default: - (workInProgressSuspendedReason = 0), + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$225) { - handleThrow(root, thrownValue$225); + } catch (thrownValue$217) { + handleThrow(root, thrownValue$217); } while (1); lanes && root.shellSuspendCounter++; @@ -11522,12 +11710,12 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); enableSchedulingProfiler && markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11548,7 +11736,8 @@ function renderRootConcurrent(root, lanes) { workInProgressTransitions = getTransitionsForLanes(root, lanes); workInProgressRootRenderTargetTime = now$1() + 500; prepareFreshStack(root, lanes); - } + } else + workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root, lanes); enableSchedulingProfiler && markRenderStarted(lanes); a: do try { @@ -11561,7 +11750,7 @@ function renderRootConcurrent(root, lanes) { case 1: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 1); break; case 2: if (isThenableResolved(memoizedUpdaters)) { @@ -11591,7 +11780,7 @@ function renderRootConcurrent(root, lanes) { replaySuspendedUnitOfWork(lanes)) : ((workInProgressSuspendedReason = 0), (workInProgressThrownValue = null), - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters)); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 7)); break; case 5: var resource = null; @@ -11618,12 +11807,12 @@ function renderRootConcurrent(root, lanes) { } workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 5); break; case 6: workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters); + throwAndUnwindWorkLoop(root, lanes, memoizedUpdaters, 6); break; case 8: resetWorkInProgressStack(); @@ -11634,8 +11823,8 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$227) { - handleThrow(root, thrownValue$227); + } catch (thrownValue$219) { + handleThrow(root, thrownValue$219); } while (1); resetContextDependencies(); @@ -11670,13 +11859,13 @@ function performUnitOfWork(unitOfWork) { unitOfWork, entangledRenderLanes )), - stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, !0)) + stopProfilerTimerIfRunningAndRecordDuration(unitOfWork)) : (current$jscomp$0 = beginWork( current$jscomp$0, unitOfWork, entangledRenderLanes )); - current = null; + disableStringRefs || (current = null); unitOfWork.memoizedProps = unitOfWork.pendingProps; null === current$jscomp$0 ? completeUnitOfWork(unitOfWork) @@ -11733,13 +11922,18 @@ function replaySuspendedUnitOfWork(unitOfWork) { entangledRenderLanes )); } - isProfilingMode && stopProfilerTimerIfRunningAndRecordDelta(next, !0); + isProfilingMode && stopProfilerTimerIfRunningAndRecordDuration(next); next = current$jscomp$0; - 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; @@ -11773,56 +11967,52 @@ function throwAndUnwindWorkLoop(root, unitOfWork, thrownValue) { workInProgress = null; return; } - if (unitOfWork.flags & 32768) - a: { - root = unitOfWork; - do { - unitOfWork = unwindWork(root.alternate, root); - if (null !== unitOfWork) { - unitOfWork.flags &= 32767; - workInProgress = unitOfWork; - break a; - } - if (0 !== (root.mode & 2)) { - stopProfilerTimerIfRunningAndRecordDelta(root, !1); - unitOfWork = root.actualDuration; - for (thrownValue = root.child; null !== thrownValue; ) - (unitOfWork += thrownValue.actualDuration), - (thrownValue = thrownValue.sibling); - root.actualDuration = unitOfWork; - } - root = root.return; - null !== root && - ((root.flags |= 32768), - (root.subtreeFlags = 0), - (root.deletions = null)); - workInProgress = root; - } while (null !== root); - workInProgressRootExitStatus = 6; - workInProgress = null; - } - else completeUnitOfWork(unitOfWork); + if (unitOfWork.flags & 32768) { + if (enableSiblingPrerendering) + if (isHydrating || 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 { - var current$231 = completedWork.alternate; + if (0 !== (completedWork.flags & 32768)) { + unwindUnitOfWork( + completedWork, + workInProgressRootDidSkipSuspendedSiblings + ); + return; + } + var current$223 = completedWork.alternate; unitOfWork = completedWork.return; - 0 === (completedWork.mode & 2) - ? (current$231 = completeWork( - current$231, - completedWork, - entangledRenderLanes - )) - : (startProfilerTimer(completedWork), - (current$231 = completeWork( - current$231, - completedWork, - entangledRenderLanes - )), - stopProfilerTimerIfRunningAndRecordDelta(completedWork, !1)); - if (null !== current$231) { - workInProgress = current$231; + startProfilerTimer(completedWork); + current$223 = completeWork( + current$223, + completedWork, + entangledRenderLanes + ); + 0 !== (completedWork.mode & 2) && + stopProfilerTimerIfRunningAndRecordIncompleteDuration(completedWork); + if (null !== current$223) { + workInProgress = current$223; return; } completedWork = completedWork.sibling; @@ -11834,12 +12024,47 @@ function completeUnitOfWork(unitOfWork) { } while (null !== completedWork); 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); } +function unwindUnitOfWork(unitOfWork, skipSiblings) { + do { + var next = unwindWork(unitOfWork.alternate, unitOfWork); + if (null !== next) { + next.flags &= 32767; + workInProgress = next; + return; + } + if (0 !== (unitOfWork.mode & 2)) { + 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 = 6; + workInProgress = null; +} function commitRoot( root, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = Internals.p; @@ -11852,13 +12077,17 @@ function commitRoot( transitions, didIncludeRenderPhaseUpdate, previousUpdateLanePriority, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (Internals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11866,7 +12095,9 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane + spawnedLane, + updatedLanes, + suspendedRetryLanes ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11888,7 +12119,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), @@ -11900,47 +12138,44 @@ function commitRootImpl( (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 = 2; - var prevExecutionContext = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$233 = commitBeforeMutationEffects( - root, - finishedWork - ); - commitTime = now(); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$233 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; - root.current = finishedWork; - enableSchedulingProfiler && + 0 !== (finishedWork.subtreeFlags & 15990) || transitions + ? ((transitions = ReactSharedInternals.T), + (ReactSharedInternals.T = null), + (spawnedLane = Internals.p), + (Internals.p = 2), + (updatedLanes = executionContext), + (executionContext |= 4), + (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), enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), 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); rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11971,7 +12206,7 @@ function commitRootImpl( ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); enableSchedulingProfiler && markCommitStopped(); if (enableTransitionTracing) { var prevRootTransitionCallbacks = root.transitionCallbacks; @@ -11998,9 +12233,9 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { - var root$234 = rootWithPendingPassiveEffects, + var root$226 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12010,25 +12245,16 @@ function flushPassiveEffects() { return ( (Internals.p = 32 > renderPriority ? 32 : renderPriority), (ReactSharedInternals.T = null), - flushPassiveEffectsImpl() + flushPassiveEffectsImpl(wasDelayedCommit) ); } finally { (Internals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$234, remainingLanes); + releaseRootPooledCache(root$226, remainingLanes); } } 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; @@ -12047,17 +12273,13 @@ function flushPassiveEffectsImpl() { executionContext |= 4; commitPassiveUnmountOnFiber(root.current); commitPassiveMountOnFiber(root, root.current, lanes, transitions); - transitions = pendingPassiveProfilerEffects; - pendingPassiveProfilerEffects = []; - for (lanes = 0; lanes < transitions.length; lanes++) - commitPassiveEffectDurations(root, transitions[lanes]); enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markPassiveEffectsStopped && injectedProfilingHooks.markPassiveEffectsStopped(); executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(!1); + flushSyncWorkAcrossRoots_impl(0, !1); if (enableTransitionTracing) { var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks, prevRootTransitionCallbacks = root.transitionCallbacks, @@ -12078,9 +12300,9 @@ function flushPassiveEffectsImpl() { try { injectedHook.onPostCommitFiberRoot(rendererID, root); } catch (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) { @@ -12150,6 +12372,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) @@ -12163,7 +12386,9 @@ function pingSuspendedRoot(root, wakeable, pingedLanes) { workInProgressRootRenderLanes && 300 > now$1() - globalMostRecentFallbackTime) ? 0 === (executionContext & 2) && prepareFreshStack(root, 0) - : (workInProgressRootPingedLanes |= pingedLanes)); + : (workInProgressRootPingedLanes |= pingedLanes), + workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && + (workInProgressSuspendedRetryLanes = 0)); ensureRootIsScheduled(root); } function retryTimedOutBoundary(boundaryFiber, retryLane) { @@ -12244,9 +12469,9 @@ function FiberNode(tag, pendingProps, key, mode) { 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; } function createFiberImplClass(tag, pendingProps, key, mode) { return new FiberNode(tag, pendingProps, key, mode); @@ -12276,10 +12501,10 @@ function createFiberImplObject(tag, pendingProps, key, mode) { key: key, pendingProps: pendingProps, mode: mode, - actualDuration: 0, - actualStartTime: -1, - selfBaseDuration: 0, - treeBaseDuration: 0 + actualDuration: -0, + actualStartTime: -1.1, + selfBaseDuration: -0, + treeBaseDuration: -0 }; } var createFiber = enableObjectFiber @@ -12308,8 +12533,8 @@ function createWorkInProgress(current, pendingProps) { (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; @@ -12591,6 +12816,7 @@ function FiberRootNode( this.errorRecoveryDisabledLanes = this.finishedLanes = this.expiredLanes = + this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = @@ -12615,7 +12841,7 @@ function FiberRootNode( tag++ ) containerInfo.push(null); - this.passiveEffectDuration = this.effectDuration = 0; + this.passiveEffectDuration = this.effectDuration = -0; this.memoizedUpdaters = new Set(); containerInfo = this.pendingUpdatersLaneMap = []; for (tag = 0; 31 > tag; tag++) containerInfo.push(new Set()); @@ -12734,9 +12960,9 @@ function attemptContinuousHydration(fiber) { function getLaneLabelMap() { if (enableSchedulingProfiler) { for ( - var map = new Map(), lane = 1, index$239 = 0; - 31 > index$239; - index$239++ + var map = new Map(), lane = 1, index$231 = 0; + 31 > index$231; + index$231++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -13310,19 +13536,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$397; + var JSCompiler_inline_result$jscomp$389; if (canUseDOM) { - var isSupported$jscomp$inline_1598 = "oninput" in document; - if (!isSupported$jscomp$inline_1598) { - var element$jscomp$inline_1599 = document.createElement("div"); - element$jscomp$inline_1599.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1598 = - "function" === typeof element$jscomp$inline_1599.oninput; + var isSupported$jscomp$inline_1631 = "oninput" in document; + if (!isSupported$jscomp$inline_1631) { + var element$jscomp$inline_1632 = document.createElement("div"); + element$jscomp$inline_1632.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1631 = + "function" === typeof element$jscomp$inline_1632.oninput; } - JSCompiler_inline_result$jscomp$397 = isSupported$jscomp$inline_1598; - } else JSCompiler_inline_result$jscomp$397 = !1; + JSCompiler_inline_result$jscomp$389 = isSupported$jscomp$inline_1631; + } else JSCompiler_inline_result$jscomp$389 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$397 && + JSCompiler_inline_result$jscomp$389 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13410,10 +13636,16 @@ function containsNode(outerNode, innerNode) { : !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 { @@ -13422,9 +13654,9 @@ function getActiveElementDeep() { } 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; } @@ -13442,101 +13674,95 @@ function hasSelectionCapabilities(elem) { "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) - ) + if (null !== priorSelectionRange && 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); } } var skipSelectionChangeEvent = @@ -13733,20 +13959,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1639 = 0; - i$jscomp$inline_1639 < simpleEventPluginEvents.length; - i$jscomp$inline_1639++ + var i$jscomp$inline_1672 = 0; + i$jscomp$inline_1672 < simpleEventPluginEvents.length; + i$jscomp$inline_1672++ ) { - var eventName$jscomp$inline_1640 = - simpleEventPluginEvents[i$jscomp$inline_1639], - domEventName$jscomp$inline_1641 = - eventName$jscomp$inline_1640.toLowerCase(), - capitalizedEvent$jscomp$inline_1642 = - eventName$jscomp$inline_1640[0].toUpperCase() + - eventName$jscomp$inline_1640.slice(1); + var eventName$jscomp$inline_1673 = + simpleEventPluginEvents[i$jscomp$inline_1672], + domEventName$jscomp$inline_1674 = + eventName$jscomp$inline_1673.toLowerCase(), + capitalizedEvent$jscomp$inline_1675 = + eventName$jscomp$inline_1673[0].toUpperCase() + + eventName$jscomp$inline_1673.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1641, - "on" + capitalizedEvent$jscomp$inline_1642 + domEventName$jscomp$inline_1674, + "on" + capitalizedEvent$jscomp$inline_1675 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15035,34 +15261,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$255 = props[hasSrc]; - if (null != propValue$255) + var propValue$247 = props[hasSrc]; + if (null != propValue$247) switch (hasSrc) { case "name": - hasSrcSet = propValue$255; + hasSrcSet = propValue$247; break; case "type": - propKey = propValue$255; + propKey = propValue$247; break; case "checked": - checked = propValue$255; + checked = propValue$247; break; case "defaultChecked": - defaultChecked = propValue$255; + defaultChecked = propValue$247; break; case "value": - propValue = propValue$255; + propValue = propValue$247; break; case "defaultValue": - defaultValue = propValue$255; + defaultValue = propValue$247; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$255) + if (null != propValue$247) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$255, props, null); + setProp(domElement, tag, hasSrc, propValue$247, props, null); } } initInput( @@ -15198,14 +15424,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$255 in props) - props.hasOwnProperty(propValue$255) && - ((hasSrc = props[propValue$255]), + for (propValue$247 in props) + props.hasOwnProperty(propValue$247) && + ((hasSrc = props[propValue$247]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$255, + propValue$247, hasSrc, props, void 0 @@ -15253,14 +15479,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$272 in nextProps) { - var propKey = nextProps[propKey$272]; - lastProp = lastProps[propKey$272]; + for (var propKey$264 in nextProps) { + var propKey = nextProps[propKey$264]; + lastProp = lastProps[propKey$264]; if ( - nextProps.hasOwnProperty(propKey$272) && + nextProps.hasOwnProperty(propKey$264) && (null != propKey || null != lastProp) ) - switch (propKey$272) { + switch (propKey$264) { case "type": type = propKey; break; @@ -15289,7 +15515,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$272, + propKey$264, propKey, nextProps, lastProp @@ -15308,7 +15534,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$272 = null; + propKey = value = defaultValue = propKey$264 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15339,7 +15565,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$272 = type; + propKey$264 = type; break; case "defaultValue": defaultValue = type; @@ -15360,15 +15586,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$272 - ? updateOptions(domElement, !!lastProps, propKey$272, !1) + null != propKey$264 + ? updateOptions(domElement, !!lastProps, propKey$264, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$272 = null; + propKey = propKey$264 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15392,7 +15618,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$272 = name; + propKey$264 = name; break; case "defaultValue": propKey = name; @@ -15406,17 +15632,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$272, propKey); + updateTextarea(domElement, propKey$264, propKey); return; case "option": - for (var propKey$288 in lastProps) + for (var propKey$280 in lastProps) if ( - ((propKey$272 = lastProps[propKey$288]), - lastProps.hasOwnProperty(propKey$288) && - null != propKey$272 && - !nextProps.hasOwnProperty(propKey$288)) + ((propKey$264 = lastProps[propKey$280]), + lastProps.hasOwnProperty(propKey$280) && + null != propKey$264 && + !nextProps.hasOwnProperty(propKey$280)) ) - switch (propKey$288) { + switch (propKey$280) { case "selected": domElement.selected = !1; break; @@ -15424,33 +15650,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$288, + propKey$280, null, nextProps, - propKey$272 + propKey$264 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$272 = nextProps[lastDefaultValue]), + ((propKey$264 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$272 !== propKey && - (null != propKey$272 || null != propKey)) + propKey$264 !== propKey && + (null != propKey$264 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$272 && - "function" !== typeof propKey$272 && - "symbol" !== typeof propKey$272; + propKey$264 && + "function" !== typeof propKey$264 && + "symbol" !== typeof propKey$264; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$272, + propKey$264, nextProps, propKey ); @@ -15471,24 +15697,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$293 in lastProps) - (propKey$272 = lastProps[propKey$293]), - lastProps.hasOwnProperty(propKey$293) && - null != propKey$272 && - !nextProps.hasOwnProperty(propKey$293) && - setProp(domElement, tag, propKey$293, null, nextProps, propKey$272); + for (var propKey$285 in lastProps) + (propKey$264 = lastProps[propKey$285]), + lastProps.hasOwnProperty(propKey$285) && + null != propKey$264 && + !nextProps.hasOwnProperty(propKey$285) && + setProp(domElement, tag, propKey$285, null, nextProps, propKey$264); for (checked in nextProps) if ( - ((propKey$272 = nextProps[checked]), + ((propKey$264 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$272 !== propKey && - (null != propKey$272 || null != propKey)) + propKey$264 !== propKey && + (null != propKey$264 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$272) + if (null != propKey$264) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15496,7 +15722,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$272, + propKey$264, nextProps, propKey ); @@ -15504,49 +15730,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$298 in lastProps) - (propKey$272 = lastProps[propKey$298]), - lastProps.hasOwnProperty(propKey$298) && - void 0 !== propKey$272 && - !nextProps.hasOwnProperty(propKey$298) && + for (var propKey$290 in lastProps) + (propKey$264 = lastProps[propKey$290]), + lastProps.hasOwnProperty(propKey$290) && + void 0 !== propKey$264 && + !nextProps.hasOwnProperty(propKey$290) && setPropOnCustomElement( domElement, tag, - propKey$298, + propKey$290, void 0, nextProps, - propKey$272 + propKey$264 ); for (defaultChecked in nextProps) - (propKey$272 = nextProps[defaultChecked]), + (propKey$264 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$272 === propKey || - (void 0 === propKey$272 && void 0 === propKey) || + propKey$264 === propKey || + (void 0 === propKey$264 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$272, + propKey$264, nextProps, propKey ); return; } } - for (var propKey$303 in lastProps) - (propKey$272 = lastProps[propKey$303]), - lastProps.hasOwnProperty(propKey$303) && - null != propKey$272 && - !nextProps.hasOwnProperty(propKey$303) && - setProp(domElement, tag, propKey$303, null, nextProps, propKey$272); + for (var propKey$295 in lastProps) + (propKey$264 = lastProps[propKey$295]), + lastProps.hasOwnProperty(propKey$295) && + null != propKey$264 && + !nextProps.hasOwnProperty(propKey$295) && + setProp(domElement, tag, propKey$295, null, nextProps, propKey$264); for (lastProp in nextProps) - (propKey$272 = nextProps[lastProp]), + (propKey$264 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$272 === propKey || - (null == propKey$272 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$272, nextProps, propKey); + propKey$264 === propKey || + (null == propKey$264 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$264, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16124,26 +16350,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$311 = getResourcesFromRoot( + var styles$303 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$312 = styles$311.get(type); - resource$312 || + resource$304 = styles$303.get(type); + resource$304 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$312 = { + (resource$304 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$311.set(type, resource$312), - (styles$311 = JSCompiler_inline_result.querySelector( + styles$303.set(type, resource$304), + (styles$303 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$311._p && - ((resource$312.instance = styles$311), - (resource$312.state.loading = 5)), + !styles$303._p && + ((resource$304.instance = styles$303), + (resource$304.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16156,16 +16382,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$311 || + styles$303 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$312.state + resource$304.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$312; + return resource$304; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16262,37 +16488,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$317 = hoistableRoot.querySelector( + var instance$309 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$317) + if (instance$309) return ( (resource.state.loading |= 4), - (resource.instance = instance$317), - markNodeAsHoistable(instance$317), - instance$317 + (resource.instance = instance$309), + markNodeAsHoistable(instance$309), + instance$309 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$317 = ( + instance$309 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$317); - var linkInstance = instance$317; + markNodeAsHoistable(instance$309); + var linkInstance = instance$309; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$317, "link", instance); + setInitialProperties(instance$309, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$317, props.precedence, hoistableRoot); - return (resource.instance = instance$317); + insertStylesheet(instance$309, props.precedence, hoistableRoot); + return (resource.instance = instance$309); case "script": - instance$317 = getScriptKey(props.src); + instance$309 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$317) + getScriptSelectorFromKey(instance$309) )) ) return ( @@ -16301,7 +16527,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$317))) + if ((styleProps = preloadPropsMap.get(instance$309))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16562,7 +16788,7 @@ function insertStylesheetIntoRoot(root, resource) { ) { var node = nodes[i]; if ( - "link" === node.nodeName || + "LINK" === node.nodeName || "not all" !== node.getAttribute("media") ) precedences.set(node.dataset.precedence, node), (last = node); @@ -17113,7 +17339,7 @@ function dispatchEvent( ensureRootIsScheduled(fiber); 0 === (executionContext & 6) && ((workInProgressRootRenderTargetTime = now$1() + 500), - flushSyncWorkAcrossRoots_impl(!1)); + flushSyncWorkAcrossRoots_impl(0, !1)); } } break; @@ -17304,16 +17530,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1812 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1845 = React.version; if ( - "19.0.0-www-modern-0ad0fac1-20240814" !== - isomorphicReactPackageVersion$jscomp$inline_1812 + "19.0.0-www-modern-28668d39-20241023" !== + isomorphicReactPackageVersion$jscomp$inline_1845 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1812, - "19.0.0-www-modern-0ad0fac1-20240814" + isomorphicReactPackageVersion$jscomp$inline_1845, + "19.0.0-www-modern-28668d39-20241023" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17329,28 +17555,28 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1814 = { +var internals$jscomp$inline_1847 = { bundleType: 0, - version: "19.0.0-www-modern-0ad0fac1-20240814", + version: "19.0.0-www-modern-28668d39-20241023", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-www-modern-0ad0fac1-20240814" + reconcilerVersion: "19.0.0-www-modern-28668d39-20241023" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1814.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1814.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1847.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1847.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2273 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2338 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2273.isDisabled && - hook$jscomp$inline_2273.supportsFiber + !hook$jscomp$inline_2338.isDisabled && + hook$jscomp$inline_2338.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2273.inject( - internals$jscomp$inline_1814 + (rendererID = hook$jscomp$inline_2338.inject( + internals$jscomp$inline_1847 )), - (injectedHook = hook$jscomp$inline_2273); + (injectedHook = hook$jscomp$inline_2338); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17701,7 +17927,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; +exports.version = "19.0.0-www-modern-28668d39-20241023"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index 6abbcb378f888..6c211a4a33e60 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -4119,64 +4119,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -4185,54 +4185,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -4243,7 +4247,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -4335,7 +4339,6 @@ __DEV__ && } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4348,8 +4351,7 @@ __DEV__ && onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4357,12 +4359,12 @@ __DEV__ && this.rootFormatContext = rootFormatContext; this.progressiveChunkSize = void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize; - this.status = 0; + this.status = 10; this.fatalError = null; this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4375,34 +4377,6 @@ __DEV__ && this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1, - emptyContextObject - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4418,8 +4392,7 @@ __DEV__ && onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4432,6 +4405,35 @@ __DEV__ && onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1, + emptyContextObject + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -4665,7 +4667,7 @@ __DEV__ && onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 2), (request.fatalError = error)); + : ((request.status = 13), (request.fatalError = error)); } function renderWithHooks( request, @@ -5187,7 +5189,7 @@ __DEV__ && } else internalInstance.queue = null; } var nextChildren = callRenderInDEV(instance); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; instance.props !== resolvedProps && (didWarnAboutReassigningProps || error$jscomp$2( @@ -5255,7 +5257,7 @@ __DEV__ && props, legacyContext ); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; var hasId = 0 !== localIdCounter, actionStateCount = actionStateCounter, actionStateMatchingIndex$jscomp$0 = actionStateMatchingIndex; @@ -5498,8 +5500,7 @@ __DEV__ && (boundarySegment.status = COMPLETED); } catch (thrownValue) { throw ( - ((boundarySegment.status = - thrownValue === AbortSigil ? 3 : 4), + ((boundarySegment.status = 12 === request.status ? 3 : 4), thrownValue) ); } finally { @@ -5550,7 +5551,7 @@ __DEV__ && } } catch (thrownValue$2) { newBoundary.status = CLIENT_RENDERED; - if (thrownValue$2 === AbortSigil) { + if (12 === request.status) { contentRootSegment.status = 3; var error = request.fatalError; } else @@ -5673,7 +5674,7 @@ __DEV__ && } case REACT_LAZY_TYPE: var Component = callLazyInitInDEV(type); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; var resolvedProps$jscomp$1 = resolveDefaultPropsOnNonClassComponent(Component, props); renderElement( @@ -5837,6 +5838,7 @@ __DEV__ && resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -5917,7 +5919,7 @@ __DEV__ && ); case REACT_LAZY_TYPE: node = callLazyInitInDEV(node); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; renderNodeDestructive(request, task, node, childIndex); return; } @@ -6185,6 +6187,55 @@ __DEV__ && void 0 !== boundary && ((boundary.length = 4), (boundary[2] = []), (boundary[3] = null)))); } + function spawnNewSuspendedReplayTask(request, task, thenableState) { + return createReplayTask( + request, + thenableState, + task.replay, + task.node, + task.childIndex, + task.blockedBoundary, + task.hoistableState, + task.abortSet, + task.keyPath, + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + task.isFallback, + task.legacyContext + ); + } + function spawnNewSuspendedRenderTask(request, task, thenableState) { + var segment = task.blockedSegment, + newSegment = createPendingSegment( + request, + segment.chunks.length, + null, + task.formatContext, + segment.lastPushedText, + !0 + ); + segment.children.push(newSegment); + segment.lastPushedText = !1; + return createRenderTask( + request, + thenableState, + task.node, + task.childIndex, + task.blockedBoundary, + newSegment, + task.hoistableState, + task.abortSet, + task.keyPath, + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + task.isFallback, + task.legacyContext + ); + } function renderNode(request, task, node, childIndex) { var previousFormatContext = task.formatContext, previousLegacyContext = task.legacyContext, @@ -6203,37 +6254,38 @@ __DEV__ && thrownValue === SuspenseException ? getSuspendedThenable() : thrownValue), - "object" === typeof node && - null !== node && - "function" === typeof node.then) + "object" === typeof node && null !== node) ) { - childIndex = getThenableStateAfterSuspending(); - request = createReplayTask( - request, - childIndex, - task.replay, - task.node, - task.childIndex, - task.blockedBoundary, - task.hoistableState, - task.abortSet, - task.keyPath, - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - task.isFallback, - task.legacyContext - ).ping; - node.then(request, request); - task.formatContext = previousFormatContext; - task.legacyContext = previousLegacyContext; - task.context = previousContext; - task.keyPath = previousKeyPath; - task.treeContext = previousTreeContext; - task.componentStack = previousComponentStack; - switchContext(previousContext); - return; + if ("function" === typeof node.then) { + childIndex = getThenableStateAfterSuspending(); + request = spawnNewSuspendedReplayTask( + request, + task, + childIndex + ).ping; + node.then(request, request); + task.formatContext = previousFormatContext; + task.legacyContext = previousLegacyContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } + if ("Maximum call stack size exceeded" === node.message) { + node = getThenableStateAfterSuspending(); + node = spawnNewSuspendedReplayTask(request, task, node); + request.pingedTasks.push(node); + task.formatContext = previousFormatContext; + task.legacyContext = previousLegacyContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } } } else { @@ -6250,48 +6302,38 @@ __DEV__ && thrownValue$4 === SuspenseException ? getSuspendedThenable() : thrownValue$4), - "object" === typeof node && - null !== node && - "function" === typeof node.then) + "object" === typeof node && null !== node) ) { - childIndex = getThenableStateAfterSuspending(); - segment = task.blockedSegment; - childrenLength = createPendingSegment( - request, - segment.chunks.length, - null, - task.formatContext, - segment.lastPushedText, - !0 - ); - segment.children.push(childrenLength); - segment.lastPushedText = !1; - request = createRenderTask( - request, - childIndex, - task.node, - task.childIndex, - task.blockedBoundary, - childrenLength, - task.hoistableState, - task.abortSet, - task.keyPath, - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - task.isFallback, - task.legacyContext - ).ping; - node.then(request, request); - task.formatContext = previousFormatContext; - task.legacyContext = previousLegacyContext; - task.context = previousContext; - task.keyPath = previousKeyPath; - task.treeContext = previousTreeContext; - task.componentStack = previousComponentStack; - switchContext(previousContext); - return; + if ("function" === typeof node.then) { + childIndex = getThenableStateAfterSuspending(); + request = spawnNewSuspendedRenderTask( + request, + task, + childIndex + ).ping; + node.then(request, request); + task.formatContext = previousFormatContext; + task.legacyContext = previousLegacyContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } + if ("Maximum call stack size exceeded" === node.message) { + node = getThenableStateAfterSuspending(); + node = spawnNewSuspendedRenderTask(request, task, node); + request.pingedTasks.push(node); + task.formatContext = previousFormatContext; + task.legacyContext = previousLegacyContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } } } } @@ -6401,28 +6443,27 @@ __DEV__ && if (6 === segment.status) return; segment.status = 3; } + segment = getThrownInfo(task.componentStack); if (null === boundary) { - if ( - ((boundary = {}), 2 !== request.status && request.status !== CLOSED) - ) { - task = task.replay; - if (null === task) { - logRecoverableError(request, error, boundary); + if (13 !== request.status && request.status !== CLOSED) { + boundary = task.replay; + if (null === boundary) { + logRecoverableError(request, error, segment); fatalError(request, error); return; } - task.pendingTasks--; - 0 === task.pendingTasks && - 0 < task.nodes.length && - ((segment = logRecoverableError(request, error, boundary)), + boundary.pendingTasks--; + 0 === boundary.pendingTasks && + 0 < boundary.nodes.length && + ((task = logRecoverableError(request, error, segment)), abortRemainingReplayNodes( request, null, - task.nodes, - task.slots, + boundary.nodes, + boundary.slots, error, + task, segment, - boundary, !0 )); request.pendingRootTasks--; @@ -6432,9 +6473,9 @@ __DEV__ && boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = getThrownInfo(task.componentStack)), - (segment = logRecoverableError(request, error, task)), - encodeErrorForBoundary(boundary, segment, error, task, !0), + (task = logRecoverableError(request, error, segment)), + (boundary.status = CLIENT_RENDERED), + encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary)), @@ -6580,7 +6621,10 @@ __DEV__ && 0 === request.allPendingTasks && completeAll(request); } function performWork(request$jscomp$1) { - if (request$jscomp$1.status !== CLOSED && 2 !== request$jscomp$1.status) { + if ( + request$jscomp$1.status !== CLOSED && + 13 !== request$jscomp$1.status + ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = HooksDispatcher; @@ -6648,7 +6692,9 @@ __DEV__ && erroredReplay( request$jscomp$0, request.blockedBoundary, - x === AbortSigil ? request$jscomp$0.fatalError : x, + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, errorInfo, request.replay.nodes, request.replay.slots @@ -6697,7 +6743,7 @@ __DEV__ && var x$jscomp$0 = thrownValue === SuspenseException ? getSuspendedThenable() - : thrownValue === AbortSigil + : 12 === request.status ? request.fatalError : thrownValue; if ( @@ -7364,6 +7410,7 @@ __DEV__ && function startWork(request) { request.flushScheduled = null !== request.destination; performWork(request); + 10 === request.status && (request.status = 11); null === request.trackedPostpones && safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); } @@ -7381,7 +7428,7 @@ __DEV__ && } } function startFlowing(request, destination) { - if (2 === request.status) + if (13 === request.status) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -7394,7 +7441,7 @@ __DEV__ && } } function abort(request, reason) { - 0 === request.status && (request.status = 1); + if (11 === request.status || 10 === request.status) request.status = 12; try { var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { @@ -8918,8 +8965,7 @@ __DEV__ && COMPLETED = 1, FLUSHED = 2, POSTPONED = 5, - CLOSED = 3, - AbortSigil = {}, + CLOSED = 14, currentRequest = null, didWarnAboutBadClass = {}, didWarnAboutContextTypes = {}, @@ -8945,5 +8991,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-classic-0ad0fac1-20240814"; + exports.version = "19.0.0-www-classic-28668d39-20241023"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 67af83a66165b..b4d6b22dcc799 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -4111,64 +4111,64 @@ __DEV__ && previousDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = null; disableLogs(); - var RunInRootFrame = { - DetermineComponentFrameRoot: function () { - try { - if (construct) { - var Fake = function () { - throw Error(); - }; - Object.defineProperty(Fake.prototype, "props", { - set: function () { + try { + var RunInRootFrame = { + DetermineComponentFrameRoot: function () { + try { + if (construct) { + var Fake = function () { throw Error(); + }; + Object.defineProperty(Fake.prototype, "props", { + set: function () { + throw Error(); + } + }); + if ("object" === typeof Reflect && Reflect.construct) { + try { + Reflect.construct(Fake, []); + } catch (x) { + var control = x; + } + Reflect.construct(fn, [], Fake); + } else { + try { + Fake.call(); + } catch (x$0) { + control = x$0; + } + fn.call(Fake.prototype); } - }); - if ("object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(Fake, []); - } catch (x) { - var control = x; - } - Reflect.construct(fn, [], Fake); } else { try { - Fake.call(); - } catch (x$0) { - control = x$0; + throw Error(); + } catch (x$1) { + control = x$1; } - fn.call(Fake.prototype); + (Fake = fn()) && + "function" === typeof Fake.catch && + Fake.catch(function () {}); } - } else { - try { - throw Error(); - } catch (x$1) { - control = x$1; - } - (Fake = fn()) && - "function" === typeof Fake.catch && - Fake.catch(function () {}); + } catch (sample) { + if (sample && control && "string" === typeof sample.stack) + return [sample.stack, control.stack]; } - } catch (sample) { - if (sample && control && "string" === typeof sample.stack) - return [sample.stack, control.stack]; + return [null, null]; } - return [null, null]; - } - }; - RunInRootFrame.DetermineComponentFrameRoot.displayName = - "DetermineComponentFrameRoot"; - var namePropDescriptor = Object.getOwnPropertyDescriptor( - RunInRootFrame.DetermineComponentFrameRoot, - "name" - ); - namePropDescriptor && - namePropDescriptor.configurable && - Object.defineProperty( + }; + RunInRootFrame.DetermineComponentFrameRoot.displayName = + "DetermineComponentFrameRoot"; + var namePropDescriptor = Object.getOwnPropertyDescriptor( RunInRootFrame.DetermineComponentFrameRoot, - "name", - { value: "DetermineComponentFrameRoot" } + "name" ); - try { + namePropDescriptor && + namePropDescriptor.configurable && + Object.defineProperty( + RunInRootFrame.DetermineComponentFrameRoot, + "name", + { value: "DetermineComponentFrameRoot" } + ); var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], @@ -4177,54 +4177,58 @@ __DEV__ && var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n"); for ( - sampleStack = _RunInRootFrame$Deter = 0; - _RunInRootFrame$Deter < sampleLines.length && - !sampleLines[_RunInRootFrame$Deter].includes( + _RunInRootFrame$Deter = namePropDescriptor = 0; + namePropDescriptor < sampleLines.length && + !sampleLines[namePropDescriptor].includes( "DetermineComponentFrameRoot" ); ) - _RunInRootFrame$Deter++; + namePropDescriptor++; for ( ; - sampleStack < controlLines.length && - !controlLines[sampleStack].includes("DetermineComponentFrameRoot"); + _RunInRootFrame$Deter < controlLines.length && + !controlLines[_RunInRootFrame$Deter].includes( + "DetermineComponentFrameRoot" + ); ) - sampleStack++; + _RunInRootFrame$Deter++; if ( - _RunInRootFrame$Deter === sampleLines.length || - sampleStack === controlLines.length + namePropDescriptor === sampleLines.length || + _RunInRootFrame$Deter === controlLines.length ) for ( - _RunInRootFrame$Deter = sampleLines.length - 1, - sampleStack = controlLines.length - 1; - 1 <= _RunInRootFrame$Deter && - 0 <= sampleStack && - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack]; + namePropDescriptor = sampleLines.length - 1, + _RunInRootFrame$Deter = controlLines.length - 1; + 1 <= namePropDescriptor && + 0 <= _RunInRootFrame$Deter && + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]; ) - sampleStack--; + _RunInRootFrame$Deter--; for ( ; - 1 <= _RunInRootFrame$Deter && 0 <= sampleStack; - _RunInRootFrame$Deter--, sampleStack-- + 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; + namePropDescriptor--, _RunInRootFrame$Deter-- ) if ( - sampleLines[_RunInRootFrame$Deter] !== controlLines[sampleStack] + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter] ) { - if (1 !== _RunInRootFrame$Deter || 1 !== sampleStack) { + if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) { do if ( - (_RunInRootFrame$Deter--, - sampleStack--, - 0 > sampleStack || - sampleLines[_RunInRootFrame$Deter] !== - controlLines[sampleStack]) + (namePropDescriptor--, + _RunInRootFrame$Deter--, + 0 > _RunInRootFrame$Deter || + sampleLines[namePropDescriptor] !== + controlLines[_RunInRootFrame$Deter]) ) { var _frame = "\n" + - sampleLines[_RunInRootFrame$Deter].replace( + sampleLines[namePropDescriptor].replace( " at new ", " at " ); @@ -4235,7 +4239,7 @@ __DEV__ && componentFrameCache.set(fn, _frame); return _frame; } - while (1 <= _RunInRootFrame$Deter && 0 <= sampleStack); + while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter); } break; } @@ -4327,7 +4331,6 @@ __DEV__ && } function noop() {} function RequestInstance( - children, resumableState, renderState, rootFormatContext, @@ -4340,8 +4343,7 @@ __DEV__ && onPostpone, formState ) { - var pingedTasks = [], - abortSet = new Set(); + var abortSet = new Set(); this.destination = null; this.flushScheduled = !1; this.resumableState = resumableState; @@ -4349,12 +4351,12 @@ __DEV__ && this.rootFormatContext = rootFormatContext; this.progressiveChunkSize = void 0 === progressiveChunkSize ? 12800 : progressiveChunkSize; - this.status = 0; + this.status = 10; this.fatalError = null; this.pendingRootTasks = this.allPendingTasks = this.nextSegmentId = 0; this.completedRootSegment = null; this.abortableTasks = abortSet; - this.pingedTasks = pingedTasks; + this.pingedTasks = []; this.clientRenderedBoundaries = []; this.completedBoundaries = []; this.partialBoundaries = []; @@ -4367,33 +4369,6 @@ __DEV__ && this.onFatalError = void 0 === onFatalError ? noop : onFatalError; this.formState = void 0 === formState ? null : formState; this.didWarnForKey = null; - resumableState = createPendingSegment( - this, - 0, - null, - rootFormatContext, - !1, - !1 - ); - resumableState.parentFlushed = !0; - children = createRenderTask( - this, - null, - children, - -1, - null, - resumableState, - null, - abortSet, - null, - rootFormatContext, - null, - emptyTreeContext, - null, - !1 - ); - pushComponentStack(children); - pingedTasks.push(children); } function createRequest( children, @@ -4409,8 +4384,7 @@ __DEV__ && onPostpone, formState ) { - return new RequestInstance( - children, + resumableState = new RequestInstance( resumableState, renderState, rootFormatContext, @@ -4423,6 +4397,34 @@ __DEV__ && onPostpone, formState ); + renderState = createPendingSegment( + resumableState, + 0, + null, + rootFormatContext, + !1, + !1 + ); + renderState.parentFlushed = !0; + children = createRenderTask( + resumableState, + null, + children, + -1, + null, + renderState, + null, + resumableState.abortableTasks, + null, + rootFormatContext, + null, + emptyTreeContext, + null, + !1 + ); + pushComponentStack(children); + resumableState.pingedTasks.push(children); + return resumableState; } function pingTask(request, task) { request.pingedTasks.push(task); @@ -4652,7 +4654,7 @@ __DEV__ && onFatalError(error); null !== request.destination ? ((request.status = CLOSED), request.destination.destroy(error)) - : ((request.status = 2), (request.fatalError = error)); + : ((request.status = 13), (request.fatalError = error)); } function renderWithHooks( request, @@ -5114,7 +5116,7 @@ __DEV__ && } else defaultProps.queue = null; defaultProps = callRenderInDEV(newProps); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; newProps.props !== props && (didWarnAboutReassigningProps || error$jscomp$2( @@ -5138,7 +5140,7 @@ __DEV__ && ), (didWarnAboutBadClass[newProps] = !0))); props = renderWithHooks(request, task, keyPath, type, props, void 0); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; newProps = 0 !== localIdCounter; defaultProps = actionStateCounter; addendum = actionStateMatchingIndex; @@ -5355,8 +5357,7 @@ __DEV__ && (boundarySegment.status = COMPLETED); } catch (thrownValue) { throw ( - ((boundarySegment.status = - thrownValue === AbortSigil ? 3 : 4), + ((boundarySegment.status = 12 === request.status ? 3 : 4), thrownValue) ); } finally { @@ -5404,7 +5405,7 @@ __DEV__ && } } catch (thrownValue$2) { (propName.status = CLIENT_RENDERED), - thrownValue$2 === AbortSigil + 12 === request.status ? ((contentRootSegment.status = 3), (newProps = request.fatalError)) : ((contentRootSegment.status = 4), @@ -5512,7 +5513,7 @@ __DEV__ && } case REACT_LAZY_TYPE: type = callLazyInitInDEV(type); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; props = resolveDefaultPropsOnNonClassComponent(type, props); renderElement(request, task, keyPath, type, props, ref); return; @@ -5668,6 +5669,7 @@ __DEV__ && resumedBoundary.rootSegmentID = ref; task.blockedBoundary = resumedBoundary; task.hoistableState = resumedBoundary.contentState; + task.keyPath = keyPath; task.replay = { nodes: replay, slots: name, @@ -5747,7 +5749,7 @@ __DEV__ && ); case REACT_LAZY_TYPE: node = callLazyInitInDEV(node); - if (1 === request.status) throw AbortSigil; + if (12 === request.status) throw null; renderNodeDestructive(request, task, node, childIndex); return; } @@ -6015,6 +6017,53 @@ __DEV__ && void 0 !== boundary && ((boundary.length = 4), (boundary[2] = []), (boundary[3] = null)))); } + function spawnNewSuspendedReplayTask(request, task, thenableState) { + return createReplayTask( + request, + thenableState, + task.replay, + task.node, + task.childIndex, + task.blockedBoundary, + task.hoistableState, + task.abortSet, + task.keyPath, + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + task.isFallback + ); + } + function spawnNewSuspendedRenderTask(request, task, thenableState) { + var segment = task.blockedSegment, + newSegment = createPendingSegment( + request, + segment.chunks.length, + null, + task.formatContext, + segment.lastPushedText, + !0 + ); + segment.children.push(newSegment); + segment.lastPushedText = !1; + return createRenderTask( + request, + thenableState, + task.node, + task.childIndex, + task.blockedBoundary, + newSegment, + task.hoistableState, + task.abortSet, + task.keyPath, + task.formatContext, + task.context, + task.treeContext, + task.componentStack, + task.isFallback + ); + } function renderNode(request, task, node, childIndex) { var previousFormatContext = task.formatContext, previousContext = task.context, @@ -6032,35 +6081,36 @@ __DEV__ && thrownValue === SuspenseException ? getSuspendedThenable() : thrownValue), - "object" === typeof node && - null !== node && - "function" === typeof node.then) + "object" === typeof node && null !== node) ) { - childIndex = getThenableStateAfterSuspending(); - request = createReplayTask( - request, - childIndex, - task.replay, - task.node, - task.childIndex, - task.blockedBoundary, - task.hoistableState, - task.abortSet, - task.keyPath, - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - task.isFallback - ).ping; - node.then(request, request); - task.formatContext = previousFormatContext; - task.context = previousContext; - task.keyPath = previousKeyPath; - task.treeContext = previousTreeContext; - task.componentStack = previousComponentStack; - switchContext(previousContext); - return; + if ("function" === typeof node.then) { + childIndex = getThenableStateAfterSuspending(); + request = spawnNewSuspendedReplayTask( + request, + task, + childIndex + ).ping; + node.then(request, request); + task.formatContext = previousFormatContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } + if ("Maximum call stack size exceeded" === node.message) { + node = getThenableStateAfterSuspending(); + node = spawnNewSuspendedReplayTask(request, task, node); + request.pingedTasks.push(node); + task.formatContext = previousFormatContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } } } else { @@ -6077,46 +6127,36 @@ __DEV__ && thrownValue$4 === SuspenseException ? getSuspendedThenable() : thrownValue$4), - "object" === typeof node && - null !== node && - "function" === typeof node.then) + "object" === typeof node && null !== node) ) { - childIndex = getThenableStateAfterSuspending(); - segment = task.blockedSegment; - childrenLength = createPendingSegment( - request, - segment.chunks.length, - null, - task.formatContext, - segment.lastPushedText, - !0 - ); - segment.children.push(childrenLength); - segment.lastPushedText = !1; - request = createRenderTask( - request, - childIndex, - task.node, - task.childIndex, - task.blockedBoundary, - childrenLength, - task.hoistableState, - task.abortSet, - task.keyPath, - task.formatContext, - task.context, - task.treeContext, - task.componentStack, - task.isFallback - ).ping; - node.then(request, request); - task.formatContext = previousFormatContext; - task.context = previousContext; - task.keyPath = previousKeyPath; - task.treeContext = previousTreeContext; - task.componentStack = previousComponentStack; - switchContext(previousContext); - return; + if ("function" === typeof node.then) { + childIndex = getThenableStateAfterSuspending(); + request = spawnNewSuspendedRenderTask( + request, + task, + childIndex + ).ping; + node.then(request, request); + task.formatContext = previousFormatContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } + if ("Maximum call stack size exceeded" === node.message) { + node = getThenableStateAfterSuspending(); + node = spawnNewSuspendedRenderTask(request, task, node); + request.pingedTasks.push(node); + task.formatContext = previousFormatContext; + task.context = previousContext; + task.keyPath = previousKeyPath; + task.treeContext = previousTreeContext; + task.componentStack = previousComponentStack; + switchContext(previousContext); + return; + } } } } @@ -6225,28 +6265,27 @@ __DEV__ && if (6 === segment.status) return; segment.status = 3; } + segment = getThrownInfo(task.componentStack); if (null === boundary) { - if ( - ((boundary = {}), 2 !== request.status && request.status !== CLOSED) - ) { - task = task.replay; - if (null === task) { - logRecoverableError(request, error, boundary); + if (13 !== request.status && request.status !== CLOSED) { + boundary = task.replay; + if (null === boundary) { + logRecoverableError(request, error, segment); fatalError(request, error); return; } - task.pendingTasks--; - 0 === task.pendingTasks && - 0 < task.nodes.length && - ((segment = logRecoverableError(request, error, boundary)), + boundary.pendingTasks--; + 0 === boundary.pendingTasks && + 0 < boundary.nodes.length && + ((task = logRecoverableError(request, error, segment)), abortRemainingReplayNodes( request, null, - task.nodes, - task.slots, + boundary.nodes, + boundary.slots, error, + task, segment, - boundary, !0 )); request.pendingRootTasks--; @@ -6256,9 +6295,9 @@ __DEV__ && boundary.pendingTasks--, boundary.status !== CLIENT_RENDERED && ((boundary.status = CLIENT_RENDERED), - (task = getThrownInfo(task.componentStack)), - (segment = logRecoverableError(request, error, task)), - encodeErrorForBoundary(boundary, segment, error, task, !0), + (task = logRecoverableError(request, error, segment)), + (boundary.status = CLIENT_RENDERED), + encodeErrorForBoundary(boundary, task, error, segment, !0), untrackBoundary(request, boundary), boundary.parentFlushed && request.clientRenderedBoundaries.push(boundary)), @@ -6404,7 +6443,10 @@ __DEV__ && 0 === request.allPendingTasks && completeAll(request); } function performWork(request$jscomp$1) { - if (request$jscomp$1.status !== CLOSED && 2 !== request$jscomp$1.status) { + if ( + request$jscomp$1.status !== CLOSED && + 13 !== request$jscomp$1.status + ) { var prevContext = currentActiveSnapshot, prevDispatcher = ReactSharedInternals.H; ReactSharedInternals.H = HooksDispatcher; @@ -6472,7 +6514,9 @@ __DEV__ && erroredReplay( request$jscomp$0, request.blockedBoundary, - x === AbortSigil ? request$jscomp$0.fatalError : x, + 12 === request$jscomp$0.status + ? request$jscomp$0.fatalError + : x, errorInfo, request.replay.nodes, request.replay.slots @@ -6521,7 +6565,7 @@ __DEV__ && var x$jscomp$0 = thrownValue === SuspenseException ? getSuspendedThenable() - : thrownValue === AbortSigil + : 12 === request.status ? request.fatalError : thrownValue; if ( @@ -7188,6 +7232,7 @@ __DEV__ && function startWork(request) { request.flushScheduled = null !== request.destination; performWork(request); + 10 === request.status && (request.status = 11); null === request.trackedPostpones && safelyEmitEarlyPreloads(request, 0 === request.pendingRootTasks); } @@ -7205,7 +7250,7 @@ __DEV__ && } } function startFlowing(request, destination) { - if (2 === request.status) + if (13 === request.status) (request.status = CLOSED), destination.destroy(request.fatalError); else if (request.status !== CLOSED && null === request.destination) { request.destination = destination; @@ -7218,7 +7263,7 @@ __DEV__ && } } function abort(request, reason) { - 0 === request.status && (request.status = 1); + if (11 === request.status || 10 === request.status) request.status = 12; try { var abortableTasks = request.abortableTasks; if (0 < abortableTasks.size) { @@ -8738,8 +8783,7 @@ __DEV__ && COMPLETED = 1, FLUSHED = 2, POSTPONED = 5, - CLOSED = 3, - AbortSigil = {}, + CLOSED = 14, currentRequest = null, didWarnAboutBadClass = {}, didWarnAboutContextTypes = {}, @@ -8765,5 +8809,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-www-modern-0ad0fac1-20240814"; + exports.version = "19.0.0-www-modern-28668d39-20241023"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index ec001cb579b08..6f91e1426d8a5 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -57,6 +57,7 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, disableLegacyContextForFunctionComponents = dynamicFeatureFlags.disableLegacyContextForFunctionComponents, + disableStringRefs = dynamicFeatureFlags.disableStringRefs, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, @@ -2680,16 +2681,16 @@ function createRenderState(resumableState, generateStaticMarkup) { "\x3c/script>" ); bootstrapScriptContent = idPrefix + "P:"; - var JSCompiler_object_inline_segmentPrefix_1642 = idPrefix + "S:"; + var JSCompiler_object_inline_segmentPrefix_1630 = idPrefix + "S:"; idPrefix += "B:"; - var JSCompiler_object_inline_preconnects_1656 = new Set(), - JSCompiler_object_inline_fontPreloads_1657 = new Set(), - JSCompiler_object_inline_highImagePreloads_1658 = new Set(), - JSCompiler_object_inline_styles_1659 = new Map(), - JSCompiler_object_inline_bootstrapScripts_1660 = new Set(), - JSCompiler_object_inline_scripts_1661 = new Set(), - JSCompiler_object_inline_bulkPreloads_1662 = new Set(), - JSCompiler_object_inline_preloads_1663 = { + var JSCompiler_object_inline_preconnects_1644 = new Set(), + JSCompiler_object_inline_fontPreloads_1645 = new Set(), + JSCompiler_object_inline_highImagePreloads_1646 = new Set(), + JSCompiler_object_inline_styles_1647 = new Map(), + JSCompiler_object_inline_bootstrapScripts_1648 = new Set(), + JSCompiler_object_inline_scripts_1649 = new Set(), + JSCompiler_object_inline_bulkPreloads_1650 = new Set(), + JSCompiler_object_inline_preloads_1651 = { images: new Map(), stylesheets: new Map(), scripts: new Map(), @@ -2726,7 +2727,7 @@ function createRenderState(resumableState, generateStaticMarkup) { scriptConfig.moduleScriptResources[href] = null; scriptConfig = []; pushLinkImpl(scriptConfig, props); - JSCompiler_object_inline_bootstrapScripts_1660.add(scriptConfig); + JSCompiler_object_inline_bootstrapScripts_1648.add(scriptConfig); bootstrapChunks.push('