From c474717d6fe83f4711665833418f3d88b1a36b80 Mon Sep 17 00:00:00 2001 From: 22388o <22388o@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:29:01 -0800 Subject: [PATCH] [tests] Remove to*Dev matchers (#31989) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based off: https://github.com/facebook/react/pull/31988 Screenshot 2025-01-06 at 12 52 08 AM it is done DiffTrain build for [a160102f3aedae0da2d692e7cf53b28a011b7bc9](https://github.com/facebook/react/commit/a160102f3aedae0da2d692e7cf53b28a011b7bc9) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-dev.modern.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- compiled/facebook-www/React-prod.modern.js | 2 +- .../facebook-www/React-profiling.classic.js | 2 +- .../facebook-www/React-profiling.modern.js | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 714 +++++----- compiled/facebook-www/ReactART-dev.modern.js | 714 +++++----- .../facebook-www/ReactART-prod.classic.js | 486 ++++--- compiled/facebook-www/ReactART-prod.modern.js | 486 ++++--- compiled/facebook-www/ReactDOM-dev.classic.js | 1241 +++++++++-------- compiled/facebook-www/ReactDOM-dev.modern.js | 1241 +++++++++-------- .../facebook-www/ReactDOM-prod.classic.js | 983 ++++++------- compiled/facebook-www/ReactDOM-prod.modern.js | 983 ++++++------- .../ReactDOM-profiling.classic.js | 1048 +++++++------- .../facebook-www/ReactDOM-profiling.modern.js | 1048 +++++++------- .../ReactDOMServer-dev.classic.js | 2 +- .../facebook-www/ReactDOMServer-dev.modern.js | 2 +- .../ReactDOMServer-prod.classic.js | 2 +- .../ReactDOMServer-prod.modern.js | 2 +- .../ReactDOMTesting-dev.classic.js | 1241 +++++++++-------- .../ReactDOMTesting-dev.modern.js | 1241 +++++++++-------- .../ReactDOMTesting-prod.classic.js | 983 ++++++------- .../ReactDOMTesting-prod.modern.js | 983 ++++++------- .../ReactReconciler-dev.classic.js | 623 +++++---- .../ReactReconciler-dev.modern.js | 623 +++++---- .../ReactReconciler-prod.classic.js | 510 ++++--- .../ReactReconciler-prod.modern.js | 510 ++++--- .../ReactTestRenderer-dev.classic.js | 922 ++++++------ .../ReactTestRenderer-dev.modern.js | 922 ++++++------ compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 2 +- .../facebook-www/eslint-plugin-react-hooks.js | 4 +- 36 files changed, 9300 insertions(+), 8236 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index b7f5bdda2aadc..288244db3410c 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -a9bbe34622885ef5667d33236d580fe7321c0d8b +a160102f3aedae0da2d692e7cf53b28a011b7bc9 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index b7f5bdda2aadc..288244db3410c 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -a9bbe34622885ef5667d33236d580fe7321c0d8b +a160102f3aedae0da2d692e7cf53b28a011b7bc9 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 99c9c02d4d9ed..eceff8e942ea4 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -1942,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; "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 9760fa4745690..0ea42cf210700 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -1942,7 +1942,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; "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 655a367a799a6..2edf98a2c1d47 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 53b057e4888db..5b61990e842c5 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 94909e22a8638..92461a9fe1edb 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; "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 f714ef2c527e4..1c2ce54f15f75 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; "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 3426e94d5d0e5..d9360a72a9d3e 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -80,7 +80,7 @@ __DEV__ && if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -751,41 +751,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -923,14 +888,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -940,29 +904,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2289,11 +2254,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2327,7 +2290,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2339,6 +2304,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2387,7 +2355,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2445,14 +2414,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2467,7 +2444,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -2477,13 +2454,13 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); - scheduleCallback$3(ImmediatePriority, cb); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -3279,7 +3256,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -6641,14 +6618,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -7683,7 +7660,7 @@ __DEV__ && mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -8935,8 +8912,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -8948,8 +8925,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -10207,6 +10184,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -10290,10 +10268,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10937,12 +10912,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11303,12 +11272,6 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -11612,6 +11575,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -12475,9 +12446,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -12485,7 +12455,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -12500,63 +12470,39 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - (alwaysThrottleRetries || shouldTimeSlice === RootSuspended) && - ((exitStatus = + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12566,17 +12512,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12586,7 +12532,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -12607,39 +12553,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -12734,8 +12664,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -13119,7 +13047,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$35) { handleThrow(root, thrownValue$35); @@ -13144,7 +13072,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -13372,141 +13300,260 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, lanes), - (root.current = finishedWork), - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - enableSchedulingProfiler && + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber( + root, + finishedWork.alternate, + finishedWork + ), + (inProgressRoot = inProgressLanes = null), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - return null; + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -13525,40 +13572,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - return ( - (currentUpdatePriority = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + return ( + (currentUpdatePriority = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -14126,7 +14176,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -14164,7 +14214,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -14453,11 +14503,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -14470,7 +14516,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -14509,7 +14554,6 @@ __DEV__ && parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); var rootFiber = container.current; if ( injectedHook && @@ -16656,10 +16700,20 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -16669,8 +16723,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16894,10 +16946,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16931,7 +16983,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; "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 bc049cf00fbf8..6551889b1e7d3 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -80,7 +80,7 @@ __DEV__ && if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -737,41 +737,6 @@ __DEV__ && } return hook.checkDCE ? !0 : !1; } - function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && (unstable_setDisableYieldValue(newIsStrictMode), @@ -909,14 +874,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -926,29 +890,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2181,11 +2146,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2219,7 +2182,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2231,6 +2196,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2279,7 +2247,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2337,14 +2306,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2359,7 +2336,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -2369,13 +2346,13 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); - scheduleCallback$3(ImmediatePriority, cb); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -3171,7 +3148,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -6533,14 +6510,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -7500,7 +7477,7 @@ __DEV__ && mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -8753,8 +8730,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -8766,8 +8743,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -10011,6 +9988,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -10094,10 +10072,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -10741,12 +10716,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -11107,12 +11076,6 @@ __DEV__ && } flags & 4096 && (finishedWork.flags &= -4097); } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -11416,6 +11379,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -12279,9 +12250,8 @@ __DEV__ && break; } a: { - renderWasConcurrent = root; - shouldTimeSlice = exitStatus; - switch (shouldTimeSlice) { + shouldTimeSlice = root; + switch (exitStatus) { case RootInProgress: case RootFatalErrored: throw Error("Root did not complete. This is a bug in React."); @@ -12289,7 +12259,7 @@ __DEV__ && if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings @@ -12304,63 +12274,39 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - renderWasConcurrent.finishedWork = forceSync; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) { - lanes = renderWasConcurrent; - forceSync = workInProgressRootRecoverableErrors; - exitStatus = workInProgressTransitions; - renderWasConcurrent = - workInProgressRootDidIncludeRecursiveRenderUpdate; - lanesThatJustErrored = workInProgressDeferredLane; - originallyAttemptedLanes = - workInProgressRootInterleavedUpdatedLanes; - var suspendedRetryLanes = workInProgressSuspendedRetryLanes, - suspendedCommitReason = IMMEDIATE_COMMIT, - prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - lanes, - forceSync, - exitStatus, - renderWasConcurrent, - previousUpdateLanePriority, - lanesThatJustErrored, - originallyAttemptedLanes, - suspendedRetryLanes, - shouldTimeSlice, - suspendedCommitReason, - -0, - 0 - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); - } - } else { + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + forceSync, + lanes, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes + ); + else { if ( (lanes & 62914560) === lanes && - (alwaysThrottleRetries || shouldTimeSlice === RootSuspended) && - ((exitStatus = + (alwaysThrottleRetries || exitStatus === RootSuspended) && + ((renderWasConcurrent = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1()), - 10 < exitStatus) + 10 < renderWasConcurrent) ) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12370,17 +12316,17 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, THROTTLED_COMMIT, -0, 0 ), - exitStatus + renderWasConcurrent ); break a; } commitRootWhenReady( - renderWasConcurrent, + shouldTimeSlice, forceSync, workInProgressRootRecoverableErrors, workInProgressTransitions, @@ -12390,7 +12336,7 @@ __DEV__ && workInProgressRootInterleavedUpdatedLanes, workInProgressSuspendedRetryLanes, workInProgressRootDidSkipSuspendedSiblings, - shouldTimeSlice, + exitStatus, IMMEDIATE_COMMIT, -0, 0 @@ -12411,39 +12357,23 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), - (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -12538,8 +12468,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -12923,7 +12851,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$35) { handleThrow(root, thrownValue$35); @@ -12948,7 +12876,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -13172,141 +13100,260 @@ __DEV__ && workInProgressRootExitStatus = RootSuspendedAtTheShell; workInProgress = null; } - function commitRootImpl( + function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = DiscreteEventPriority), - (suspendedRetryLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, lanes), - (root.current = finishedWork), - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - enableSchedulingProfiler && + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber( + root, + finishedWork.alternate, + finishedWork + ), + (inProgressRoot = inProgressLanes = null), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - return null; + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -13325,40 +13372,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - return ( - (currentUpdatePriority = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + return ( + (currentUpdatePriority = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -13926,7 +13976,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -13964,7 +14014,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -14253,11 +14303,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -14270,7 +14316,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -14309,7 +14354,6 @@ __DEV__ && parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); parentComponent = container.current; if ( injectedHook && @@ -16419,10 +16463,20 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -16432,8 +16486,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -16657,10 +16709,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -16694,7 +16746,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; "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 1801b07ef3fb9..d3eeb4ff77c5d 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -498,17 +498,6 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -578,14 +567,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -595,29 +583,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1348,7 +1336,7 @@ function ensureRootIsScheduled(root) { mightHavePendingSyncWork = !0; didScheduleMicrotask || ((didScheduleMicrotask = !0), - scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -1383,7 +1371,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1395,7 +1384,7 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } -function processRootScheduleInMicrotask() { +function processRootScheduleInImmediateTask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( @@ -1440,7 +1429,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -1491,13 +1481,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -1511,7 +1504,7 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } function requestTransitionLane() { @@ -4936,12 +4929,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -5588,7 +5581,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -6504,8 +6497,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$89 = completedWork.child; null !== child$89; ) (newChildLanes |= child$89.lanes | child$89.childLanes), - (subtreeFlags |= child$89.subtreeFlags & 31457280), - (subtreeFlags |= child$89.flags & 31457280), + (subtreeFlags |= child$89.subtreeFlags & 29360128), + (subtreeFlags |= child$89.flags & 29360128), (child$89.return = completedWork), (child$89 = child$89.sibling); else @@ -7287,6 +7280,7 @@ var offscreenSubtreeIsHidden = !1, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7389,10 +7383,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8449,6 +8440,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -9088,10 +9087,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -9263,8 +9266,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9277,7 +9278,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9309,12 +9310,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { lanes, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - 0, - -0, - 0 + workInProgressSuspendedRetryLanes ); } } @@ -9331,38 +9327,23 @@ function commitRootWhenReady( lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -9454,8 +9435,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -9739,7 +9718,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$139) { handleThrow(root, thrownValue$139); @@ -9755,7 +9734,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -9932,102 +9911,178 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( +function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = 2), - (suspendedRetryLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + void 0, + 128 === (finishedWork.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -10035,36 +10090,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - return ( - (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + return ( + (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -10308,7 +10366,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -10327,7 +10385,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -10548,11 +10606,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -10565,7 +10619,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -10594,7 +10647,6 @@ function FiberRootNode( containerInfo.push(null); } function updateContainerSync(element, container, parentComponent, callback) { - 0 === container.tag && flushPassiveEffects(); var current = container.current; a: if (parentComponent) { parentComponent = parentComponent._reactInternals; @@ -10777,24 +10829,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1501 = { +var internals$jscomp$inline_1510 = { bundleType: 0, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1502 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1511 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1502.isDisabled && - hook$jscomp$inline_1502.supportsFiber + !hook$jscomp$inline_1511.isDisabled && + hook$jscomp$inline_1511.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1502.inject( - internals$jscomp$inline_1501 + (rendererID = hook$jscomp$inline_1511.inject( + internals$jscomp$inline_1510 )), - (injectedHook = hook$jscomp$inline_1502); + (injectedHook = hook$jscomp$inline_1511); } catch (err) {} } var Path = Mode$1.Path; @@ -10808,4 +10860,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index b8191b924ff5d..e23215887f8b7 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -419,17 +419,6 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -499,14 +488,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -516,29 +504,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1195,7 +1183,7 @@ function ensureRootIsScheduled(root) { mightHavePendingSyncWork = !0; didScheduleMicrotask || ((didScheduleMicrotask = !0), - scheduleCallback$3(ImmediatePriority, processRootScheduleInMicrotask)); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask)); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -1230,7 +1218,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1242,7 +1231,7 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } -function processRootScheduleInMicrotask() { +function processRootScheduleInImmediateTask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; 0 !== currentEventTransitionLane && (currentEventTransitionLane = 0); for ( @@ -1287,7 +1276,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -1338,13 +1328,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -1358,7 +1351,7 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } function requestTransitionLane() { @@ -4799,12 +4792,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -5374,7 +5367,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -6283,8 +6276,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$89 = completedWork.child; null !== child$89; ) (newChildLanes |= child$89.lanes | child$89.childLanes), - (subtreeFlags |= child$89.subtreeFlags & 31457280), - (subtreeFlags |= child$89.flags & 31457280), + (subtreeFlags |= child$89.subtreeFlags & 29360128), + (subtreeFlags |= child$89.flags & 29360128), (child$89.return = completedWork), (child$89 = child$89.sibling); else @@ -7047,6 +7040,7 @@ var offscreenSubtreeIsHidden = !1, shouldFireAfterActiveInstanceBlur = !1; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = null; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7149,10 +7143,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8209,6 +8200,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -8848,10 +8847,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -9023,8 +9026,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9037,7 +9038,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9069,12 +9070,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { lanes, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings, - renderWasConcurrent, - 0, - -0, - 0 + workInProgressSuspendedRetryLanes ); } } @@ -9091,38 +9087,23 @@ function commitRootWhenReady( lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); - finishedWork = ReactSharedInternals.T; - lanes = currentUpdatePriority; - try { - (currentUpdatePriority = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - lanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = finishedWork), (currentUpdatePriority = lanes); - } + commitRoot( + root, + finishedWork, + lanes, + recoverableErrors, + transitions, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); } function isRenderConsistentWithExternalStores(finishedWork) { for (var node = finishedWork; ; ) { @@ -9214,8 +9195,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -9499,7 +9478,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$139) { handleThrow(root, thrownValue$139); @@ -9515,7 +9494,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -9688,102 +9667,178 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgressRootExitStatus = 6; workInProgress = null; } -function commitRootImpl( +function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, - renderPriorityLevel, spawnedLane, updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (updatedLanes = currentUpdatePriority), - (currentUpdatePriority = 2), - (suspendedRetryLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = suspendedRetryLanes), - (currentUpdatePriority = updatedLanes), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + void 0, + 128 === (finishedWork.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = currentUpdatePriority; + currentUpdatePriority = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (currentUpdatePriority = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -9791,36 +9846,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = currentUpdatePriority; - try { - return ( - (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = currentUpdatePriority; + try { + return ( + (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -10064,7 +10122,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -10083,7 +10141,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -10304,11 +10362,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -10321,7 +10375,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -10350,7 +10403,6 @@ function FiberRootNode( containerInfo.push(null); } function updateContainerSync(element, container, parentComponent, callback) { - 0 === container.tag && flushPassiveEffects(); parentComponent = container.current; null === container.context ? (container.context = emptyContextObject) @@ -10493,24 +10545,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1480 = { +var internals$jscomp$inline_1489 = { bundleType: 0, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1481 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1490 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1481.isDisabled && - hook$jscomp$inline_1481.supportsFiber + !hook$jscomp$inline_1490.isDisabled && + hook$jscomp$inline_1490.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1481.inject( - internals$jscomp$inline_1480 + (rendererID = hook$jscomp$inline_1490.inject( + internals$jscomp$inline_1489 )), - (injectedHook = hook$jscomp$inline_1481); + (injectedHook = hook$jscomp$inline_1490); } catch (err) {} } var Path = Mode$1.Path; @@ -10524,4 +10576,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 6ef387bbc5f82..f7f91ed7851ed 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -77,13 +77,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (updateContainerSync(element, root, null, null), flushSyncWork$1()); + (updateContainerImpl(root.current, 2, element, root, null, null), + flushSyncWork$1()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -1007,14 +1008,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1024,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4078,11 +4079,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -4116,7 +4115,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4128,6 +4129,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -4182,7 +4186,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4240,14 +4245,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -4262,7 +4275,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -4272,16 +4285,19 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5079,7 +5095,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -8729,14 +8745,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -9529,32 +9545,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2490; - var JSCompiler_object_inline_stack_2491 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2531; + var JSCompiler_object_inline_stack_2532 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2492 = !1; + var JSCompiler_object_inline_componentStack_2533 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2490 = didSuspend) || - (JSCompiler_object_inline_digest_2490 = + (JSCompiler_object_inline_digest_2531 = didSuspend) || + (JSCompiler_object_inline_digest_2531 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2490 && - ((JSCompiler_object_inline_componentStack_2492 = !0), + JSCompiler_object_inline_digest_2531 && + ((JSCompiler_object_inline_componentStack_2533 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2490 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2531 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2492 + JSCompiler_object_inline_componentStack_2533 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2489 = nextHydratableInstance; + var JSCompiler_object_inline_message_2530 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2489)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2530)) { c: { - var instance = JSCompiler_object_inline_message_2489; + var instance = JSCompiler_object_inline_message_2530; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9596,46 +9612,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2530 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2489 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2530 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2489 && - ((JSCompiler_object_inline_message_2489 = - JSCompiler_object_inline_message_2489.dehydrated), - null !== JSCompiler_object_inline_message_2489) + null !== JSCompiler_object_inline_message_2530 && + ((JSCompiler_object_inline_message_2530 = + JSCompiler_object_inline_message_2530.dehydrated), + null !== JSCompiler_object_inline_message_2530) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2489) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2530) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2489 = - JSCompiler_object_inline_stack_2491.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2491.fallback; - if (JSCompiler_object_inline_componentStack_2492) + JSCompiler_object_inline_message_2530 = + JSCompiler_object_inline_stack_2532.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2532.fallback; + if (JSCompiler_object_inline_componentStack_2533) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2532 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_message_2530, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2533 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2492.memoizedState = + (JSCompiler_object_inline_componentStack_2533.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2533.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2531, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9648,9 +9664,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2492.updateQueue), + JSCompiler_object_inline_componentStack_2533.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = + ? (JSCompiler_object_inline_componentStack_2533.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9658,46 +9674,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2491.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2532.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2532 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_message_2530, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2533 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2492.memoizedState = + (JSCompiler_object_inline_componentStack_2533.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2533.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2531, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2530 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2489 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2489) + ((JSCompiler_object_inline_message_2530 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2530) ) { if (didSuspend) workInProgress.flags & 256 @@ -9714,94 +9730,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_stack_2491.fallback), - (JSCompiler_object_inline_message_2489 = workInProgress.mode), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_componentStack_2533 = + JSCompiler_object_inline_stack_2532.fallback), + (JSCompiler_object_inline_message_2530 = workInProgress.mode), + (JSCompiler_object_inline_stack_2532 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2532.children }, - JSCompiler_object_inline_message_2489 + JSCompiler_object_inline_message_2530 )), - (JSCompiler_object_inline_componentStack_2492 = + (JSCompiler_object_inline_componentStack_2533 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_componentStack_2533, + JSCompiler_object_inline_message_2530, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2492.flags |= 2), - (JSCompiler_object_inline_stack_2491.return = workInProgress), - (JSCompiler_object_inline_componentStack_2492.return = + (JSCompiler_object_inline_componentStack_2533.flags |= 2), + (JSCompiler_object_inline_stack_2532.return = workInProgress), + (JSCompiler_object_inline_componentStack_2533.return = workInProgress), - (JSCompiler_object_inline_stack_2491.sibling = - JSCompiler_object_inline_componentStack_2492), - (workInProgress.child = JSCompiler_object_inline_stack_2491), + (JSCompiler_object_inline_stack_2532.sibling = + JSCompiler_object_inline_componentStack_2533), + (workInProgress.child = JSCompiler_object_inline_stack_2532), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2491 = workInProgress.child), - (JSCompiler_object_inline_stack_2491.memoizedState = + (JSCompiler_object_inline_stack_2532 = workInProgress.child), + (JSCompiler_object_inline_stack_2532.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2491.childLanes = + (JSCompiler_object_inline_stack_2532.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2531, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2492)); + JSCompiler_object_inline_componentStack_2533)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2489)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2530)) ) { - JSCompiler_object_inline_digest_2490 = - JSCompiler_object_inline_message_2489.nextSibling && - JSCompiler_object_inline_message_2489.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2490) { - JSCompiler_temp = JSCompiler_object_inline_digest_2490.dgst; - var message = JSCompiler_object_inline_digest_2490.msg; - instance = JSCompiler_object_inline_digest_2490.stck; - var componentStack = JSCompiler_object_inline_digest_2490.cstck; + JSCompiler_object_inline_digest_2531 = + JSCompiler_object_inline_message_2530.nextSibling && + JSCompiler_object_inline_message_2530.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2531) { + JSCompiler_temp = JSCompiler_object_inline_digest_2531.dgst; + var message = JSCompiler_object_inline_digest_2531.msg; + instance = JSCompiler_object_inline_digest_2531.stck; + var componentStack = JSCompiler_object_inline_digest_2531.cstck; } - JSCompiler_object_inline_message_2489 = message; - JSCompiler_object_inline_digest_2490 = JSCompiler_temp; - JSCompiler_object_inline_stack_2491 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2492 = + JSCompiler_object_inline_message_2530 = message; + JSCompiler_object_inline_digest_2531 = JSCompiler_temp; + JSCompiler_object_inline_stack_2532 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2533 = componentStack; - JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_message_2489 - ? Error(JSCompiler_object_inline_message_2489) + JSCompiler_object_inline_componentStack_2533 = + JSCompiler_object_inline_message_2530 + ? Error(JSCompiler_object_inline_message_2530) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2492.stack = - JSCompiler_object_inline_stack_2491 || ""; - JSCompiler_object_inline_componentStack_2492.digest = - JSCompiler_object_inline_digest_2490; - JSCompiler_object_inline_digest_2490 = + JSCompiler_object_inline_componentStack_2533.stack = + JSCompiler_object_inline_stack_2532 || ""; + JSCompiler_object_inline_componentStack_2533.digest = + JSCompiler_object_inline_digest_2531; + JSCompiler_object_inline_digest_2531 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2491 = { - value: JSCompiler_object_inline_componentStack_2492, + JSCompiler_object_inline_stack_2532 = { + value: JSCompiler_object_inline_componentStack_2533, source: null, - stack: JSCompiler_object_inline_digest_2490 + stack: JSCompiler_object_inline_digest_2531 }; - "string" === typeof JSCompiler_object_inline_digest_2490 && + "string" === typeof JSCompiler_object_inline_digest_2531 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_componentStack_2533, + JSCompiler_object_inline_stack_2532 ); - queueHydrationError(JSCompiler_object_inline_stack_2491); + queueHydrationError(JSCompiler_object_inline_stack_2532); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9815,44 +9831,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2490 = + (JSCompiler_object_inline_digest_2531 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2490) + didReceiveUpdate || JSCompiler_object_inline_digest_2531) ) { - JSCompiler_object_inline_digest_2490 = workInProgressRoot; + JSCompiler_object_inline_digest_2531 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2490 && - ((JSCompiler_object_inline_stack_2491 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2491 = - 0 !== (JSCompiler_object_inline_stack_2491 & 42) + null !== JSCompiler_object_inline_digest_2531 && + ((JSCompiler_object_inline_stack_2532 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2532 = + 0 !== (JSCompiler_object_inline_stack_2532 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 )), - (JSCompiler_object_inline_stack_2491 = + (JSCompiler_object_inline_stack_2532 = 0 !== - (JSCompiler_object_inline_stack_2491 & - (JSCompiler_object_inline_digest_2490.suspendedLanes | + (JSCompiler_object_inline_stack_2532 & + (JSCompiler_object_inline_digest_2531.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2491), - 0 !== JSCompiler_object_inline_stack_2491 && - JSCompiler_object_inline_stack_2491 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2532), + 0 !== JSCompiler_object_inline_stack_2532 && + JSCompiler_object_inline_stack_2532 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2491), + ((prevState.retryLane = JSCompiler_object_inline_stack_2532), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2531, current, - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2489.data === + JSCompiler_object_inline_message_2530.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9860,14 +9876,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2489.data === + JSCompiler_object_inline_message_2530.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2489.nextSibling + JSCompiler_object_inline_message_2530.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9885,57 +9901,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2491.children + JSCompiler_object_inline_stack_2532.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2492) + if (JSCompiler_object_inline_componentStack_2533) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2492 = - JSCompiler_object_inline_stack_2491.fallback), - (JSCompiler_object_inline_message_2489 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2533 = + JSCompiler_object_inline_stack_2532.fallback), + (JSCompiler_object_inline_message_2530 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2491 = createWorkInProgress( + (JSCompiler_object_inline_stack_2532 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2532.children } )), - (JSCompiler_object_inline_stack_2491.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (JSCompiler_object_inline_stack_2532.subtreeFlags = + JSCompiler_temp.subtreeFlags & 29360128), null !== instance - ? (JSCompiler_object_inline_componentStack_2492 = + ? (JSCompiler_object_inline_componentStack_2533 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2492 + JSCompiler_object_inline_componentStack_2533 )) - : ((JSCompiler_object_inline_componentStack_2492 = + : ((JSCompiler_object_inline_componentStack_2533 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2492, - JSCompiler_object_inline_message_2489, + JSCompiler_object_inline_componentStack_2533, + JSCompiler_object_inline_message_2530, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2492.flags |= 2)), - (JSCompiler_object_inline_componentStack_2492.return = + (JSCompiler_object_inline_componentStack_2533.flags |= 2)), + (JSCompiler_object_inline_componentStack_2533.return = workInProgress), - (JSCompiler_object_inline_stack_2491.return = workInProgress), - (JSCompiler_object_inline_stack_2491.sibling = - JSCompiler_object_inline_componentStack_2492), - (workInProgress.child = JSCompiler_object_inline_stack_2491), - (JSCompiler_object_inline_stack_2491 = - JSCompiler_object_inline_componentStack_2492), - (JSCompiler_object_inline_componentStack_2492 = workInProgress.child), - (JSCompiler_object_inline_message_2489 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2489 - ? (JSCompiler_object_inline_message_2489 = + (JSCompiler_object_inline_stack_2532.return = workInProgress), + (JSCompiler_object_inline_stack_2532.sibling = + JSCompiler_object_inline_componentStack_2533), + (workInProgress.child = JSCompiler_object_inline_stack_2532), + (JSCompiler_object_inline_stack_2532 = + JSCompiler_object_inline_componentStack_2533), + (JSCompiler_object_inline_componentStack_2533 = workInProgress.child), + (JSCompiler_object_inline_message_2530 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2530 + ? (JSCompiler_object_inline_message_2530 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2489.cachePool), + JSCompiler_object_inline_message_2530.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9943,34 +9959,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2489 = { + (JSCompiler_object_inline_message_2530 = { baseLanes: - JSCompiler_object_inline_message_2489.baseLanes | renderLanes, + JSCompiler_object_inline_message_2530.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2492.memoizedState = - JSCompiler_object_inline_message_2489), + (JSCompiler_object_inline_componentStack_2533.memoizedState = + JSCompiler_object_inline_message_2530), enableTransitionTracing && - ((JSCompiler_object_inline_message_2489 = enableTransitionTracing + ((JSCompiler_object_inline_message_2530 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2489 && + null !== JSCompiler_object_inline_message_2530 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2492.updateQueue), + JSCompiler_object_inline_componentStack_2533.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = { - transitions: JSCompiler_object_inline_message_2489, + ? (JSCompiler_object_inline_componentStack_2533.updateQueue = { + transitions: JSCompiler_object_inline_message_2530, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2492.updateQueue = + ? (JSCompiler_object_inline_componentStack_2533.updateQueue = { - transitions: JSCompiler_object_inline_message_2489, + transitions: JSCompiler_object_inline_message_2530, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9978,32 +9994,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2489), + JSCompiler_object_inline_message_2530), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2492.childLanes = + (JSCompiler_object_inline_componentStack_2533.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2490, + JSCompiler_object_inline_digest_2531, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2491 + JSCompiler_object_inline_stack_2532 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2491.children + children: JSCompiler_object_inline_stack_2532.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2490 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2490 + ((JSCompiler_object_inline_digest_2531 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2531 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2490.push(current)); + : JSCompiler_object_inline_digest_2531.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11404,8 +11420,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -11417,8 +11433,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & ProfileMode) !== NoMode) { @@ -12963,6 +12979,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -13074,10 +13091,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13814,12 +13828,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -13954,7 +13962,9 @@ __DEV__ && if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -14714,6 +14724,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -15636,21 +15654,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15668,7 +15682,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15730,18 +15744,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15764,16 +15784,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15869,8 +15887,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16251,7 +16267,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$39) { handleThrow(root, thrownValue$39); @@ -16276,7 +16292,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -16506,205 +16522,342 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16723,40 +16876,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -17325,7 +17481,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -17363,7 +17519,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -17652,11 +17808,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17669,7 +17821,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -17837,23 +17988,6 @@ __DEV__ && } return component.stateNode; } - function updateContainerSync( - element, - container, - parentComponent, - callback - ) { - 0 === container.tag && flushPassiveEffects(); - updateContainerImpl( - container.current, - 2, - element, - container, - parentComponent, - callback - ); - return 2; - } function updateContainerImpl( rootFiber, lane, @@ -18346,100 +18480,6 @@ __DEV__ && "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -21187,36 +21227,34 @@ __DEV__ && } case "src": case "href": - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ? hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ) - : ("src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ), - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - )); + if ( + !( + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ) + ) { + "src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ); + continue; + } + hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ); continue; case "action": case "formAction": @@ -21735,11 +21773,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -21848,7 +21881,9 @@ __DEV__ && else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null @@ -26536,10 +26571,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -26549,9 +26595,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -27374,11 +27417,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-a9bbe346-20241219" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-a160102f-20250107" !== 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.1.0-www-classic-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-a160102f-20250107\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27421,10 +27464,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27497,7 +27540,7 @@ __DEV__ && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync(null, args, null, null); + updateContainerImpl(args.current, 2, null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -28022,7 +28065,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; "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 2d173bd2a0628..c02173f21f303 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -77,13 +77,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (updateContainerSync(element, root, null, null), flushSyncWork$1()); + (updateContainerImpl(root.current, 2, element, root, null, null), + flushSyncWork$1()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -1007,14 +1008,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1024,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -3965,11 +3966,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -4003,7 +4002,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4015,6 +4016,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -4069,7 +4073,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4127,14 +4132,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -4149,7 +4162,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -4159,16 +4172,19 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -4966,7 +4982,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -8616,14 +8632,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -9341,32 +9357,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2482; - var JSCompiler_object_inline_stack_2483 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2523; + var JSCompiler_object_inline_stack_2524 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2484 = !1; + var JSCompiler_object_inline_componentStack_2525 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2482 = didSuspend) || - (JSCompiler_object_inline_digest_2482 = + (JSCompiler_object_inline_digest_2523 = didSuspend) || + (JSCompiler_object_inline_digest_2523 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2482 && - ((JSCompiler_object_inline_componentStack_2484 = !0), + JSCompiler_object_inline_digest_2523 && + ((JSCompiler_object_inline_componentStack_2525 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2482 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2523 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2484 + JSCompiler_object_inline_componentStack_2525 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2481 = nextHydratableInstance; + var JSCompiler_object_inline_message_2522 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2481)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2522)) { c: { - var instance = JSCompiler_object_inline_message_2481; + var instance = JSCompiler_object_inline_message_2522; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9408,46 +9424,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2522 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2481 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2522 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2481 && - ((JSCompiler_object_inline_message_2481 = - JSCompiler_object_inline_message_2481.dehydrated), - null !== JSCompiler_object_inline_message_2481) + null !== JSCompiler_object_inline_message_2522 && + ((JSCompiler_object_inline_message_2522 = + JSCompiler_object_inline_message_2522.dehydrated), + null !== JSCompiler_object_inline_message_2522) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2481) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2522) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2481 = - JSCompiler_object_inline_stack_2483.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2483.fallback; - if (JSCompiler_object_inline_componentStack_2484) + JSCompiler_object_inline_message_2522 = + JSCompiler_object_inline_stack_2524.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2524.fallback; + if (JSCompiler_object_inline_componentStack_2525) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2524 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_message_2522, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2525 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2484.memoizedState = + (JSCompiler_object_inline_componentStack_2525.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2525.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2523, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9460,9 +9476,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2484.updateQueue), + JSCompiler_object_inline_componentStack_2525.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = + ? (JSCompiler_object_inline_componentStack_2525.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9470,46 +9486,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2483.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2524.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2524 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_message_2522, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2525 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2484.memoizedState = + (JSCompiler_object_inline_componentStack_2525.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2525.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2523, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2522 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2481 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2481) + ((JSCompiler_object_inline_message_2522 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2522) ) { if (didSuspend) workInProgress.flags & 256 @@ -9526,94 +9542,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_stack_2483.fallback), - (JSCompiler_object_inline_message_2481 = workInProgress.mode), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_componentStack_2525 = + JSCompiler_object_inline_stack_2524.fallback), + (JSCompiler_object_inline_message_2522 = workInProgress.mode), + (JSCompiler_object_inline_stack_2524 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2524.children }, - JSCompiler_object_inline_message_2481 + JSCompiler_object_inline_message_2522 )), - (JSCompiler_object_inline_componentStack_2484 = + (JSCompiler_object_inline_componentStack_2525 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_componentStack_2525, + JSCompiler_object_inline_message_2522, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2484.flags |= 2), - (JSCompiler_object_inline_stack_2483.return = workInProgress), - (JSCompiler_object_inline_componentStack_2484.return = + (JSCompiler_object_inline_componentStack_2525.flags |= 2), + (JSCompiler_object_inline_stack_2524.return = workInProgress), + (JSCompiler_object_inline_componentStack_2525.return = workInProgress), - (JSCompiler_object_inline_stack_2483.sibling = - JSCompiler_object_inline_componentStack_2484), - (workInProgress.child = JSCompiler_object_inline_stack_2483), + (JSCompiler_object_inline_stack_2524.sibling = + JSCompiler_object_inline_componentStack_2525), + (workInProgress.child = JSCompiler_object_inline_stack_2524), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2483 = workInProgress.child), - (JSCompiler_object_inline_stack_2483.memoizedState = + (JSCompiler_object_inline_stack_2524 = workInProgress.child), + (JSCompiler_object_inline_stack_2524.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2483.childLanes = + (JSCompiler_object_inline_stack_2524.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2523, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2484)); + JSCompiler_object_inline_componentStack_2525)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2481)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2522)) ) { - JSCompiler_object_inline_digest_2482 = - JSCompiler_object_inline_message_2481.nextSibling && - JSCompiler_object_inline_message_2481.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2482) { - JSCompiler_temp = JSCompiler_object_inline_digest_2482.dgst; - var message = JSCompiler_object_inline_digest_2482.msg; - instance = JSCompiler_object_inline_digest_2482.stck; - var componentStack = JSCompiler_object_inline_digest_2482.cstck; + JSCompiler_object_inline_digest_2523 = + JSCompiler_object_inline_message_2522.nextSibling && + JSCompiler_object_inline_message_2522.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2523) { + JSCompiler_temp = JSCompiler_object_inline_digest_2523.dgst; + var message = JSCompiler_object_inline_digest_2523.msg; + instance = JSCompiler_object_inline_digest_2523.stck; + var componentStack = JSCompiler_object_inline_digest_2523.cstck; } - JSCompiler_object_inline_message_2481 = message; - JSCompiler_object_inline_digest_2482 = JSCompiler_temp; - JSCompiler_object_inline_stack_2483 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2484 = + JSCompiler_object_inline_message_2522 = message; + JSCompiler_object_inline_digest_2523 = JSCompiler_temp; + JSCompiler_object_inline_stack_2524 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2525 = componentStack; - JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_message_2481 - ? Error(JSCompiler_object_inline_message_2481) + JSCompiler_object_inline_componentStack_2525 = + JSCompiler_object_inline_message_2522 + ? Error(JSCompiler_object_inline_message_2522) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2484.stack = - JSCompiler_object_inline_stack_2483 || ""; - JSCompiler_object_inline_componentStack_2484.digest = - JSCompiler_object_inline_digest_2482; - JSCompiler_object_inline_digest_2482 = + JSCompiler_object_inline_componentStack_2525.stack = + JSCompiler_object_inline_stack_2524 || ""; + JSCompiler_object_inline_componentStack_2525.digest = + JSCompiler_object_inline_digest_2523; + JSCompiler_object_inline_digest_2523 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2483 = { - value: JSCompiler_object_inline_componentStack_2484, + JSCompiler_object_inline_stack_2524 = { + value: JSCompiler_object_inline_componentStack_2525, source: null, - stack: JSCompiler_object_inline_digest_2482 + stack: JSCompiler_object_inline_digest_2523 }; - "string" === typeof JSCompiler_object_inline_digest_2482 && + "string" === typeof JSCompiler_object_inline_digest_2523 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_componentStack_2525, + JSCompiler_object_inline_stack_2524 ); - queueHydrationError(JSCompiler_object_inline_stack_2483); + queueHydrationError(JSCompiler_object_inline_stack_2524); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9627,44 +9643,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2482 = + (JSCompiler_object_inline_digest_2523 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2482) + didReceiveUpdate || JSCompiler_object_inline_digest_2523) ) { - JSCompiler_object_inline_digest_2482 = workInProgressRoot; + JSCompiler_object_inline_digest_2523 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2482 && - ((JSCompiler_object_inline_stack_2483 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2483 = - 0 !== (JSCompiler_object_inline_stack_2483 & 42) + null !== JSCompiler_object_inline_digest_2523 && + ((JSCompiler_object_inline_stack_2524 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2524 = + 0 !== (JSCompiler_object_inline_stack_2524 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 )), - (JSCompiler_object_inline_stack_2483 = + (JSCompiler_object_inline_stack_2524 = 0 !== - (JSCompiler_object_inline_stack_2483 & - (JSCompiler_object_inline_digest_2482.suspendedLanes | + (JSCompiler_object_inline_stack_2524 & + (JSCompiler_object_inline_digest_2523.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2483), - 0 !== JSCompiler_object_inline_stack_2483 && - JSCompiler_object_inline_stack_2483 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2524), + 0 !== JSCompiler_object_inline_stack_2524 && + JSCompiler_object_inline_stack_2524 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2483), + ((prevState.retryLane = JSCompiler_object_inline_stack_2524), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2523, current, - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2481.data === + JSCompiler_object_inline_message_2522.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9672,14 +9688,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2481.data === + JSCompiler_object_inline_message_2522.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2481.nextSibling + JSCompiler_object_inline_message_2522.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9697,57 +9713,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2483.children + JSCompiler_object_inline_stack_2524.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2484) + if (JSCompiler_object_inline_componentStack_2525) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2484 = - JSCompiler_object_inline_stack_2483.fallback), - (JSCompiler_object_inline_message_2481 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2525 = + JSCompiler_object_inline_stack_2524.fallback), + (JSCompiler_object_inline_message_2522 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2483 = createWorkInProgress( + (JSCompiler_object_inline_stack_2524 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2524.children } )), - (JSCompiler_object_inline_stack_2483.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (JSCompiler_object_inline_stack_2524.subtreeFlags = + JSCompiler_temp.subtreeFlags & 29360128), null !== instance - ? (JSCompiler_object_inline_componentStack_2484 = + ? (JSCompiler_object_inline_componentStack_2525 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2484 + JSCompiler_object_inline_componentStack_2525 )) - : ((JSCompiler_object_inline_componentStack_2484 = + : ((JSCompiler_object_inline_componentStack_2525 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2484, - JSCompiler_object_inline_message_2481, + JSCompiler_object_inline_componentStack_2525, + JSCompiler_object_inline_message_2522, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2484.flags |= 2)), - (JSCompiler_object_inline_componentStack_2484.return = + (JSCompiler_object_inline_componentStack_2525.flags |= 2)), + (JSCompiler_object_inline_componentStack_2525.return = workInProgress), - (JSCompiler_object_inline_stack_2483.return = workInProgress), - (JSCompiler_object_inline_stack_2483.sibling = - JSCompiler_object_inline_componentStack_2484), - (workInProgress.child = JSCompiler_object_inline_stack_2483), - (JSCompiler_object_inline_stack_2483 = - JSCompiler_object_inline_componentStack_2484), - (JSCompiler_object_inline_componentStack_2484 = workInProgress.child), - (JSCompiler_object_inline_message_2481 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2481 - ? (JSCompiler_object_inline_message_2481 = + (JSCompiler_object_inline_stack_2524.return = workInProgress), + (JSCompiler_object_inline_stack_2524.sibling = + JSCompiler_object_inline_componentStack_2525), + (workInProgress.child = JSCompiler_object_inline_stack_2524), + (JSCompiler_object_inline_stack_2524 = + JSCompiler_object_inline_componentStack_2525), + (JSCompiler_object_inline_componentStack_2525 = workInProgress.child), + (JSCompiler_object_inline_message_2522 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2522 + ? (JSCompiler_object_inline_message_2522 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2481.cachePool), + JSCompiler_object_inline_message_2522.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9755,34 +9771,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2481 = { + (JSCompiler_object_inline_message_2522 = { baseLanes: - JSCompiler_object_inline_message_2481.baseLanes | renderLanes, + JSCompiler_object_inline_message_2522.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2484.memoizedState = - JSCompiler_object_inline_message_2481), + (JSCompiler_object_inline_componentStack_2525.memoizedState = + JSCompiler_object_inline_message_2522), enableTransitionTracing && - ((JSCompiler_object_inline_message_2481 = enableTransitionTracing + ((JSCompiler_object_inline_message_2522 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2481 && + null !== JSCompiler_object_inline_message_2522 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2484.updateQueue), + JSCompiler_object_inline_componentStack_2525.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = { - transitions: JSCompiler_object_inline_message_2481, + ? (JSCompiler_object_inline_componentStack_2525.updateQueue = { + transitions: JSCompiler_object_inline_message_2522, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2484.updateQueue = + ? (JSCompiler_object_inline_componentStack_2525.updateQueue = { - transitions: JSCompiler_object_inline_message_2481, + transitions: JSCompiler_object_inline_message_2522, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9790,32 +9806,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2481), + JSCompiler_object_inline_message_2522), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2484.childLanes = + (JSCompiler_object_inline_componentStack_2525.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2482, + JSCompiler_object_inline_digest_2523, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2483 + JSCompiler_object_inline_stack_2524 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2483.children + children: JSCompiler_object_inline_stack_2524.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2482 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2482 + ((JSCompiler_object_inline_digest_2523 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2523 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2482.push(current)); + : JSCompiler_object_inline_digest_2523.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11217,8 +11233,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -11230,8 +11246,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & ProfileMode) !== NoMode) { @@ -12762,6 +12778,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -12873,10 +12890,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13613,12 +13627,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -13753,7 +13761,9 @@ __DEV__ && if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -14513,6 +14523,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -15435,21 +15453,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15467,7 +15481,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15529,18 +15543,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15563,16 +15583,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15668,8 +15686,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16050,7 +16066,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$39) { handleThrow(root, thrownValue$39); @@ -16075,7 +16091,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -16301,205 +16317,342 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16518,40 +16671,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -17120,7 +17276,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -17158,7 +17314,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -17447,11 +17603,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17464,7 +17616,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -17599,23 +17750,6 @@ __DEV__ && } return component.stateNode; } - function updateContainerSync( - element, - container, - parentComponent, - callback - ) { - 0 === container.tag && flushPassiveEffects(); - updateContainerImpl( - container.current, - 2, - element, - container, - parentComponent, - callback - ); - return 2; - } function updateContainerImpl( rootFiber, lane, @@ -18137,100 +18271,6 @@ __DEV__ && "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -20974,36 +21014,34 @@ __DEV__ && } case "src": case "href": - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ? hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ) - : ("src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ), - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - )); + if ( + !( + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ) + ) { + "src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ); + continue; + } + hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ); continue; case "action": case "formAction": @@ -21522,11 +21560,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -21635,7 +21668,9 @@ __DEV__ && else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null @@ -26316,10 +26351,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -26329,9 +26375,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -27153,11 +27196,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-a9bbe346-20241219" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-a160102f-20250107" !== 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.1.0-www-modern-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-a160102f-20250107\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27200,10 +27243,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27276,7 +27319,7 @@ __DEV__ && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync(null, args, null, null); + updateContainerImpl(args.current, 2, null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -27801,7 +27844,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; "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 2982972f05c07..568bec28c315b 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -626,14 +626,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -643,29 +642,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2131,8 +2130,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -2167,7 +2165,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2179,6 +2179,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2230,7 +2233,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2281,13 +2285,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2301,14 +2308,17 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5945,12 +5955,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6663,7 +6673,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7732,8 +7742,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$126 = completedWork.child; null !== child$126; ) (newChildLanes |= child$126.lanes | child$126.childLanes), - (subtreeFlags |= child$126.subtreeFlags & 31457280), - (subtreeFlags |= child$126.flags & 31457280), + (subtreeFlags |= child$126.subtreeFlags & 29360128), + (subtreeFlags |= child$126.flags & 29360128), (child$126.return = completedWork), (child$126 = child$126.sibling); else @@ -8711,7 +8721,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$202) { + } catch (e$201) { JSCompiler_temp = null; break a; } @@ -8762,6 +8772,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8893,10 +8904,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9609,7 +9617,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((currentResource = maybeNodes[i]), currentResource.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === @@ -10284,6 +10294,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10943,10 +10961,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -11124,8 +11146,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11138,7 +11158,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11199,18 +11219,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11228,16 +11254,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11330,8 +11354,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11611,7 +11633,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$192) { handleThrow(root, thrownValue$192); @@ -11627,7 +11649,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -11806,164 +11828,290 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$196 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -11971,36 +12119,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -12244,7 +12395,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12263,7 +12414,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12493,11 +12644,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12510,7 +12657,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13223,19 +13369,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$352; + var JSCompiler_inline_result$jscomp$351; if (canUseDOM) { - var isSupported$jscomp$inline_1556 = "oninput" in document; - if (!isSupported$jscomp$inline_1556) { - var element$jscomp$inline_1557 = document.createElement("div"); - element$jscomp$inline_1557.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1556 = - "function" === typeof element$jscomp$inline_1557.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$352 = isSupported$jscomp$inline_1556; - } else JSCompiler_inline_result$jscomp$352 = !1; + JSCompiler_inline_result$jscomp$351 = isSupported$jscomp$inline_1567; + } else JSCompiler_inline_result$jscomp$351 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$352 && + JSCompiler_inline_result$jscomp$351 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13361,97 +13507,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -13646,20 +13701,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1597 = 0; - i$jscomp$inline_1597 < simpleEventPluginEvents.length; - i$jscomp$inline_1597++ + var i$jscomp$inline_1608 = 0; + i$jscomp$inline_1608 < simpleEventPluginEvents.length; + i$jscomp$inline_1608++ ) { - var eventName$jscomp$inline_1598 = - simpleEventPluginEvents[i$jscomp$inline_1597], - domEventName$jscomp$inline_1599 = - eventName$jscomp$inline_1598.toLowerCase(), - capitalizedEvent$jscomp$inline_1600 = - eventName$jscomp$inline_1598[0].toUpperCase() + - eventName$jscomp$inline_1598.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_1599, - "on" + capitalizedEvent$jscomp$inline_1600 + domEventName$jscomp$inline_1610, + "on" + capitalizedEvent$jscomp$inline_1611 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14952,34 +15007,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$216 = props[hasSrc]; - if (null != propValue$216) + var propValue$215 = props[hasSrc]; + if (null != propValue$215) switch (hasSrc) { case "name": - hasSrcSet = propValue$216; + hasSrcSet = propValue$215; break; case "type": - propValue = propValue$216; + propValue = propValue$215; break; case "checked": - checked = propValue$216; + checked = propValue$215; break; case "defaultChecked": - defaultChecked = propValue$216; + defaultChecked = propValue$215; break; case "value": - propKey = propValue$216; + propKey = propValue$215; break; case "defaultValue": - defaultValue = propValue$216; + defaultValue = propValue$215; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$216) + if (null != propValue$215) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$216, props, null); + setProp(domElement, tag, hasSrc, propValue$215, props, null); } } initInput( @@ -15116,14 +15171,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$216 in props) - props.hasOwnProperty(propValue$216) && - ((hasSrc = props[propValue$216]), + for (propValue$215 in props) + props.hasOwnProperty(propValue$215) && + ((hasSrc = props[propValue$215]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$216, + propValue$215, hasSrc, props, void 0 @@ -15171,14 +15226,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$233 in nextProps) { - var propKey = nextProps[propKey$233]; - lastProp = lastProps[propKey$233]; + for (var propKey$232 in nextProps) { + var propKey = nextProps[propKey$232]; + lastProp = lastProps[propKey$232]; if ( - nextProps.hasOwnProperty(propKey$233) && + nextProps.hasOwnProperty(propKey$232) && (null != propKey || null != lastProp) ) - switch (propKey$233) { + switch (propKey$232) { case "type": type = propKey; break; @@ -15207,7 +15262,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$233, + propKey$232, propKey, nextProps, lastProp @@ -15226,7 +15281,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$233 = null; + propKey = value = defaultValue = propKey$232 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15257,7 +15312,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$233 = type; + propKey$232 = type; break; case "defaultValue": defaultValue = type; @@ -15278,15 +15333,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$233 - ? updateOptions(domElement, !!lastProps, propKey$233, !1) + null != propKey$232 + ? updateOptions(domElement, !!lastProps, propKey$232, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$233 = null; + propKey = propKey$232 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15310,7 +15365,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$233 = name; + propKey$232 = name; break; case "defaultValue": propKey = name; @@ -15324,17 +15379,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$233, propKey); + updateTextarea(domElement, propKey$232, propKey); return; case "option": - for (var propKey$249 in lastProps) + for (var propKey$248 in lastProps) if ( - ((propKey$233 = lastProps[propKey$249]), - lastProps.hasOwnProperty(propKey$249) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$249)) + ((propKey$232 = lastProps[propKey$248]), + lastProps.hasOwnProperty(propKey$248) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$248)) ) - switch (propKey$249) { + switch (propKey$248) { case "selected": domElement.selected = !1; break; @@ -15342,33 +15397,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$249, + propKey$248, null, nextProps, - propKey$233 + propKey$232 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$233 = nextProps[lastDefaultValue]), + ((propKey$232 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$233 !== propKey && - (null != propKey$233 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$233 && - "function" !== typeof propKey$233 && - "symbol" !== typeof propKey$233; + propKey$232 && + "function" !== typeof propKey$232 && + "symbol" !== typeof propKey$232; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$233, + propKey$232, nextProps, propKey ); @@ -15389,24 +15444,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$254 in lastProps) - (propKey$233 = lastProps[propKey$254]), - lastProps.hasOwnProperty(propKey$254) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$254) && - setProp(domElement, tag, propKey$254, null, nextProps, propKey$233); + for (var propKey$253 in lastProps) + (propKey$232 = lastProps[propKey$253]), + lastProps.hasOwnProperty(propKey$253) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$253) && + setProp(domElement, tag, propKey$253, null, nextProps, propKey$232); for (checked in nextProps) if ( - ((propKey$233 = nextProps[checked]), + ((propKey$232 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$233 !== propKey && - (null != propKey$233 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$233) + if (null != propKey$232) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15414,7 +15469,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$233, + propKey$232, nextProps, propKey ); @@ -15422,49 +15477,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$259 in lastProps) - (propKey$233 = lastProps[propKey$259]), - lastProps.hasOwnProperty(propKey$259) && - void 0 !== propKey$233 && - !nextProps.hasOwnProperty(propKey$259) && + for (var propKey$258 in lastProps) + (propKey$232 = lastProps[propKey$258]), + lastProps.hasOwnProperty(propKey$258) && + void 0 !== propKey$232 && + !nextProps.hasOwnProperty(propKey$258) && setPropOnCustomElement( domElement, tag, - propKey$259, + propKey$258, void 0, nextProps, - propKey$233 + propKey$232 ); for (defaultChecked in nextProps) - (propKey$233 = nextProps[defaultChecked]), + (propKey$232 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$233 === propKey || - (void 0 === propKey$233 && void 0 === propKey) || + propKey$232 === propKey || + (void 0 === propKey$232 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$233, + propKey$232, nextProps, propKey ); return; } } - for (var propKey$264 in lastProps) - (propKey$233 = lastProps[propKey$264]), - lastProps.hasOwnProperty(propKey$264) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$264) && - setProp(domElement, tag, propKey$264, null, nextProps, propKey$233); + for (var propKey$263 in lastProps) + (propKey$232 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$263) && + setProp(domElement, tag, propKey$263, null, nextProps, propKey$232); for (lastProp in nextProps) - (propKey$233 = nextProps[lastProp]), + (propKey$232 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$233 === propKey || - (null == propKey$233 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$233, nextProps, propKey); + propKey$232 === propKey || + (null == propKey$232 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$232, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15560,11 +15615,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -15636,7 +15686,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -16061,26 +16113,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$272 = getResourcesFromRoot( + var styles$271 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$273 = styles$272.get(type); - resource$273 || + resource$272 = styles$271.get(type); + resource$272 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$273 = { + (resource$272 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$272.set(type, resource$273), - (styles$272 = JSCompiler_inline_result.querySelector( + styles$271.set(type, resource$272), + (styles$271 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$272._p && - ((resource$273.instance = styles$272), - (resource$273.state.loading = 5)), + !styles$271._p && + ((resource$272.instance = styles$271), + (resource$272.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16093,16 +16145,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$272 || + styles$271 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$273.state + resource$272.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$273; + return resource$272; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16199,37 +16251,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$278 = hoistableRoot.querySelector( + var instance$277 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$278) + if (instance$277) return ( (resource.state.loading |= 4), - (resource.instance = instance$278), - markNodeAsHoistable(instance$278), - instance$278 + (resource.instance = instance$277), + markNodeAsHoistable(instance$277), + instance$277 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$278 = ( + instance$277 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$278); - var linkInstance = instance$278; + markNodeAsHoistable(instance$277); + var linkInstance = instance$277; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$278, "link", instance); + setInitialProperties(instance$277, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$278, props.precedence, hoistableRoot); - return (resource.instance = instance$278); + insertStylesheet(instance$277, props.precedence, hoistableRoot); + return (resource.instance = instance$277); case "script": - instance$278 = getScriptKey(props.src); + instance$277 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$278) + getScriptSelectorFromKey(instance$277) )) ) return ( @@ -16238,7 +16290,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$278))) + if ((styleProps = preloadPropsMap.get(instance$277))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17242,16 +17294,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1770 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1781 = React.version; if ( - "19.1.0-www-classic-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1770 + "19.1.0-www-classic-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1781 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1770, - "19.1.0-www-classic-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1781, + "19.1.0-www-classic-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17267,24 +17319,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2307 = { +var internals$jscomp$inline_2316 = { bundleType: 0, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2308 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2317 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2308.isDisabled && - hook$jscomp$inline_2308.supportsFiber + !hook$jscomp$inline_2317.isDisabled && + hook$jscomp$inline_2317.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2308.inject( - internals$jscomp$inline_2307 + (rendererID = hook$jscomp$inline_2317.inject( + internals$jscomp$inline_2316 )), - (injectedHook = hook$jscomp$inline_2308); + (injectedHook = hook$jscomp$inline_2317); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17304,7 +17356,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -17637,4 +17688,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 4e8342cf5dfeb..2d6200193697d 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -561,14 +561,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -578,29 +577,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1982,8 +1981,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -2018,7 +2016,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2030,6 +2030,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2081,7 +2084,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2132,13 +2136,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2152,14 +2159,17 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5796,12 +5806,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6437,7 +6447,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7502,8 +7512,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$126 = completedWork.child; null !== child$126; ) (newChildLanes |= child$126.lanes | child$126.childLanes), - (subtreeFlags |= child$126.subtreeFlags & 31457280), - (subtreeFlags |= child$126.flags & 31457280), + (subtreeFlags |= child$126.subtreeFlags & 29360128), + (subtreeFlags |= child$126.flags & 29360128), (child$126.return = completedWork), (child$126 = child$126.sibling); else @@ -8462,7 +8472,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$202) { + } catch (e$201) { JSCompiler_temp = null; break a; } @@ -8513,6 +8523,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8644,10 +8655,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9360,7 +9368,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((currentResource = maybeNodes[i]), currentResource.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === @@ -10035,6 +10045,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10694,10 +10712,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -10875,8 +10897,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -10889,7 +10909,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10950,18 +10970,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -10979,16 +11005,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11081,8 +11105,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11362,7 +11384,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$192) { handleThrow(root, thrownValue$192); @@ -11378,7 +11400,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -11553,164 +11575,290 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$196 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$196 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -11718,36 +11866,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$197 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$197, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -11991,7 +12142,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12010,7 +12161,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12240,11 +12391,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12257,7 +12404,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12959,19 +13105,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$355; + var JSCompiler_inline_result$jscomp$354; if (canUseDOM) { - var isSupported$jscomp$inline_1546 = "oninput" in document; - if (!isSupported$jscomp$inline_1546) { - var element$jscomp$inline_1547 = document.createElement("div"); - element$jscomp$inline_1547.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1546 = - "function" === typeof element$jscomp$inline_1547.oninput; + var isSupported$jscomp$inline_1557 = "oninput" in document; + if (!isSupported$jscomp$inline_1557) { + var element$jscomp$inline_1558 = document.createElement("div"); + element$jscomp$inline_1558.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1557 = + "function" === typeof element$jscomp$inline_1558.oninput; } - JSCompiler_inline_result$jscomp$355 = isSupported$jscomp$inline_1546; - } else JSCompiler_inline_result$jscomp$355 = !1; + JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1557; + } else JSCompiler_inline_result$jscomp$354 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$355 && + JSCompiler_inline_result$jscomp$354 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13097,97 +13243,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -13382,20 +13437,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1587 = 0; - i$jscomp$inline_1587 < simpleEventPluginEvents.length; - i$jscomp$inline_1587++ + var i$jscomp$inline_1598 = 0; + i$jscomp$inline_1598 < simpleEventPluginEvents.length; + i$jscomp$inline_1598++ ) { - var eventName$jscomp$inline_1588 = - simpleEventPluginEvents[i$jscomp$inline_1587], - domEventName$jscomp$inline_1589 = - eventName$jscomp$inline_1588.toLowerCase(), - capitalizedEvent$jscomp$inline_1590 = - eventName$jscomp$inline_1588[0].toUpperCase() + - eventName$jscomp$inline_1588.slice(1); + var eventName$jscomp$inline_1599 = + simpleEventPluginEvents[i$jscomp$inline_1598], + domEventName$jscomp$inline_1600 = + eventName$jscomp$inline_1599.toLowerCase(), + capitalizedEvent$jscomp$inline_1601 = + eventName$jscomp$inline_1599[0].toUpperCase() + + eventName$jscomp$inline_1599.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1589, - "on" + capitalizedEvent$jscomp$inline_1590 + domEventName$jscomp$inline_1600, + "on" + capitalizedEvent$jscomp$inline_1601 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14684,34 +14739,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$216 = props[hasSrc]; - if (null != propValue$216) + var propValue$215 = props[hasSrc]; + if (null != propValue$215) switch (hasSrc) { case "name": - hasSrcSet = propValue$216; + hasSrcSet = propValue$215; break; case "type": - propKey = propValue$216; + propKey = propValue$215; break; case "checked": - checked = propValue$216; + checked = propValue$215; break; case "defaultChecked": - defaultChecked = propValue$216; + defaultChecked = propValue$215; break; case "value": - propValue = propValue$216; + propValue = propValue$215; break; case "defaultValue": - defaultValue = propValue$216; + defaultValue = propValue$215; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$216) + if (null != propValue$215) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$216, props, null); + setProp(domElement, tag, hasSrc, propValue$215, props, null); } } initInput( @@ -14847,14 +14902,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$216 in props) - props.hasOwnProperty(propValue$216) && - ((hasSrc = props[propValue$216]), + for (propValue$215 in props) + props.hasOwnProperty(propValue$215) && + ((hasSrc = props[propValue$215]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$216, + propValue$215, hasSrc, props, void 0 @@ -14902,14 +14957,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$233 in nextProps) { - var propKey = nextProps[propKey$233]; - lastProp = lastProps[propKey$233]; + for (var propKey$232 in nextProps) { + var propKey = nextProps[propKey$232]; + lastProp = lastProps[propKey$232]; if ( - nextProps.hasOwnProperty(propKey$233) && + nextProps.hasOwnProperty(propKey$232) && (null != propKey || null != lastProp) ) - switch (propKey$233) { + switch (propKey$232) { case "type": type = propKey; break; @@ -14938,7 +14993,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$233, + propKey$232, propKey, nextProps, lastProp @@ -14957,7 +15012,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$233 = null; + propKey = value = defaultValue = propKey$232 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14988,7 +15043,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$233 = type; + propKey$232 = type; break; case "defaultValue": defaultValue = type; @@ -15009,15 +15064,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$233 - ? updateOptions(domElement, !!lastProps, propKey$233, !1) + null != propKey$232 + ? updateOptions(domElement, !!lastProps, propKey$232, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$233 = null; + propKey = propKey$232 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15041,7 +15096,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$233 = name; + propKey$232 = name; break; case "defaultValue": propKey = name; @@ -15055,17 +15110,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$233, propKey); + updateTextarea(domElement, propKey$232, propKey); return; case "option": - for (var propKey$249 in lastProps) + for (var propKey$248 in lastProps) if ( - ((propKey$233 = lastProps[propKey$249]), - lastProps.hasOwnProperty(propKey$249) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$249)) + ((propKey$232 = lastProps[propKey$248]), + lastProps.hasOwnProperty(propKey$248) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$248)) ) - switch (propKey$249) { + switch (propKey$248) { case "selected": domElement.selected = !1; break; @@ -15073,33 +15128,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$249, + propKey$248, null, nextProps, - propKey$233 + propKey$232 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$233 = nextProps[lastDefaultValue]), + ((propKey$232 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$233 !== propKey && - (null != propKey$233 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$233 && - "function" !== typeof propKey$233 && - "symbol" !== typeof propKey$233; + propKey$232 && + "function" !== typeof propKey$232 && + "symbol" !== typeof propKey$232; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$233, + propKey$232, nextProps, propKey ); @@ -15120,24 +15175,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$254 in lastProps) - (propKey$233 = lastProps[propKey$254]), - lastProps.hasOwnProperty(propKey$254) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$254) && - setProp(domElement, tag, propKey$254, null, nextProps, propKey$233); + for (var propKey$253 in lastProps) + (propKey$232 = lastProps[propKey$253]), + lastProps.hasOwnProperty(propKey$253) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$253) && + setProp(domElement, tag, propKey$253, null, nextProps, propKey$232); for (checked in nextProps) if ( - ((propKey$233 = nextProps[checked]), + ((propKey$232 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$233 !== propKey && - (null != propKey$233 || null != propKey)) + propKey$232 !== propKey && + (null != propKey$232 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$233) + if (null != propKey$232) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15145,7 +15200,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$233, + propKey$232, nextProps, propKey ); @@ -15153,49 +15208,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$259 in lastProps) - (propKey$233 = lastProps[propKey$259]), - lastProps.hasOwnProperty(propKey$259) && - void 0 !== propKey$233 && - !nextProps.hasOwnProperty(propKey$259) && + for (var propKey$258 in lastProps) + (propKey$232 = lastProps[propKey$258]), + lastProps.hasOwnProperty(propKey$258) && + void 0 !== propKey$232 && + !nextProps.hasOwnProperty(propKey$258) && setPropOnCustomElement( domElement, tag, - propKey$259, + propKey$258, void 0, nextProps, - propKey$233 + propKey$232 ); for (defaultChecked in nextProps) - (propKey$233 = nextProps[defaultChecked]), + (propKey$232 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$233 === propKey || - (void 0 === propKey$233 && void 0 === propKey) || + propKey$232 === propKey || + (void 0 === propKey$232 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$233, + propKey$232, nextProps, propKey ); return; } } - for (var propKey$264 in lastProps) - (propKey$233 = lastProps[propKey$264]), - lastProps.hasOwnProperty(propKey$264) && - null != propKey$233 && - !nextProps.hasOwnProperty(propKey$264) && - setProp(domElement, tag, propKey$264, null, nextProps, propKey$233); + for (var propKey$263 in lastProps) + (propKey$232 = lastProps[propKey$263]), + lastProps.hasOwnProperty(propKey$263) && + null != propKey$232 && + !nextProps.hasOwnProperty(propKey$263) && + setProp(domElement, tag, propKey$263, null, nextProps, propKey$232); for (lastProp in nextProps) - (propKey$233 = nextProps[lastProp]), + (propKey$232 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$233 === propKey || - (null == propKey$233 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$233, nextProps, propKey); + propKey$232 === propKey || + (null == propKey$232 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$232, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15291,11 +15346,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -15367,7 +15417,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -15792,26 +15844,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$272 = getResourcesFromRoot( + var styles$271 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$273 = styles$272.get(type); - resource$273 || + resource$272 = styles$271.get(type); + resource$272 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$273 = { + (resource$272 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$272.set(type, resource$273), - (styles$272 = JSCompiler_inline_result.querySelector( + styles$271.set(type, resource$272), + (styles$271 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$272._p && - ((resource$273.instance = styles$272), - (resource$273.state.loading = 5)), + !styles$271._p && + ((resource$272.instance = styles$271), + (resource$272.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15824,16 +15876,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$272 || + styles$271 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$273.state + resource$272.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$273; + return resource$272; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15930,37 +15982,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$278 = hoistableRoot.querySelector( + var instance$277 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$278) + if (instance$277) return ( (resource.state.loading |= 4), - (resource.instance = instance$278), - markNodeAsHoistable(instance$278), - instance$278 + (resource.instance = instance$277), + markNodeAsHoistable(instance$277), + instance$277 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$278 = ( + instance$277 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$278); - var linkInstance = instance$278; + markNodeAsHoistable(instance$277); + var linkInstance = instance$277; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$278, "link", instance); + setInitialProperties(instance$277, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$278, props.precedence, hoistableRoot); - return (resource.instance = instance$278); + insertStylesheet(instance$277, props.precedence, hoistableRoot); + return (resource.instance = instance$277); case "script": - instance$278 = getScriptKey(props.src); + instance$277 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$278) + getScriptSelectorFromKey(instance$277) )) ) return ( @@ -15969,7 +16021,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$278))) + if ((styleProps = preloadPropsMap.get(instance$277))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16973,16 +17025,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1760 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1771 = React.version; if ( - "19.1.0-www-modern-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1760 + "19.1.0-www-modern-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1771 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1760, - "19.1.0-www-modern-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1771, + "19.1.0-www-modern-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -16998,24 +17050,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2289 = { +var internals$jscomp$inline_2298 = { bundleType: 0, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2290 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2299 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2290.isDisabled && - hook$jscomp$inline_2290.supportsFiber + !hook$jscomp$inline_2299.isDisabled && + hook$jscomp$inline_2299.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2290.inject( - internals$jscomp$inline_2289 + (rendererID = hook$jscomp$inline_2299.inject( + internals$jscomp$inline_2298 )), - (injectedHook = hook$jscomp$inline_2290); + (injectedHook = hook$jscomp$inline_2299); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17035,7 +17087,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -17368,4 +17419,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 9cf910af3d9e4..c8421c47ea265 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -707,14 +707,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -724,29 +723,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2296,8 +2295,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2332,7 +2330,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$29, - root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$29.cancelPendingCommit || + -1 !== root$29.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || @@ -2344,6 +2344,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2395,7 +2398,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2447,13 +2451,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2467,16 +2474,19 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -6126,12 +6136,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6851,7 +6861,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7942,8 +7952,8 @@ function bubbleProperties(completedWork) { ) (newChildLanes |= child$131.lanes | child$131.childLanes), - (subtreeFlags |= child$131.subtreeFlags & 31457280), - (subtreeFlags |= child$131.flags & 31457280), + (subtreeFlags |= child$131.subtreeFlags & 29360128), + (subtreeFlags |= child$131.flags & 29360128), (treeBaseDuration$130 += child$131.treeBaseDuration), (child$131 = child$131.sibling); completedWork.treeBaseDuration = treeBaseDuration$130; @@ -7955,8 +7965,8 @@ function bubbleProperties(completedWork) { ) (newChildLanes |= treeBaseDuration$130.lanes | treeBaseDuration$130.childLanes), - (subtreeFlags |= treeBaseDuration$130.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$130.flags & 31457280), + (subtreeFlags |= treeBaseDuration$130.subtreeFlags & 29360128), + (subtreeFlags |= treeBaseDuration$130.flags & 29360128), (treeBaseDuration$130.return = completedWork), (treeBaseDuration$130 = treeBaseDuration$130.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -9153,7 +9163,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$219) { + } catch (e$218) { JSCompiler_temp = null; break a; } @@ -9204,6 +9214,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -9335,10 +9346,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9977,12 +9985,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -10107,7 +10109,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -10523,12 +10527,6 @@ function recursivelyResetForms(parentFiber) { parentFiber = parentFiber.sibling; } } -function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -10803,6 +10801,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -11475,10 +11481,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -11657,8 +11667,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11671,7 +11679,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11732,18 +11740,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11761,16 +11775,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11863,8 +11875,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -12192,7 +12202,7 @@ function renderRootConcurrent(root, lanes) { default: throw Error(formatProdErrorMessage(462)); } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$207) { handleThrow(root, thrownValue$207); @@ -12217,7 +12227,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -12414,184 +12424,319 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); - if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$211 = commitBeforeMutationEffects( + if (null === finishedWork) enableSchedulingProfiler && markCommitStopped(); + else { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$211 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + (inProgressRoot = inProgressLanes = null), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12599,36 +12744,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$212 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$212, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); enableSchedulingProfiler && enableSchedulingProfiler && @@ -12901,7 +13049,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12922,7 +13070,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -13157,11 +13305,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -13174,7 +13318,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13359,9 +13502,9 @@ function attemptContinuousHydration(fiber) { function getLaneLabelMap() { if (enableSchedulingProfiler) { for ( - var map = new Map(), lane = 1, index$217 = 0; - 31 > index$217; - index$217++ + var map = new Map(), lane = 1, index$216 = 0; + 31 > index$216; + index$216++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -13912,19 +14055,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$369; + var JSCompiler_inline_result$jscomp$368; if (canUseDOM) { - var isSupported$jscomp$inline_1649 = "oninput" in document; - if (!isSupported$jscomp$inline_1649) { - var element$jscomp$inline_1650 = document.createElement("div"); - element$jscomp$inline_1650.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1649 = - "function" === typeof element$jscomp$inline_1650.oninput; + var isSupported$jscomp$inline_1664 = "oninput" in document; + if (!isSupported$jscomp$inline_1664) { + var element$jscomp$inline_1665 = document.createElement("div"); + element$jscomp$inline_1665.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1664 = + "function" === typeof element$jscomp$inline_1665.oninput; } - JSCompiler_inline_result$jscomp$369 = isSupported$jscomp$inline_1649; - } else JSCompiler_inline_result$jscomp$369 = !1; + JSCompiler_inline_result$jscomp$368 = isSupported$jscomp$inline_1664; + } else JSCompiler_inline_result$jscomp$368 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$369 && + JSCompiler_inline_result$jscomp$368 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -14050,97 +14193,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -14335,20 +14387,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1690 = 0; - i$jscomp$inline_1690 < simpleEventPluginEvents.length; - i$jscomp$inline_1690++ + var i$jscomp$inline_1705 = 0; + i$jscomp$inline_1705 < simpleEventPluginEvents.length; + i$jscomp$inline_1705++ ) { - var eventName$jscomp$inline_1691 = - simpleEventPluginEvents[i$jscomp$inline_1690], - domEventName$jscomp$inline_1692 = - eventName$jscomp$inline_1691.toLowerCase(), - capitalizedEvent$jscomp$inline_1693 = - eventName$jscomp$inline_1691[0].toUpperCase() + - eventName$jscomp$inline_1691.slice(1); + var eventName$jscomp$inline_1706 = + simpleEventPluginEvents[i$jscomp$inline_1705], + domEventName$jscomp$inline_1707 = + eventName$jscomp$inline_1706.toLowerCase(), + capitalizedEvent$jscomp$inline_1708 = + eventName$jscomp$inline_1706[0].toUpperCase() + + eventName$jscomp$inline_1706.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1692, - "on" + capitalizedEvent$jscomp$inline_1693 + domEventName$jscomp$inline_1707, + "on" + capitalizedEvent$jscomp$inline_1708 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15641,34 +15693,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$232 = props[hasSrc]; + if (null != propValue$232) switch (hasSrc) { case "name": - hasSrcSet = propValue$233; + hasSrcSet = propValue$232; break; case "type": - propValue = propValue$233; + propValue = propValue$232; break; case "checked": - checked = propValue$233; + checked = propValue$232; break; case "defaultChecked": - defaultChecked = propValue$233; + defaultChecked = propValue$232; break; case "value": - propKey = propValue$233; + propKey = propValue$232; break; case "defaultValue": - defaultValue = propValue$233; + defaultValue = propValue$232; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$233) + if (null != propValue$232) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$233, props, null); + setProp(domElement, tag, hasSrc, propValue$232, props, null); } } initInput( @@ -15805,14 +15857,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$232 in props) + props.hasOwnProperty(propValue$232) && + ((hasSrc = props[propValue$232]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$233, + propValue$232, hasSrc, props, void 0 @@ -15860,14 +15912,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$249 in nextProps) { + var propKey = nextProps[propKey$249]; + lastProp = lastProps[propKey$249]; if ( - nextProps.hasOwnProperty(propKey$250) && + nextProps.hasOwnProperty(propKey$249) && (null != propKey || null != lastProp) ) - switch (propKey$250) { + switch (propKey$249) { case "type": type = propKey; break; @@ -15896,7 +15948,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$250, + propKey$249, propKey, nextProps, lastProp @@ -15915,7 +15967,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$250 = null; + propKey = value = defaultValue = propKey$249 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15946,7 +15998,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$250 = type; + propKey$249 = type; break; case "defaultValue": defaultValue = type; @@ -15967,15 +16019,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$250 - ? updateOptions(domElement, !!lastProps, propKey$250, !1) + null != propKey$249 + ? updateOptions(domElement, !!lastProps, propKey$249, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$250 = null; + propKey = propKey$249 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15999,7 +16051,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$250 = name; + propKey$249 = name; break; case "defaultValue": propKey = name; @@ -16013,17 +16065,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$250, propKey); + updateTextarea(domElement, propKey$249, propKey); return; case "option": - for (var propKey$266 in lastProps) + for (var propKey$265 in lastProps) if ( - ((propKey$250 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$250 && - !nextProps.hasOwnProperty(propKey$266)) + ((propKey$249 = lastProps[propKey$265]), + lastProps.hasOwnProperty(propKey$265) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$265)) ) - switch (propKey$266) { + switch (propKey$265) { case "selected": domElement.selected = !1; break; @@ -16031,33 +16083,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$266, + propKey$265, null, nextProps, - propKey$250 + propKey$249 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$250 = nextProps[lastDefaultValue]), + ((propKey$249 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$249 !== propKey && + (null != propKey$249 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$250 && - "function" !== typeof propKey$250 && - "symbol" !== typeof propKey$250; + propKey$249 && + "function" !== typeof propKey$249 && + "symbol" !== typeof propKey$249; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$250, + propKey$249, nextProps, propKey ); @@ -16078,24 +16130,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$270 in lastProps) + (propKey$249 = lastProps[propKey$270]), + lastProps.hasOwnProperty(propKey$270) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$270) && + setProp(domElement, tag, propKey$270, null, nextProps, propKey$249); for (checked in nextProps) if ( - ((propKey$250 = nextProps[checked]), + ((propKey$249 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$249 !== propKey && + (null != propKey$249 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$250) + if (null != propKey$249) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -16103,7 +16155,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$250, + propKey$249, nextProps, propKey ); @@ -16111,49 +16163,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$275 in lastProps) + (propKey$249 = lastProps[propKey$275]), + lastProps.hasOwnProperty(propKey$275) && + void 0 !== propKey$249 && + !nextProps.hasOwnProperty(propKey$275) && setPropOnCustomElement( domElement, tag, - propKey$276, + propKey$275, void 0, nextProps, - propKey$250 + propKey$249 ); for (defaultChecked in nextProps) - (propKey$250 = nextProps[defaultChecked]), + (propKey$249 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$250 === propKey || - (void 0 === propKey$250 && void 0 === propKey) || + propKey$249 === propKey || + (void 0 === propKey$249 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$250, + propKey$249, 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$280 in lastProps) + (propKey$249 = lastProps[propKey$280]), + lastProps.hasOwnProperty(propKey$280) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$280) && + setProp(domElement, tag, propKey$280, null, nextProps, propKey$249); for (lastProp in nextProps) - (propKey$250 = nextProps[lastProp]), + (propKey$249 = 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$249 === propKey || + (null == propKey$249 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$249, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -16249,11 +16301,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -16325,7 +16372,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -16750,26 +16799,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$289 = getResourcesFromRoot( + var styles$288 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$290 = styles$289.get(type); - resource$290 || + resource$289 = styles$288.get(type); + resource$289 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$290 = { + (resource$289 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$289.set(type, resource$290), - (styles$289 = JSCompiler_inline_result.querySelector( + styles$288.set(type, resource$289), + (styles$288 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$289._p && - ((resource$290.instance = styles$289), - (resource$290.state.loading = 5)), + !styles$288._p && + ((resource$289.instance = styles$288), + (resource$289.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16782,16 +16831,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$289 || + styles$288 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$290.state + resource$289.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$290; + return resource$289; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16888,37 +16937,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$295 = hoistableRoot.querySelector( + var instance$294 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$295) + if (instance$294) return ( (resource.state.loading |= 4), - (resource.instance = instance$295), - markNodeAsHoistable(instance$295), - instance$295 + (resource.instance = instance$294), + markNodeAsHoistable(instance$294), + instance$294 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$295 = ( + instance$294 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$295); - var linkInstance = instance$295; + markNodeAsHoistable(instance$294); + var linkInstance = instance$294; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$295, "link", instance); + setInitialProperties(instance$294, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$295, props.precedence, hoistableRoot); - return (resource.instance = instance$295); + insertStylesheet(instance$294, props.precedence, hoistableRoot); + return (resource.instance = instance$294); case "script": - instance$295 = getScriptKey(props.src); + instance$294 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$295) + getScriptSelectorFromKey(instance$294) )) ) return ( @@ -16927,7 +16976,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$295))) + if ((styleProps = preloadPropsMap.get(instance$294))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17931,16 +17980,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1863 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1878 = React.version; if ( - "19.1.0-www-classic-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1863 + "19.1.0-www-classic-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1878 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1863, - "19.1.0-www-classic-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1878, + "19.1.0-www-classic-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17956,27 +18005,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1865 = { +var internals$jscomp$inline_1880 = { bundleType: 0, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1865.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1865.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1880.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1880.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2359 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2374 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2359.isDisabled && - hook$jscomp$inline_2359.supportsFiber + !hook$jscomp$inline_2374.isDisabled && + hook$jscomp$inline_2374.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2359.inject( - internals$jscomp$inline_1865 + (rendererID = hook$jscomp$inline_2374.inject( + internals$jscomp$inline_1880 )), - (injectedHook = hook$jscomp$inline_2359); + (injectedHook = hook$jscomp$inline_2374); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17996,7 +18045,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -18329,7 +18377,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; "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 175afc43523a0..d76d00e230ef8 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -642,14 +642,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -659,29 +658,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2147,8 +2146,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2183,7 +2181,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$29, - root$29 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$29 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$29.cancelPendingCommit || + -1 !== root$29.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$29, JSCompiler_inline_result) || @@ -2195,6 +2195,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2246,7 +2249,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2298,13 +2302,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2318,16 +2325,19 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5977,12 +5987,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6624,7 +6634,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7711,8 +7721,8 @@ function bubbleProperties(completedWork) { ) (newChildLanes |= child$131.lanes | child$131.childLanes), - (subtreeFlags |= child$131.subtreeFlags & 31457280), - (subtreeFlags |= child$131.flags & 31457280), + (subtreeFlags |= child$131.subtreeFlags & 29360128), + (subtreeFlags |= child$131.flags & 29360128), (treeBaseDuration$130 += child$131.treeBaseDuration), (child$131 = child$131.sibling); completedWork.treeBaseDuration = treeBaseDuration$130; @@ -7724,8 +7734,8 @@ function bubbleProperties(completedWork) { ) (newChildLanes |= treeBaseDuration$130.lanes | treeBaseDuration$130.childLanes), - (subtreeFlags |= treeBaseDuration$130.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$130.flags & 31457280), + (subtreeFlags |= treeBaseDuration$130.subtreeFlags & 29360128), + (subtreeFlags |= treeBaseDuration$130.flags & 29360128), (treeBaseDuration$130.return = completedWork), (treeBaseDuration$130 = treeBaseDuration$130.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -8903,7 +8913,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$219) { + } catch (e$218) { JSCompiler_temp = null; break a; } @@ -8954,6 +8964,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -9085,10 +9096,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9727,12 +9735,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -9857,7 +9859,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -10273,12 +10277,6 @@ function recursivelyResetForms(parentFiber) { parentFiber = parentFiber.sibling; } } -function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -10553,6 +10551,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -11225,10 +11231,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -11407,8 +11417,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11421,7 +11429,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11482,18 +11490,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11511,16 +11525,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11613,8 +11625,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11942,7 +11952,7 @@ function renderRootConcurrent(root, lanes) { default: throw Error(formatProdErrorMessage(462)); } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$207) { handleThrow(root, thrownValue$207); @@ -11967,7 +11977,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -12160,184 +12170,319 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); - if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$211 = commitBeforeMutationEffects( + if (null === finishedWork) enableSchedulingProfiler && markCommitStopped(); + else { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur$211 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + (inProgressLanes = lanes), + (inProgressRoot = root), + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), + (inProgressRoot = inProgressLanes = null), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12345,36 +12490,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$212 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$212, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); enableSchedulingProfiler && enableSchedulingProfiler && @@ -12647,7 +12795,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12668,7 +12816,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12903,11 +13051,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12920,7 +13064,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13066,9 +13209,9 @@ function attemptContinuousHydration(fiber) { function getLaneLabelMap() { if (enableSchedulingProfiler) { for ( - var map = new Map(), lane = 1, index$217 = 0; - 31 > index$217; - index$217++ + var map = new Map(), lane = 1, index$216 = 0; + 31 > index$216; + index$216++ ) { var label = getLabelForLane(lane); map.set(lane, label); @@ -13647,19 +13790,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$372; + var JSCompiler_inline_result$jscomp$371; if (canUseDOM) { - var isSupported$jscomp$inline_1639 = "oninput" in document; - if (!isSupported$jscomp$inline_1639) { - var element$jscomp$inline_1640 = document.createElement("div"); - element$jscomp$inline_1640.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1639 = - "function" === typeof element$jscomp$inline_1640.oninput; + var isSupported$jscomp$inline_1654 = "oninput" in document; + if (!isSupported$jscomp$inline_1654) { + var element$jscomp$inline_1655 = document.createElement("div"); + element$jscomp$inline_1655.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1654 = + "function" === typeof element$jscomp$inline_1655.oninput; } - JSCompiler_inline_result$jscomp$372 = isSupported$jscomp$inline_1639; - } else JSCompiler_inline_result$jscomp$372 = !1; + JSCompiler_inline_result$jscomp$371 = isSupported$jscomp$inline_1654; + } else JSCompiler_inline_result$jscomp$371 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$372 && + JSCompiler_inline_result$jscomp$371 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13785,97 +13928,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -14070,20 +14122,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1680 = 0; - i$jscomp$inline_1680 < simpleEventPluginEvents.length; - i$jscomp$inline_1680++ + var i$jscomp$inline_1695 = 0; + i$jscomp$inline_1695 < simpleEventPluginEvents.length; + i$jscomp$inline_1695++ ) { - var eventName$jscomp$inline_1681 = - simpleEventPluginEvents[i$jscomp$inline_1680], - domEventName$jscomp$inline_1682 = - eventName$jscomp$inline_1681.toLowerCase(), - capitalizedEvent$jscomp$inline_1683 = - eventName$jscomp$inline_1681[0].toUpperCase() + - eventName$jscomp$inline_1681.slice(1); + var eventName$jscomp$inline_1696 = + simpleEventPluginEvents[i$jscomp$inline_1695], + domEventName$jscomp$inline_1697 = + eventName$jscomp$inline_1696.toLowerCase(), + capitalizedEvent$jscomp$inline_1698 = + eventName$jscomp$inline_1696[0].toUpperCase() + + eventName$jscomp$inline_1696.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1682, - "on" + capitalizedEvent$jscomp$inline_1683 + domEventName$jscomp$inline_1697, + "on" + capitalizedEvent$jscomp$inline_1698 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15372,34 +15424,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$232 = props[hasSrc]; + if (null != propValue$232) switch (hasSrc) { case "name": - hasSrcSet = propValue$233; + hasSrcSet = propValue$232; break; case "type": - propKey = propValue$233; + propKey = propValue$232; break; case "checked": - checked = propValue$233; + checked = propValue$232; break; case "defaultChecked": - defaultChecked = propValue$233; + defaultChecked = propValue$232; break; case "value": - propValue = propValue$233; + propValue = propValue$232; break; case "defaultValue": - defaultValue = propValue$233; + defaultValue = propValue$232; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$233) + if (null != propValue$232) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$233, props, null); + setProp(domElement, tag, hasSrc, propValue$232, props, null); } } initInput( @@ -15535,14 +15587,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$232 in props) + props.hasOwnProperty(propValue$232) && + ((hasSrc = props[propValue$232]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$233, + propValue$232, hasSrc, props, void 0 @@ -15590,14 +15642,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$249 in nextProps) { + var propKey = nextProps[propKey$249]; + lastProp = lastProps[propKey$249]; if ( - nextProps.hasOwnProperty(propKey$250) && + nextProps.hasOwnProperty(propKey$249) && (null != propKey || null != lastProp) ) - switch (propKey$250) { + switch (propKey$249) { case "type": type = propKey; break; @@ -15626,7 +15678,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$250, + propKey$249, propKey, nextProps, lastProp @@ -15645,7 +15697,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$250 = null; + propKey = value = defaultValue = propKey$249 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15676,7 +15728,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$250 = type; + propKey$249 = type; break; case "defaultValue": defaultValue = type; @@ -15697,15 +15749,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$250 - ? updateOptions(domElement, !!lastProps, propKey$250, !1) + null != propKey$249 + ? updateOptions(domElement, !!lastProps, propKey$249, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$250 = null; + propKey = propKey$249 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15729,7 +15781,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$250 = name; + propKey$249 = name; break; case "defaultValue": propKey = name; @@ -15743,17 +15795,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$250, propKey); + updateTextarea(domElement, propKey$249, propKey); return; case "option": - for (var propKey$266 in lastProps) + for (var propKey$265 in lastProps) if ( - ((propKey$250 = lastProps[propKey$266]), - lastProps.hasOwnProperty(propKey$266) && - null != propKey$250 && - !nextProps.hasOwnProperty(propKey$266)) + ((propKey$249 = lastProps[propKey$265]), + lastProps.hasOwnProperty(propKey$265) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$265)) ) - switch (propKey$266) { + switch (propKey$265) { case "selected": domElement.selected = !1; break; @@ -15761,33 +15813,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$266, + propKey$265, null, nextProps, - propKey$250 + propKey$249 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$250 = nextProps[lastDefaultValue]), + ((propKey$249 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$249 !== propKey && + (null != propKey$249 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$250 && - "function" !== typeof propKey$250 && - "symbol" !== typeof propKey$250; + propKey$249 && + "function" !== typeof propKey$249 && + "symbol" !== typeof propKey$249; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$250, + propKey$249, nextProps, propKey ); @@ -15808,24 +15860,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$270 in lastProps) + (propKey$249 = lastProps[propKey$270]), + lastProps.hasOwnProperty(propKey$270) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$270) && + setProp(domElement, tag, propKey$270, null, nextProps, propKey$249); for (checked in nextProps) if ( - ((propKey$250 = nextProps[checked]), + ((propKey$249 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$250 !== propKey && - (null != propKey$250 || null != propKey)) + propKey$249 !== propKey && + (null != propKey$249 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$250) + if (null != propKey$249) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15833,7 +15885,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$250, + propKey$249, nextProps, propKey ); @@ -15841,49 +15893,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$275 in lastProps) + (propKey$249 = lastProps[propKey$275]), + lastProps.hasOwnProperty(propKey$275) && + void 0 !== propKey$249 && + !nextProps.hasOwnProperty(propKey$275) && setPropOnCustomElement( domElement, tag, - propKey$276, + propKey$275, void 0, nextProps, - propKey$250 + propKey$249 ); for (defaultChecked in nextProps) - (propKey$250 = nextProps[defaultChecked]), + (propKey$249 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$250 === propKey || - (void 0 === propKey$250 && void 0 === propKey) || + propKey$249 === propKey || + (void 0 === propKey$249 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$250, + propKey$249, 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$280 in lastProps) + (propKey$249 = lastProps[propKey$280]), + lastProps.hasOwnProperty(propKey$280) && + null != propKey$249 && + !nextProps.hasOwnProperty(propKey$280) && + setProp(domElement, tag, propKey$280, null, nextProps, propKey$249); for (lastProp in nextProps) - (propKey$250 = nextProps[lastProp]), + (propKey$249 = 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$249 === propKey || + (null == propKey$249 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$249, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15979,11 +16031,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -16055,7 +16102,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -16480,26 +16529,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$289 = getResourcesFromRoot( + var styles$288 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$290 = styles$289.get(type); - resource$290 || + resource$289 = styles$288.get(type); + resource$289 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$290 = { + (resource$289 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$289.set(type, resource$290), - (styles$289 = JSCompiler_inline_result.querySelector( + styles$288.set(type, resource$289), + (styles$288 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$289._p && - ((resource$290.instance = styles$289), - (resource$290.state.loading = 5)), + !styles$288._p && + ((resource$289.instance = styles$288), + (resource$289.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16512,16 +16561,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$289 || + styles$288 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$290.state + resource$289.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$290; + return resource$289; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16618,37 +16667,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$295 = hoistableRoot.querySelector( + var instance$294 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$295) + if (instance$294) return ( (resource.state.loading |= 4), - (resource.instance = instance$295), - markNodeAsHoistable(instance$295), - instance$295 + (resource.instance = instance$294), + markNodeAsHoistable(instance$294), + instance$294 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$295 = ( + instance$294 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$295); - var linkInstance = instance$295; + markNodeAsHoistable(instance$294); + var linkInstance = instance$294; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$295, "link", instance); + setInitialProperties(instance$294, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$295, props.precedence, hoistableRoot); - return (resource.instance = instance$295); + insertStylesheet(instance$294, props.precedence, hoistableRoot); + return (resource.instance = instance$294); case "script": - instance$295 = getScriptKey(props.src); + instance$294 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$295) + getScriptSelectorFromKey(instance$294) )) ) return ( @@ -16657,7 +16706,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$295))) + if ((styleProps = preloadPropsMap.get(instance$294))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17661,16 +17710,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1853 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1868 = React.version; if ( - "19.1.0-www-modern-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1853 + "19.1.0-www-modern-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1868 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1853, - "19.1.0-www-modern-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1868, + "19.1.0-www-modern-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17686,27 +17735,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1855 = { +var internals$jscomp$inline_1870 = { bundleType: 0, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1855.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1855.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1870.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1870.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2341 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2356 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2341.isDisabled && - hook$jscomp$inline_2341.supportsFiber + !hook$jscomp$inline_2356.isDisabled && + hook$jscomp$inline_2356.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2341.inject( - internals$jscomp$inline_1855 + (rendererID = hook$jscomp$inline_2356.inject( + internals$jscomp$inline_1870 )), - (injectedHook = hook$jscomp$inline_2341); + (injectedHook = hook$jscomp$inline_2356); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17726,7 +17775,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -18059,7 +18107,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; "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 d6d687fbf9541..85c25fc8a7ec0 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -9150,5 +9150,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.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 0ef3f531cf9a7..da9dc4ae15466 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -8976,5 +8976,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.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 13354685cdd44..079b28dcc9e78 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -5898,4 +5898,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 5f6480a1ff595..a5ef7c2358e29 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -5810,4 +5810,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index e534067b780db..febfe3c910722 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -77,13 +77,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (updateContainerSync(element, root, null, null), flushSyncWork$1()); + (updateContainerImpl(root.current, 2, element, root, null, null), + flushSyncWork$1()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -1007,14 +1008,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1024,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4119,11 +4120,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -4157,7 +4156,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4169,6 +4170,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -4223,7 +4227,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4281,14 +4286,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -4303,7 +4316,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -4313,16 +4326,19 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5120,7 +5136,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -8770,14 +8786,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -9570,32 +9586,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2524; - var JSCompiler_object_inline_stack_2525 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2565; + var JSCompiler_object_inline_stack_2566 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2526 = !1; + var JSCompiler_object_inline_componentStack_2567 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2524 = didSuspend) || - (JSCompiler_object_inline_digest_2524 = + (JSCompiler_object_inline_digest_2565 = didSuspend) || + (JSCompiler_object_inline_digest_2565 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2524 && - ((JSCompiler_object_inline_componentStack_2526 = !0), + JSCompiler_object_inline_digest_2565 && + ((JSCompiler_object_inline_componentStack_2567 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2524 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2565 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2526 + JSCompiler_object_inline_componentStack_2567 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2523 = nextHydratableInstance; + var JSCompiler_object_inline_message_2564 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2523)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2564)) { c: { - var instance = JSCompiler_object_inline_message_2523; + var instance = JSCompiler_object_inline_message_2564; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9637,46 +9653,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2564 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2523 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2564 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2523 && - ((JSCompiler_object_inline_message_2523 = - JSCompiler_object_inline_message_2523.dehydrated), - null !== JSCompiler_object_inline_message_2523) + null !== JSCompiler_object_inline_message_2564 && + ((JSCompiler_object_inline_message_2564 = + JSCompiler_object_inline_message_2564.dehydrated), + null !== JSCompiler_object_inline_message_2564) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2523) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2564) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2523 = - JSCompiler_object_inline_stack_2525.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2525.fallback; - if (JSCompiler_object_inline_componentStack_2526) + JSCompiler_object_inline_message_2564 = + JSCompiler_object_inline_stack_2566.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2566.fallback; + if (JSCompiler_object_inline_componentStack_2567) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2566 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_message_2564, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2567 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2526.memoizedState = + (JSCompiler_object_inline_componentStack_2567.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2567.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2565, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9689,9 +9705,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2526.updateQueue), + JSCompiler_object_inline_componentStack_2567.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = + ? (JSCompiler_object_inline_componentStack_2567.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9699,46 +9715,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2525.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2566.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2566 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_message_2564, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2567 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2526.memoizedState = + (JSCompiler_object_inline_componentStack_2567.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2567.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2565, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2564 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2523 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2523) + ((JSCompiler_object_inline_message_2564 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2564) ) { if (didSuspend) workInProgress.flags & 256 @@ -9755,94 +9771,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_stack_2525.fallback), - (JSCompiler_object_inline_message_2523 = workInProgress.mode), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_componentStack_2567 = + JSCompiler_object_inline_stack_2566.fallback), + (JSCompiler_object_inline_message_2564 = workInProgress.mode), + (JSCompiler_object_inline_stack_2566 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2566.children }, - JSCompiler_object_inline_message_2523 + JSCompiler_object_inline_message_2564 )), - (JSCompiler_object_inline_componentStack_2526 = + (JSCompiler_object_inline_componentStack_2567 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_componentStack_2567, + JSCompiler_object_inline_message_2564, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2526.flags |= 2), - (JSCompiler_object_inline_stack_2525.return = workInProgress), - (JSCompiler_object_inline_componentStack_2526.return = + (JSCompiler_object_inline_componentStack_2567.flags |= 2), + (JSCompiler_object_inline_stack_2566.return = workInProgress), + (JSCompiler_object_inline_componentStack_2567.return = workInProgress), - (JSCompiler_object_inline_stack_2525.sibling = - JSCompiler_object_inline_componentStack_2526), - (workInProgress.child = JSCompiler_object_inline_stack_2525), + (JSCompiler_object_inline_stack_2566.sibling = + JSCompiler_object_inline_componentStack_2567), + (workInProgress.child = JSCompiler_object_inline_stack_2566), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2525 = workInProgress.child), - (JSCompiler_object_inline_stack_2525.memoizedState = + (JSCompiler_object_inline_stack_2566 = workInProgress.child), + (JSCompiler_object_inline_stack_2566.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2525.childLanes = + (JSCompiler_object_inline_stack_2566.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2565, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2526)); + JSCompiler_object_inline_componentStack_2567)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2523)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2564)) ) { - JSCompiler_object_inline_digest_2524 = - JSCompiler_object_inline_message_2523.nextSibling && - JSCompiler_object_inline_message_2523.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2524) { - JSCompiler_temp = JSCompiler_object_inline_digest_2524.dgst; - var message = JSCompiler_object_inline_digest_2524.msg; - instance = JSCompiler_object_inline_digest_2524.stck; - var componentStack = JSCompiler_object_inline_digest_2524.cstck; + JSCompiler_object_inline_digest_2565 = + JSCompiler_object_inline_message_2564.nextSibling && + JSCompiler_object_inline_message_2564.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2565) { + JSCompiler_temp = JSCompiler_object_inline_digest_2565.dgst; + var message = JSCompiler_object_inline_digest_2565.msg; + instance = JSCompiler_object_inline_digest_2565.stck; + var componentStack = JSCompiler_object_inline_digest_2565.cstck; } - JSCompiler_object_inline_message_2523 = message; - JSCompiler_object_inline_digest_2524 = JSCompiler_temp; - JSCompiler_object_inline_stack_2525 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2526 = + JSCompiler_object_inline_message_2564 = message; + JSCompiler_object_inline_digest_2565 = JSCompiler_temp; + JSCompiler_object_inline_stack_2566 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2567 = componentStack; - JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_message_2523 - ? Error(JSCompiler_object_inline_message_2523) + JSCompiler_object_inline_componentStack_2567 = + JSCompiler_object_inline_message_2564 + ? Error(JSCompiler_object_inline_message_2564) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2526.stack = - JSCompiler_object_inline_stack_2525 || ""; - JSCompiler_object_inline_componentStack_2526.digest = - JSCompiler_object_inline_digest_2524; - JSCompiler_object_inline_digest_2524 = + JSCompiler_object_inline_componentStack_2567.stack = + JSCompiler_object_inline_stack_2566 || ""; + JSCompiler_object_inline_componentStack_2567.digest = + JSCompiler_object_inline_digest_2565; + JSCompiler_object_inline_digest_2565 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2525 = { - value: JSCompiler_object_inline_componentStack_2526, + JSCompiler_object_inline_stack_2566 = { + value: JSCompiler_object_inline_componentStack_2567, source: null, - stack: JSCompiler_object_inline_digest_2524 + stack: JSCompiler_object_inline_digest_2565 }; - "string" === typeof JSCompiler_object_inline_digest_2524 && + "string" === typeof JSCompiler_object_inline_digest_2565 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_componentStack_2567, + JSCompiler_object_inline_stack_2566 ); - queueHydrationError(JSCompiler_object_inline_stack_2525); + queueHydrationError(JSCompiler_object_inline_stack_2566); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9856,44 +9872,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2524 = + (JSCompiler_object_inline_digest_2565 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2524) + didReceiveUpdate || JSCompiler_object_inline_digest_2565) ) { - JSCompiler_object_inline_digest_2524 = workInProgressRoot; + JSCompiler_object_inline_digest_2565 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2524 && - ((JSCompiler_object_inline_stack_2525 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2525 = - 0 !== (JSCompiler_object_inline_stack_2525 & 42) + null !== JSCompiler_object_inline_digest_2565 && + ((JSCompiler_object_inline_stack_2566 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2566 = + 0 !== (JSCompiler_object_inline_stack_2566 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 )), - (JSCompiler_object_inline_stack_2525 = + (JSCompiler_object_inline_stack_2566 = 0 !== - (JSCompiler_object_inline_stack_2525 & - (JSCompiler_object_inline_digest_2524.suspendedLanes | + (JSCompiler_object_inline_stack_2566 & + (JSCompiler_object_inline_digest_2565.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2525), - 0 !== JSCompiler_object_inline_stack_2525 && - JSCompiler_object_inline_stack_2525 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2566), + 0 !== JSCompiler_object_inline_stack_2566 && + JSCompiler_object_inline_stack_2566 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2525), + ((prevState.retryLane = JSCompiler_object_inline_stack_2566), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2565, current, - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2523.data === + JSCompiler_object_inline_message_2564.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9901,14 +9917,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2523.data === + JSCompiler_object_inline_message_2564.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2523.nextSibling + JSCompiler_object_inline_message_2564.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9926,57 +9942,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2525.children + JSCompiler_object_inline_stack_2566.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2526) + if (JSCompiler_object_inline_componentStack_2567) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2526 = - JSCompiler_object_inline_stack_2525.fallback), - (JSCompiler_object_inline_message_2523 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2567 = + JSCompiler_object_inline_stack_2566.fallback), + (JSCompiler_object_inline_message_2564 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2525 = createWorkInProgress( + (JSCompiler_object_inline_stack_2566 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2566.children } )), - (JSCompiler_object_inline_stack_2525.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (JSCompiler_object_inline_stack_2566.subtreeFlags = + JSCompiler_temp.subtreeFlags & 29360128), null !== instance - ? (JSCompiler_object_inline_componentStack_2526 = + ? (JSCompiler_object_inline_componentStack_2567 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2526 + JSCompiler_object_inline_componentStack_2567 )) - : ((JSCompiler_object_inline_componentStack_2526 = + : ((JSCompiler_object_inline_componentStack_2567 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2526, - JSCompiler_object_inline_message_2523, + JSCompiler_object_inline_componentStack_2567, + JSCompiler_object_inline_message_2564, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2526.flags |= 2)), - (JSCompiler_object_inline_componentStack_2526.return = + (JSCompiler_object_inline_componentStack_2567.flags |= 2)), + (JSCompiler_object_inline_componentStack_2567.return = workInProgress), - (JSCompiler_object_inline_stack_2525.return = workInProgress), - (JSCompiler_object_inline_stack_2525.sibling = - JSCompiler_object_inline_componentStack_2526), - (workInProgress.child = JSCompiler_object_inline_stack_2525), - (JSCompiler_object_inline_stack_2525 = - JSCompiler_object_inline_componentStack_2526), - (JSCompiler_object_inline_componentStack_2526 = workInProgress.child), - (JSCompiler_object_inline_message_2523 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2523 - ? (JSCompiler_object_inline_message_2523 = + (JSCompiler_object_inline_stack_2566.return = workInProgress), + (JSCompiler_object_inline_stack_2566.sibling = + JSCompiler_object_inline_componentStack_2567), + (workInProgress.child = JSCompiler_object_inline_stack_2566), + (JSCompiler_object_inline_stack_2566 = + JSCompiler_object_inline_componentStack_2567), + (JSCompiler_object_inline_componentStack_2567 = workInProgress.child), + (JSCompiler_object_inline_message_2564 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2564 + ? (JSCompiler_object_inline_message_2564 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2523.cachePool), + JSCompiler_object_inline_message_2564.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9984,34 +10000,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2523 = { + (JSCompiler_object_inline_message_2564 = { baseLanes: - JSCompiler_object_inline_message_2523.baseLanes | renderLanes, + JSCompiler_object_inline_message_2564.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2526.memoizedState = - JSCompiler_object_inline_message_2523), + (JSCompiler_object_inline_componentStack_2567.memoizedState = + JSCompiler_object_inline_message_2564), enableTransitionTracing && - ((JSCompiler_object_inline_message_2523 = enableTransitionTracing + ((JSCompiler_object_inline_message_2564 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2523 && + null !== JSCompiler_object_inline_message_2564 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2526.updateQueue), + JSCompiler_object_inline_componentStack_2567.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = { - transitions: JSCompiler_object_inline_message_2523, + ? (JSCompiler_object_inline_componentStack_2567.updateQueue = { + transitions: JSCompiler_object_inline_message_2564, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2526.updateQueue = + ? (JSCompiler_object_inline_componentStack_2567.updateQueue = { - transitions: JSCompiler_object_inline_message_2523, + transitions: JSCompiler_object_inline_message_2564, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -10019,32 +10035,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2523), + JSCompiler_object_inline_message_2564), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2526.childLanes = + (JSCompiler_object_inline_componentStack_2567.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2524, + JSCompiler_object_inline_digest_2565, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2525 + JSCompiler_object_inline_stack_2566 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2525.children + children: JSCompiler_object_inline_stack_2566.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2524 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2524 + ((JSCompiler_object_inline_digest_2565 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2565 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2524.push(current)); + : JSCompiler_object_inline_digest_2565.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11445,8 +11461,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -11458,8 +11474,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & ProfileMode) !== NoMode) { @@ -13004,6 +13020,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -13115,10 +13132,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13855,12 +13869,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -13995,7 +14003,9 @@ __DEV__ && if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -14755,6 +14765,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -15859,21 +15877,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15891,7 +15905,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15953,18 +15967,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15987,16 +16007,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -16092,8 +16110,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16474,7 +16490,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$39) { handleThrow(root, thrownValue$39); @@ -16499,7 +16515,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -16729,205 +16745,342 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16946,40 +17099,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -17548,7 +17704,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -17586,7 +17742,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -17875,11 +18031,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17892,7 +18044,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -18060,23 +18211,6 @@ __DEV__ && } return component.stateNode; } - function updateContainerSync( - element, - container, - parentComponent, - callback - ) { - 0 === container.tag && flushPassiveEffects(); - updateContainerImpl( - container.current, - 2, - element, - container, - parentComponent, - callback - ); - return 2; - } function updateContainerImpl( rootFiber, lane, @@ -18569,100 +18703,6 @@ __DEV__ && "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -21410,36 +21450,34 @@ __DEV__ && } case "src": case "href": - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ? hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ) - : ("src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ), - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - )); + if ( + !( + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ) + ) { + "src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ); + continue; + } + hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ); continue; case "action": case "formAction": @@ -21958,11 +21996,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -22071,7 +22104,9 @@ __DEV__ && else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null @@ -26870,10 +26905,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -26883,9 +26929,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -27708,11 +27751,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-a9bbe346-20241219" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-a160102f-20250107" !== 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.1.0-www-classic-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-a160102f-20250107\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27755,10 +27798,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27831,7 +27874,7 @@ __DEV__ && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync(null, args, null, null); + updateContainerImpl(args.current, 2, null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -28522,5 +28565,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 23dffc7849af9..5d4fd2962db51 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -77,13 +77,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (updateContainerSync(element, root, null, null), flushSyncWork$1()); + (updateContainerImpl(root.current, 2, element, root, null, null), + flushSyncWork$1()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -1007,14 +1008,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1024,29 +1024,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -4006,11 +4007,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -4044,7 +4043,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -4056,6 +4057,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -4110,7 +4114,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -4168,14 +4173,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -4190,7 +4203,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -4200,16 +4213,19 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5007,7 +5023,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -8657,14 +8673,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -9382,32 +9398,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2516; - var JSCompiler_object_inline_stack_2517 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2557; + var JSCompiler_object_inline_stack_2558 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2518 = !1; + var JSCompiler_object_inline_componentStack_2559 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2516 = didSuspend) || - (JSCompiler_object_inline_digest_2516 = + (JSCompiler_object_inline_digest_2557 = didSuspend) || + (JSCompiler_object_inline_digest_2557 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2516 && - ((JSCompiler_object_inline_componentStack_2518 = !0), + JSCompiler_object_inline_digest_2557 && + ((JSCompiler_object_inline_componentStack_2559 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2516 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2557 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2518 + JSCompiler_object_inline_componentStack_2559 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2515 = nextHydratableInstance; + var JSCompiler_object_inline_message_2556 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2515)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2556)) { c: { - var instance = JSCompiler_object_inline_message_2515; + var instance = JSCompiler_object_inline_message_2556; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9449,46 +9465,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2556 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2515 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2556 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2515 && - ((JSCompiler_object_inline_message_2515 = - JSCompiler_object_inline_message_2515.dehydrated), - null !== JSCompiler_object_inline_message_2515) + null !== JSCompiler_object_inline_message_2556 && + ((JSCompiler_object_inline_message_2556 = + JSCompiler_object_inline_message_2556.dehydrated), + null !== JSCompiler_object_inline_message_2556) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2515) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2556) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2515 = - JSCompiler_object_inline_stack_2517.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2517.fallback; - if (JSCompiler_object_inline_componentStack_2518) + JSCompiler_object_inline_message_2556 = + JSCompiler_object_inline_stack_2558.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2558.fallback; + if (JSCompiler_object_inline_componentStack_2559) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2558 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_message_2556, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2559 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2518.memoizedState = + (JSCompiler_object_inline_componentStack_2559.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2559.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2557, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9501,9 +9517,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2518.updateQueue), + JSCompiler_object_inline_componentStack_2559.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = + ? (JSCompiler_object_inline_componentStack_2559.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9511,46 +9527,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2517.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2558.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2558 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_message_2556, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2559 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2518.memoizedState = + (JSCompiler_object_inline_componentStack_2559.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2559.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2557, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2556 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2515 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2515) + ((JSCompiler_object_inline_message_2556 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2556) ) { if (didSuspend) workInProgress.flags & 256 @@ -9567,94 +9583,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_stack_2517.fallback), - (JSCompiler_object_inline_message_2515 = workInProgress.mode), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_componentStack_2559 = + JSCompiler_object_inline_stack_2558.fallback), + (JSCompiler_object_inline_message_2556 = workInProgress.mode), + (JSCompiler_object_inline_stack_2558 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2558.children }, - JSCompiler_object_inline_message_2515 + JSCompiler_object_inline_message_2556 )), - (JSCompiler_object_inline_componentStack_2518 = + (JSCompiler_object_inline_componentStack_2559 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_componentStack_2559, + JSCompiler_object_inline_message_2556, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2518.flags |= 2), - (JSCompiler_object_inline_stack_2517.return = workInProgress), - (JSCompiler_object_inline_componentStack_2518.return = + (JSCompiler_object_inline_componentStack_2559.flags |= 2), + (JSCompiler_object_inline_stack_2558.return = workInProgress), + (JSCompiler_object_inline_componentStack_2559.return = workInProgress), - (JSCompiler_object_inline_stack_2517.sibling = - JSCompiler_object_inline_componentStack_2518), - (workInProgress.child = JSCompiler_object_inline_stack_2517), + (JSCompiler_object_inline_stack_2558.sibling = + JSCompiler_object_inline_componentStack_2559), + (workInProgress.child = JSCompiler_object_inline_stack_2558), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2517 = workInProgress.child), - (JSCompiler_object_inline_stack_2517.memoizedState = + (JSCompiler_object_inline_stack_2558 = workInProgress.child), + (JSCompiler_object_inline_stack_2558.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2517.childLanes = + (JSCompiler_object_inline_stack_2558.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2557, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2518)); + JSCompiler_object_inline_componentStack_2559)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2515)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2556)) ) { - JSCompiler_object_inline_digest_2516 = - JSCompiler_object_inline_message_2515.nextSibling && - JSCompiler_object_inline_message_2515.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2516) { - JSCompiler_temp = JSCompiler_object_inline_digest_2516.dgst; - var message = JSCompiler_object_inline_digest_2516.msg; - instance = JSCompiler_object_inline_digest_2516.stck; - var componentStack = JSCompiler_object_inline_digest_2516.cstck; + JSCompiler_object_inline_digest_2557 = + JSCompiler_object_inline_message_2556.nextSibling && + JSCompiler_object_inline_message_2556.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2557) { + JSCompiler_temp = JSCompiler_object_inline_digest_2557.dgst; + var message = JSCompiler_object_inline_digest_2557.msg; + instance = JSCompiler_object_inline_digest_2557.stck; + var componentStack = JSCompiler_object_inline_digest_2557.cstck; } - JSCompiler_object_inline_message_2515 = message; - JSCompiler_object_inline_digest_2516 = JSCompiler_temp; - JSCompiler_object_inline_stack_2517 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2518 = + JSCompiler_object_inline_message_2556 = message; + JSCompiler_object_inline_digest_2557 = JSCompiler_temp; + JSCompiler_object_inline_stack_2558 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2559 = componentStack; - JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_message_2515 - ? Error(JSCompiler_object_inline_message_2515) + JSCompiler_object_inline_componentStack_2559 = + JSCompiler_object_inline_message_2556 + ? Error(JSCompiler_object_inline_message_2556) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2518.stack = - JSCompiler_object_inline_stack_2517 || ""; - JSCompiler_object_inline_componentStack_2518.digest = - JSCompiler_object_inline_digest_2516; - JSCompiler_object_inline_digest_2516 = + JSCompiler_object_inline_componentStack_2559.stack = + JSCompiler_object_inline_stack_2558 || ""; + JSCompiler_object_inline_componentStack_2559.digest = + JSCompiler_object_inline_digest_2557; + JSCompiler_object_inline_digest_2557 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2517 = { - value: JSCompiler_object_inline_componentStack_2518, + JSCompiler_object_inline_stack_2558 = { + value: JSCompiler_object_inline_componentStack_2559, source: null, - stack: JSCompiler_object_inline_digest_2516 + stack: JSCompiler_object_inline_digest_2557 }; - "string" === typeof JSCompiler_object_inline_digest_2516 && + "string" === typeof JSCompiler_object_inline_digest_2557 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_componentStack_2559, + JSCompiler_object_inline_stack_2558 ); - queueHydrationError(JSCompiler_object_inline_stack_2517); + queueHydrationError(JSCompiler_object_inline_stack_2558); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9668,44 +9684,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2516 = + (JSCompiler_object_inline_digest_2557 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2516) + didReceiveUpdate || JSCompiler_object_inline_digest_2557) ) { - JSCompiler_object_inline_digest_2516 = workInProgressRoot; + JSCompiler_object_inline_digest_2557 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2516 && - ((JSCompiler_object_inline_stack_2517 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2517 = - 0 !== (JSCompiler_object_inline_stack_2517 & 42) + null !== JSCompiler_object_inline_digest_2557 && + ((JSCompiler_object_inline_stack_2558 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2558 = + 0 !== (JSCompiler_object_inline_stack_2558 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 )), - (JSCompiler_object_inline_stack_2517 = + (JSCompiler_object_inline_stack_2558 = 0 !== - (JSCompiler_object_inline_stack_2517 & - (JSCompiler_object_inline_digest_2516.suspendedLanes | + (JSCompiler_object_inline_stack_2558 & + (JSCompiler_object_inline_digest_2557.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2517), - 0 !== JSCompiler_object_inline_stack_2517 && - JSCompiler_object_inline_stack_2517 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2558), + 0 !== JSCompiler_object_inline_stack_2558 && + JSCompiler_object_inline_stack_2558 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2517), + ((prevState.retryLane = JSCompiler_object_inline_stack_2558), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2557, current, - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2515.data === + JSCompiler_object_inline_message_2556.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9713,14 +9729,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2515.data === + JSCompiler_object_inline_message_2556.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2515.nextSibling + JSCompiler_object_inline_message_2556.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9738,57 +9754,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2517.children + JSCompiler_object_inline_stack_2558.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2518) + if (JSCompiler_object_inline_componentStack_2559) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2518 = - JSCompiler_object_inline_stack_2517.fallback), - (JSCompiler_object_inline_message_2515 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2559 = + JSCompiler_object_inline_stack_2558.fallback), + (JSCompiler_object_inline_message_2556 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2517 = createWorkInProgress( + (JSCompiler_object_inline_stack_2558 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2558.children } )), - (JSCompiler_object_inline_stack_2517.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), + (JSCompiler_object_inline_stack_2558.subtreeFlags = + JSCompiler_temp.subtreeFlags & 29360128), null !== instance - ? (JSCompiler_object_inline_componentStack_2518 = + ? (JSCompiler_object_inline_componentStack_2559 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2518 + JSCompiler_object_inline_componentStack_2559 )) - : ((JSCompiler_object_inline_componentStack_2518 = + : ((JSCompiler_object_inline_componentStack_2559 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2518, - JSCompiler_object_inline_message_2515, + JSCompiler_object_inline_componentStack_2559, + JSCompiler_object_inline_message_2556, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2518.flags |= 2)), - (JSCompiler_object_inline_componentStack_2518.return = + (JSCompiler_object_inline_componentStack_2559.flags |= 2)), + (JSCompiler_object_inline_componentStack_2559.return = workInProgress), - (JSCompiler_object_inline_stack_2517.return = workInProgress), - (JSCompiler_object_inline_stack_2517.sibling = - JSCompiler_object_inline_componentStack_2518), - (workInProgress.child = JSCompiler_object_inline_stack_2517), - (JSCompiler_object_inline_stack_2517 = - JSCompiler_object_inline_componentStack_2518), - (JSCompiler_object_inline_componentStack_2518 = workInProgress.child), - (JSCompiler_object_inline_message_2515 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2515 - ? (JSCompiler_object_inline_message_2515 = + (JSCompiler_object_inline_stack_2558.return = workInProgress), + (JSCompiler_object_inline_stack_2558.sibling = + JSCompiler_object_inline_componentStack_2559), + (workInProgress.child = JSCompiler_object_inline_stack_2558), + (JSCompiler_object_inline_stack_2558 = + JSCompiler_object_inline_componentStack_2559), + (JSCompiler_object_inline_componentStack_2559 = workInProgress.child), + (JSCompiler_object_inline_message_2556 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2556 + ? (JSCompiler_object_inline_message_2556 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2515.cachePool), + JSCompiler_object_inline_message_2556.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9796,34 +9812,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2515 = { + (JSCompiler_object_inline_message_2556 = { baseLanes: - JSCompiler_object_inline_message_2515.baseLanes | renderLanes, + JSCompiler_object_inline_message_2556.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2518.memoizedState = - JSCompiler_object_inline_message_2515), + (JSCompiler_object_inline_componentStack_2559.memoizedState = + JSCompiler_object_inline_message_2556), enableTransitionTracing && - ((JSCompiler_object_inline_message_2515 = enableTransitionTracing + ((JSCompiler_object_inline_message_2556 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2515 && + null !== JSCompiler_object_inline_message_2556 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2518.updateQueue), + JSCompiler_object_inline_componentStack_2559.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = { - transitions: JSCompiler_object_inline_message_2515, + ? (JSCompiler_object_inline_componentStack_2559.updateQueue = { + transitions: JSCompiler_object_inline_message_2556, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2518.updateQueue = + ? (JSCompiler_object_inline_componentStack_2559.updateQueue = { - transitions: JSCompiler_object_inline_message_2515, + transitions: JSCompiler_object_inline_message_2556, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9831,32 +9847,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2515), + JSCompiler_object_inline_message_2556), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2518.childLanes = + (JSCompiler_object_inline_componentStack_2559.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2516, + JSCompiler_object_inline_digest_2557, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2517 + JSCompiler_object_inline_stack_2558 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2517.children + children: JSCompiler_object_inline_stack_2558.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2516 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2516 + ((JSCompiler_object_inline_digest_2557 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2557 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2516.push(current)); + : JSCompiler_object_inline_digest_2557.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11258,8 +11274,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -11271,8 +11287,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & ProfileMode) !== NoMode) { @@ -12803,6 +12819,7 @@ __DEV__ && (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -12914,10 +12931,7 @@ __DEV__ && nextEffect = firstChild.return; } } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return firstChild; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -13654,12 +13668,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -13794,7 +13802,9 @@ __DEV__ && if ( ((hoistableRoot = maybeNodes[i]), hoistableRoot.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && hoistableRoot.getAttribute("rel") === (null == current.rel ? null : current.rel) && hoistableRoot.getAttribute("title") === @@ -14554,6 +14564,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -15658,21 +15676,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - renderStartTime, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -15690,7 +15704,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -15752,18 +15766,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15786,16 +15806,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15891,8 +15909,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -16273,7 +16289,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$39) { handleThrow(root, thrownValue$39); @@ -16298,7 +16314,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -16524,205 +16540,342 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = DiscreteEventPriority; - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + inProgressLanes = lanes; + inProgressRoot = root; + commitMutationEffectsOnFiber(finishedWork, root); + inProgressRoot = inProgressLanes = null; + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + lanes = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = lanes.focusedElem, + priorSelectionRange = lanes.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min( + priorSelectionRange.start, + length + ), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16741,40 +16894,43 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -17343,7 +17499,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -17381,7 +17537,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -17670,11 +17826,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -17687,7 +17839,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -17822,23 +17973,6 @@ __DEV__ && } return component.stateNode; } - function updateContainerSync( - element, - container, - parentComponent, - callback - ) { - 0 === container.tag && flushPassiveEffects(); - updateContainerImpl( - container.current, - 2, - element, - container, - parentComponent, - callback - ); - return 2; - } function updateContainerImpl( rootFiber, lane, @@ -18360,100 +18494,6 @@ __DEV__ && "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -21197,36 +21237,34 @@ __DEV__ && } case "src": case "href": - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ? hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ) - : ("src" === value - ? error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : error$jscomp$0( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ), - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - )); + if ( + !( + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ) + ) { + "src" === value + ? error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : error$jscomp$0( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ); + continue; + } + hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ); continue; case "action": case "formAction": @@ -21745,11 +21783,6 @@ __DEV__ && event.initEvent(type, bubbles, !1); return event; } - function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); - } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } @@ -21858,7 +21891,9 @@ __DEV__ && else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null @@ -26650,10 +26685,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -26663,9 +26709,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -27487,11 +27530,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-a9bbe346-20241219" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-a160102f-20250107" !== 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.1.0-www-modern-a9bbe346-20241219\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-a160102f-20250107\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -27534,10 +27577,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -27610,7 +27653,7 @@ __DEV__ && error$jscomp$0( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync(null, args, null, null); + updateContainerImpl(args.current, 2, null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -28301,5 +28344,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 3e9edbcc59f8d..5f9f5b9bcdd7a 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -626,14 +626,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -643,29 +642,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2217,8 +2216,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -2253,7 +2251,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2265,6 +2265,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2316,7 +2319,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2367,13 +2371,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2387,14 +2394,17 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -6031,12 +6041,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6749,7 +6759,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7818,8 +7828,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$126 = completedWork.child; null !== child$126; ) (newChildLanes |= child$126.lanes | child$126.childLanes), - (subtreeFlags |= child$126.subtreeFlags & 31457280), - (subtreeFlags |= child$126.flags & 31457280), + (subtreeFlags |= child$126.subtreeFlags & 29360128), + (subtreeFlags |= child$126.flags & 29360128), (child$126.return = completedWork), (child$126 = child$126.sibling); else @@ -8797,7 +8807,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$203) { + } catch (e$202) { JSCompiler_temp = null; break a; } @@ -8848,6 +8858,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8979,10 +8990,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9695,7 +9703,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((currentResource = maybeNodes[i]), currentResource.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === @@ -10370,6 +10380,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -11215,10 +11233,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -11396,8 +11418,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11410,7 +11430,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11471,18 +11491,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11500,16 +11526,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11602,8 +11626,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11883,7 +11905,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$193) { handleThrow(root, thrownValue$193); @@ -11899,7 +11921,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -12078,164 +12100,290 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$197 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -12243,36 +12391,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$198 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$198, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -12516,7 +12667,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12535,7 +12686,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12765,11 +12916,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12782,7 +12929,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13495,19 +13641,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$354; + var JSCompiler_inline_result$jscomp$353; if (canUseDOM) { - var isSupported$jscomp$inline_1585 = "oninput" in document; - if (!isSupported$jscomp$inline_1585) { - var element$jscomp$inline_1586 = document.createElement("div"); - element$jscomp$inline_1586.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1585 = - "function" === typeof element$jscomp$inline_1586.oninput; + var isSupported$jscomp$inline_1596 = "oninput" in document; + if (!isSupported$jscomp$inline_1596) { + var element$jscomp$inline_1597 = document.createElement("div"); + element$jscomp$inline_1597.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1596 = + "function" === typeof element$jscomp$inline_1597.oninput; } - JSCompiler_inline_result$jscomp$354 = isSupported$jscomp$inline_1585; - } else JSCompiler_inline_result$jscomp$354 = !1; + JSCompiler_inline_result$jscomp$353 = isSupported$jscomp$inline_1596; + } else JSCompiler_inline_result$jscomp$353 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$354 && + JSCompiler_inline_result$jscomp$353 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13633,97 +13779,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -13918,20 +13973,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1626 = 0; - i$jscomp$inline_1626 < simpleEventPluginEvents.length; - i$jscomp$inline_1626++ + var i$jscomp$inline_1637 = 0; + i$jscomp$inline_1637 < simpleEventPluginEvents.length; + i$jscomp$inline_1637++ ) { - var eventName$jscomp$inline_1627 = - simpleEventPluginEvents[i$jscomp$inline_1626], - domEventName$jscomp$inline_1628 = - eventName$jscomp$inline_1627.toLowerCase(), - capitalizedEvent$jscomp$inline_1629 = - eventName$jscomp$inline_1627[0].toUpperCase() + - eventName$jscomp$inline_1627.slice(1); + var eventName$jscomp$inline_1638 = + simpleEventPluginEvents[i$jscomp$inline_1637], + domEventName$jscomp$inline_1639 = + eventName$jscomp$inline_1638.toLowerCase(), + capitalizedEvent$jscomp$inline_1640 = + eventName$jscomp$inline_1638[0].toUpperCase() + + eventName$jscomp$inline_1638.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1628, - "on" + capitalizedEvent$jscomp$inline_1629 + domEventName$jscomp$inline_1639, + "on" + capitalizedEvent$jscomp$inline_1640 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15224,34 +15279,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$217 = props[hasSrc]; - if (null != propValue$217) + var propValue$216 = props[hasSrc]; + if (null != propValue$216) switch (hasSrc) { case "name": - hasSrcSet = propValue$217; + hasSrcSet = propValue$216; break; case "type": - propValue = propValue$217; + propValue = propValue$216; break; case "checked": - checked = propValue$217; + checked = propValue$216; break; case "defaultChecked": - defaultChecked = propValue$217; + defaultChecked = propValue$216; break; case "value": - propKey = propValue$217; + propKey = propValue$216; break; case "defaultValue": - defaultValue = propValue$217; + defaultValue = propValue$216; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$217) + if (null != propValue$216) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$217, props, null); + setProp(domElement, tag, hasSrc, propValue$216, props, null); } } initInput( @@ -15388,14 +15443,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$217 in props) - props.hasOwnProperty(propValue$217) && - ((hasSrc = props[propValue$217]), + for (propValue$216 in props) + props.hasOwnProperty(propValue$216) && + ((hasSrc = props[propValue$216]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$217, + propValue$216, hasSrc, props, void 0 @@ -15443,14 +15498,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$234 in nextProps) { - var propKey = nextProps[propKey$234]; - lastProp = lastProps[propKey$234]; + for (var propKey$233 in nextProps) { + var propKey = nextProps[propKey$233]; + lastProp = lastProps[propKey$233]; if ( - nextProps.hasOwnProperty(propKey$234) && + nextProps.hasOwnProperty(propKey$233) && (null != propKey || null != lastProp) ) - switch (propKey$234) { + switch (propKey$233) { case "type": type = propKey; break; @@ -15479,7 +15534,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$234, + propKey$233, propKey, nextProps, lastProp @@ -15498,7 +15553,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$234 = null; + propKey = value = defaultValue = propKey$233 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15529,7 +15584,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$234 = type; + propKey$233 = type; break; case "defaultValue": defaultValue = type; @@ -15550,15 +15605,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$234 - ? updateOptions(domElement, !!lastProps, propKey$234, !1) + null != propKey$233 + ? updateOptions(domElement, !!lastProps, propKey$233, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$234 = null; + propKey = propKey$233 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15582,7 +15637,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$234 = name; + propKey$233 = name; break; case "defaultValue": propKey = name; @@ -15596,17 +15651,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$234, propKey); + updateTextarea(domElement, propKey$233, propKey); return; case "option": - for (var propKey$250 in lastProps) + for (var propKey$249 in lastProps) if ( - ((propKey$234 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$250)) + ((propKey$233 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$249)) ) - switch (propKey$250) { + switch (propKey$249) { case "selected": domElement.selected = !1; break; @@ -15614,33 +15669,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$250, + propKey$249, null, nextProps, - propKey$234 + propKey$233 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$234 = nextProps[lastDefaultValue]), + ((propKey$233 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$234 !== propKey && - (null != propKey$234 || null != propKey)) + propKey$233 !== propKey && + (null != propKey$233 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$234 && - "function" !== typeof propKey$234 && - "symbol" !== typeof propKey$234; + propKey$233 && + "function" !== typeof propKey$233 && + "symbol" !== typeof propKey$233; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$234, + propKey$233, nextProps, propKey ); @@ -15661,24 +15716,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$255 in lastProps) - (propKey$234 = lastProps[propKey$255]), - lastProps.hasOwnProperty(propKey$255) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$255) && - setProp(domElement, tag, propKey$255, null, nextProps, propKey$234); + for (var propKey$254 in lastProps) + (propKey$233 = lastProps[propKey$254]), + lastProps.hasOwnProperty(propKey$254) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$254) && + setProp(domElement, tag, propKey$254, null, nextProps, propKey$233); for (checked in nextProps) if ( - ((propKey$234 = nextProps[checked]), + ((propKey$233 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$234 !== propKey && - (null != propKey$234 || null != propKey)) + propKey$233 !== propKey && + (null != propKey$233 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$234) + if (null != propKey$233) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15686,7 +15741,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$234, + propKey$233, nextProps, propKey ); @@ -15694,49 +15749,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$260 in lastProps) - (propKey$234 = lastProps[propKey$260]), - lastProps.hasOwnProperty(propKey$260) && - void 0 !== propKey$234 && - !nextProps.hasOwnProperty(propKey$260) && + for (var propKey$259 in lastProps) + (propKey$233 = lastProps[propKey$259]), + lastProps.hasOwnProperty(propKey$259) && + void 0 !== propKey$233 && + !nextProps.hasOwnProperty(propKey$259) && setPropOnCustomElement( domElement, tag, - propKey$260, + propKey$259, void 0, nextProps, - propKey$234 + propKey$233 ); for (defaultChecked in nextProps) - (propKey$234 = nextProps[defaultChecked]), + (propKey$233 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$234 === propKey || - (void 0 === propKey$234 && void 0 === propKey) || + propKey$233 === propKey || + (void 0 === propKey$233 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$234, + propKey$233, nextProps, propKey ); return; } } - for (var propKey$265 in lastProps) - (propKey$234 = lastProps[propKey$265]), - lastProps.hasOwnProperty(propKey$265) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$265) && - setProp(domElement, tag, propKey$265, null, nextProps, propKey$234); + for (var propKey$264 in lastProps) + (propKey$233 = lastProps[propKey$264]), + lastProps.hasOwnProperty(propKey$264) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$264) && + setProp(domElement, tag, propKey$264, null, nextProps, propKey$233); for (lastProp in nextProps) - (propKey$234 = nextProps[lastProp]), + (propKey$233 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$234 === propKey || - (null == propKey$234 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$234, nextProps, propKey); + propKey$233 === propKey || + (null == propKey$233 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$233, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15832,11 +15887,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -15908,7 +15958,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -16390,26 +16442,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$273 = getResourcesFromRoot( + var styles$272 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$274 = styles$273.get(type); - resource$274 || + resource$273 = styles$272.get(type); + resource$273 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$274 = { + (resource$273 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$273.set(type, resource$274), - (styles$273 = JSCompiler_inline_result.querySelector( + styles$272.set(type, resource$273), + (styles$272 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$273._p && - ((resource$274.instance = styles$273), - (resource$274.state.loading = 5)), + !styles$272._p && + ((resource$273.instance = styles$272), + (resource$273.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16422,16 +16474,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$273 || + styles$272 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$274.state + resource$273.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$274; + return resource$273; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16528,37 +16580,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$279 = hoistableRoot.querySelector( + var instance$278 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$279) + if (instance$278) return ( (resource.state.loading |= 4), - (resource.instance = instance$279), - markNodeAsHoistable(instance$279), - instance$279 + (resource.instance = instance$278), + markNodeAsHoistable(instance$278), + instance$278 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$279 = ( + instance$278 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$279); - var linkInstance = instance$279; + markNodeAsHoistable(instance$278); + var linkInstance = instance$278; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$279, "link", instance); + setInitialProperties(instance$278, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$279, props.precedence, hoistableRoot); - return (resource.instance = instance$279); + insertStylesheet(instance$278, props.precedence, hoistableRoot); + return (resource.instance = instance$278); case "script": - instance$279 = getScriptKey(props.src); + instance$278 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$279) + getScriptSelectorFromKey(instance$278) )) ) return ( @@ -16567,7 +16619,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$279))) + if ((styleProps = preloadPropsMap.get(instance$278))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17571,16 +17623,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1799 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1810 = React.version; if ( - "19.1.0-www-classic-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1799 + "19.1.0-www-classic-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1810 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1799, - "19.1.0-www-classic-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1810, + "19.1.0-www-classic-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17596,24 +17648,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2341 = { +var internals$jscomp$inline_2350 = { bundleType: 0, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2342 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2351 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2342.isDisabled && - hook$jscomp$inline_2342.supportsFiber + !hook$jscomp$inline_2351.isDisabled && + hook$jscomp$inline_2351.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2342.inject( - internals$jscomp$inline_2341 + (rendererID = hook$jscomp$inline_2351.inject( + internals$jscomp$inline_2350 )), - (injectedHook = hook$jscomp$inline_2342); + (injectedHook = hook$jscomp$inline_2351); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17633,7 +17685,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -18117,4 +18168,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-a9bbe346-20241219"; +exports.version = "19.1.0-www-classic-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 1f56f2e61194b..1dcd3938305b9 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -561,14 +561,13 @@ function getHighestPriorityLanes(lanes) { return lanes; } } -function getNextLanes(root, wipLanes) { +function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -578,29 +577,29 @@ function getNextLanes(root, wipLanes) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2068,8 +2067,7 @@ function ensureRootIsScheduled(root) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -2104,7 +2102,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root$27, - root$27 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$27 === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root$27.cancelPendingCommit || + -1 !== root$27.timeoutHandle )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$27, JSCompiler_inline_result) || @@ -2116,6 +2116,9 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !1; } } +function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); +} function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -2167,7 +2170,8 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); pingedLanes = root.callbackNode; if ( @@ -2218,13 +2222,16 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2238,14 +2245,17 @@ function performWorkOnRootViaSchedulerTask(root, didTimeout) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } -function scheduleImmediateTask(cb) { +function scheduleImmediateRootScheduleTask() { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }); } function requestTransitionLane() { @@ -5882,12 +5892,12 @@ function markRef(current, workInProgress) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6523,7 +6533,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { children: nextProps.children })), (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128), null !== digest ? (showFallback = createWorkInProgress(digest, showFallback)) : ((showFallback = createFiberFromFragment( @@ -7588,8 +7598,8 @@ function bubbleProperties(completedWork) { if (didBailout) for (var child$126 = completedWork.child; null !== child$126; ) (newChildLanes |= child$126.lanes | child$126.childLanes), - (subtreeFlags |= child$126.subtreeFlags & 31457280), - (subtreeFlags |= child$126.flags & 31457280), + (subtreeFlags |= child$126.subtreeFlags & 29360128), + (subtreeFlags |= child$126.flags & 29360128), (child$126.return = completedWork), (child$126 = child$126.sibling); else @@ -8548,7 +8558,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$203) { + } catch (e$202) { JSCompiler_temp = null; break a; } @@ -8599,6 +8609,7 @@ function commitBeforeMutationEffects(root, firstChild) { (root = getClosestInstanceFromNode(JSCompiler_temp)); _enabled = !1; focusedInstanceHandle = root; + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { firstChild = nextEffect; root = firstChild.deletions; @@ -8730,10 +8741,7 @@ function commitBeforeMutationEffects(root, firstChild) { nextEffect = firstChild.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9446,7 +9454,9 @@ function commitMutationEffectsOnFiber(finishedWork, root) { if ( ((currentResource = maybeNodes[i]), currentResource.getAttribute("href") === - (null == current.href ? null : current.href) && + (null == current.href || "" === current.href + ? null + : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === @@ -10121,6 +10131,14 @@ function commitPassiveMountOnFiber( ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10966,10 +10984,14 @@ function addTransitionProgressCallbackToPendingTransition( )); } var legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane() { @@ -11147,8 +11169,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -11161,7 +11181,7 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -11222,18 +11242,24 @@ function commitRootWhenReady( completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = -1; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11251,16 +11277,14 @@ function commitRootWhenReady( } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11353,8 +11377,6 @@ function resetWorkInProgressStack() { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11634,7 +11656,7 @@ function renderRootConcurrent(root, lanes) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$193) { handleThrow(root, thrownValue$193); @@ -11650,7 +11672,7 @@ function renderRootConcurrent(root, lanes) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } -function workLoopConcurrent() { +function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -11825,164 +11847,290 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = Internals.p; - try { - (Internals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - (Internals.p = previousUpdateLanePriority); - } -} -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = Internals.p; - Internals.p = 2; - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$197 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$197 && - ((_enabled = !0), - dispatchAfterDetachedBlur(selectionInformation.focusedElem), - (_enabled = !1)); - restoreSelection(selectionInformation, root.containerInfo); - _enabled = !!eventsEnabled; - selectionInformation = eventsEnabled = null; + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = Internals.p; + Internals.p = 2; + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (Internals.p = recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } +} +function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root); + if (shouldFireAfterActiveInstanceBlur) { + _enabled = !0; + var target = selectionInformation.focusedElem, + event = createEvent("afterblur", !1); + event.relatedTarget = target; + document.dispatchEvent(event); + _enabled = !1; + } + target = selectionInformation; + var curFocusedElem = getActiveElementDeep(root.containerInfo), + priorFocusedElem = target.focusedElem, + priorSelectionRange = target.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win = (doc && doc.defaultView) || window; + if (win.getSelection) { + var selection = win.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection.rangeCount || + selection.anchorNode !== startMarker.node || + selection.anchorOffset !== startMarker.offset || + selection.focusNode !== endMarker.node || + selection.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection.addRange(range), + selection.extend(endMarker.node, endMarker.offset)) + : (range.setEnd(endMarker.node, endMarker.offset), + selection.addRange(range)); + } + } + } + } + doc = []; + for ( + selection = priorFocusedElem; + (selection = selection.parentNode); + + ) + 1 === selection.nodeType && + doc.push({ + element: selection, + left: selection.scrollLeft, + top: selection.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } +} +function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = Internals.p; + Internals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + (Internals.p = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - Internals.p = updatedLanes; - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = Internals.p; + Internals.p = 2; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + (Internals.p = rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -11990,36 +12138,39 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } +function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); +} function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root$198 = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - prevTransition = ReactSharedInternals.T, - previousPriority = Internals.p; - try { - return ( - (Internals.p = 32 > renderPriority ? 32 : renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - (Internals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$198, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + prevTransition = ReactSharedInternals.T, + previousPriority = Internals.p; + try { + return ( + (Internals.p = 32 > renderPriority ? 32 : renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + (Internals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -12263,7 +12414,7 @@ function createWorkInProgress(current, pendingProps) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12282,7 +12433,7 @@ function createWorkInProgress(current, pendingProps) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12512,11 +12663,7 @@ function FiberRootNode( ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12529,7 +12676,6 @@ function FiberRootNode( this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -13231,19 +13377,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$357; + var JSCompiler_inline_result$jscomp$356; if (canUseDOM) { - var isSupported$jscomp$inline_1575 = "oninput" in document; - if (!isSupported$jscomp$inline_1575) { - var element$jscomp$inline_1576 = document.createElement("div"); - element$jscomp$inline_1576.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1575 = - "function" === typeof element$jscomp$inline_1576.oninput; + var isSupported$jscomp$inline_1586 = "oninput" in document; + if (!isSupported$jscomp$inline_1586) { + var element$jscomp$inline_1587 = document.createElement("div"); + element$jscomp$inline_1587.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1586 = + "function" === typeof element$jscomp$inline_1587.oninput; } - JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1575; - } else JSCompiler_inline_result$jscomp$357 = !1; + JSCompiler_inline_result$jscomp$356 = isSupported$jscomp$inline_1586; + } else JSCompiler_inline_result$jscomp$356 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$357 && + JSCompiler_inline_result$jscomp$356 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -13369,97 +13515,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - 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); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (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 - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -13654,20 +13709,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1616 = 0; - i$jscomp$inline_1616 < simpleEventPluginEvents.length; - i$jscomp$inline_1616++ + var i$jscomp$inline_1627 = 0; + i$jscomp$inline_1627 < simpleEventPluginEvents.length; + i$jscomp$inline_1627++ ) { - var eventName$jscomp$inline_1617 = - simpleEventPluginEvents[i$jscomp$inline_1616], - domEventName$jscomp$inline_1618 = - eventName$jscomp$inline_1617.toLowerCase(), - capitalizedEvent$jscomp$inline_1619 = - eventName$jscomp$inline_1617[0].toUpperCase() + - eventName$jscomp$inline_1617.slice(1); + var eventName$jscomp$inline_1628 = + simpleEventPluginEvents[i$jscomp$inline_1627], + domEventName$jscomp$inline_1629 = + eventName$jscomp$inline_1628.toLowerCase(), + capitalizedEvent$jscomp$inline_1630 = + eventName$jscomp$inline_1628[0].toUpperCase() + + eventName$jscomp$inline_1628.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1618, - "on" + capitalizedEvent$jscomp$inline_1619 + domEventName$jscomp$inline_1629, + "on" + capitalizedEvent$jscomp$inline_1630 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14956,34 +15011,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$217 = props[hasSrc]; - if (null != propValue$217) + var propValue$216 = props[hasSrc]; + if (null != propValue$216) switch (hasSrc) { case "name": - hasSrcSet = propValue$217; + hasSrcSet = propValue$216; break; case "type": - propKey = propValue$217; + propKey = propValue$216; break; case "checked": - checked = propValue$217; + checked = propValue$216; break; case "defaultChecked": - defaultChecked = propValue$217; + defaultChecked = propValue$216; break; case "value": - propValue = propValue$217; + propValue = propValue$216; break; case "defaultValue": - defaultValue = propValue$217; + defaultValue = propValue$216; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$217) + if (null != propValue$216) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$217, props, null); + setProp(domElement, tag, hasSrc, propValue$216, props, null); } } initInput( @@ -15119,14 +15174,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$217 in props) - props.hasOwnProperty(propValue$217) && - ((hasSrc = props[propValue$217]), + for (propValue$216 in props) + props.hasOwnProperty(propValue$216) && + ((hasSrc = props[propValue$216]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$217, + propValue$216, hasSrc, props, void 0 @@ -15174,14 +15229,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$234 in nextProps) { - var propKey = nextProps[propKey$234]; - lastProp = lastProps[propKey$234]; + for (var propKey$233 in nextProps) { + var propKey = nextProps[propKey$233]; + lastProp = lastProps[propKey$233]; if ( - nextProps.hasOwnProperty(propKey$234) && + nextProps.hasOwnProperty(propKey$233) && (null != propKey || null != lastProp) ) - switch (propKey$234) { + switch (propKey$233) { case "type": type = propKey; break; @@ -15210,7 +15265,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$234, + propKey$233, propKey, nextProps, lastProp @@ -15229,7 +15284,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$234 = null; + propKey = value = defaultValue = propKey$233 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -15260,7 +15315,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$234 = type; + propKey$233 = type; break; case "defaultValue": defaultValue = type; @@ -15281,15 +15336,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$234 - ? updateOptions(domElement, !!lastProps, propKey$234, !1) + null != propKey$233 + ? updateOptions(domElement, !!lastProps, propKey$233, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$234 = null; + propKey = propKey$233 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -15313,7 +15368,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$234 = name; + propKey$233 = name; break; case "defaultValue": propKey = name; @@ -15327,17 +15382,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$234, propKey); + updateTextarea(domElement, propKey$233, propKey); return; case "option": - for (var propKey$250 in lastProps) + for (var propKey$249 in lastProps) if ( - ((propKey$234 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$250)) + ((propKey$233 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$249)) ) - switch (propKey$250) { + switch (propKey$249) { case "selected": domElement.selected = !1; break; @@ -15345,33 +15400,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$250, + propKey$249, null, nextProps, - propKey$234 + propKey$233 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$234 = nextProps[lastDefaultValue]), + ((propKey$233 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$234 !== propKey && - (null != propKey$234 || null != propKey)) + propKey$233 !== propKey && + (null != propKey$233 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$234 && - "function" !== typeof propKey$234 && - "symbol" !== typeof propKey$234; + propKey$233 && + "function" !== typeof propKey$233 && + "symbol" !== typeof propKey$233; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$234, + propKey$233, nextProps, propKey ); @@ -15392,24 +15447,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$255 in lastProps) - (propKey$234 = lastProps[propKey$255]), - lastProps.hasOwnProperty(propKey$255) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$255) && - setProp(domElement, tag, propKey$255, null, nextProps, propKey$234); + for (var propKey$254 in lastProps) + (propKey$233 = lastProps[propKey$254]), + lastProps.hasOwnProperty(propKey$254) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$254) && + setProp(domElement, tag, propKey$254, null, nextProps, propKey$233); for (checked in nextProps) if ( - ((propKey$234 = nextProps[checked]), + ((propKey$233 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$234 !== propKey && - (null != propKey$234 || null != propKey)) + propKey$233 !== propKey && + (null != propKey$233 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$234) + if (null != propKey$233) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -15417,7 +15472,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$234, + propKey$233, nextProps, propKey ); @@ -15425,49 +15480,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$260 in lastProps) - (propKey$234 = lastProps[propKey$260]), - lastProps.hasOwnProperty(propKey$260) && - void 0 !== propKey$234 && - !nextProps.hasOwnProperty(propKey$260) && + for (var propKey$259 in lastProps) + (propKey$233 = lastProps[propKey$259]), + lastProps.hasOwnProperty(propKey$259) && + void 0 !== propKey$233 && + !nextProps.hasOwnProperty(propKey$259) && setPropOnCustomElement( domElement, tag, - propKey$260, + propKey$259, void 0, nextProps, - propKey$234 + propKey$233 ); for (defaultChecked in nextProps) - (propKey$234 = nextProps[defaultChecked]), + (propKey$233 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$234 === propKey || - (void 0 === propKey$234 && void 0 === propKey) || + propKey$233 === propKey || + (void 0 === propKey$233 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$234, + propKey$233, nextProps, propKey ); return; } } - for (var propKey$265 in lastProps) - (propKey$234 = lastProps[propKey$265]), - lastProps.hasOwnProperty(propKey$265) && - null != propKey$234 && - !nextProps.hasOwnProperty(propKey$265) && - setProp(domElement, tag, propKey$265, null, nextProps, propKey$234); + for (var propKey$264 in lastProps) + (propKey$233 = lastProps[propKey$264]), + lastProps.hasOwnProperty(propKey$264) && + null != propKey$233 && + !nextProps.hasOwnProperty(propKey$264) && + setProp(domElement, tag, propKey$264, null, nextProps, propKey$233); for (lastProp in nextProps) - (propKey$234 = nextProps[lastProp]), + (propKey$233 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$234 === propKey || - (null == propKey$234 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$234, nextProps, propKey); + propKey$233 === propKey || + (null == propKey$233 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$233, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15563,11 +15618,6 @@ function createEvent(type, bubbles) { event.initEvent(type, bubbles, !1); return event; } -function dispatchAfterDetachedBlur(target) { - var event = createEvent("afterblur", !1); - event.relatedTarget = target; - document.dispatchEvent(event); -} function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance, depth = 0; @@ -15639,7 +15689,9 @@ function canHydrateInstance(instance, type, props, inRootOrSingleton) { else if ( name !== anyProps.rel || instance.getAttribute("href") !== - (null == anyProps.href ? null : anyProps.href) || + (null == anyProps.href || "" === anyProps.href + ? null + : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== @@ -16121,26 +16173,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$273 = getResourcesFromRoot( + var styles$272 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$274 = styles$273.get(type); - resource$274 || + resource$273 = styles$272.get(type); + resource$273 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$274 = { + (resource$273 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$273.set(type, resource$274), - (styles$273 = JSCompiler_inline_result.querySelector( + styles$272.set(type, resource$273), + (styles$272 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$273._p && - ((resource$274.instance = styles$273), - (resource$274.state.loading = 5)), + !styles$272._p && + ((resource$273.instance = styles$272), + (resource$273.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -16153,16 +16205,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$273 || + styles$272 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$274.state + resource$273.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$274; + return resource$273; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -16259,37 +16311,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$279 = hoistableRoot.querySelector( + var instance$278 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$279) + if (instance$278) return ( (resource.state.loading |= 4), - (resource.instance = instance$279), - markNodeAsHoistable(instance$279), - instance$279 + (resource.instance = instance$278), + markNodeAsHoistable(instance$278), + instance$278 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$279 = ( + instance$278 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$279); - var linkInstance = instance$279; + markNodeAsHoistable(instance$278); + var linkInstance = instance$278; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$279, "link", instance); + setInitialProperties(instance$278, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$279, props.precedence, hoistableRoot); - return (resource.instance = instance$279); + insertStylesheet(instance$278, props.precedence, hoistableRoot); + return (resource.instance = instance$278); case "script": - instance$279 = getScriptKey(props.src); + instance$278 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$279) + getScriptSelectorFromKey(instance$278) )) ) return ( @@ -16298,7 +16350,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$279))) + if ((styleProps = preloadPropsMap.get(instance$278))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -17302,16 +17354,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1789 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1800 = React.version; if ( - "19.1.0-www-modern-a9bbe346-20241219" !== - isomorphicReactPackageVersion$jscomp$inline_1789 + "19.1.0-www-modern-a160102f-20250107" !== + isomorphicReactPackageVersion$jscomp$inline_1800 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1789, - "19.1.0-www-modern-a9bbe346-20241219" + isomorphicReactPackageVersion$jscomp$inline_1800, + "19.1.0-www-modern-a160102f-20250107" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -17327,24 +17379,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2323 = { +var internals$jscomp$inline_2332 = { bundleType: 0, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2324 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2333 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2324.isDisabled && - hook$jscomp$inline_2324.supportsFiber + !hook$jscomp$inline_2333.isDisabled && + hook$jscomp$inline_2333.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2324.inject( - internals$jscomp$inline_2323 + (rendererID = hook$jscomp$inline_2333.inject( + internals$jscomp$inline_2332 )), - (injectedHook = hook$jscomp$inline_2324); + (injectedHook = hook$jscomp$inline_2333); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -17364,7 +17416,6 @@ ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = if (null !== root) { this._internalRoot = null; var container = root.containerInfo; - 0 === root.tag && flushPassiveEffects(); updateContainerImpl(root.current, 2, null, root, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; @@ -17848,4 +17899,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-a9bbe346-20241219"; +exports.version = "19.1.0-www-modern-a160102f-20250107"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index 9ee7a630abc38..bfdceea1c0308 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -80,7 +80,7 @@ __DEV__ && if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -998,14 +998,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -1015,29 +1014,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2465,11 +2465,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2503,7 +2501,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2515,6 +2515,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2569,7 +2572,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -2627,14 +2631,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2649,7 +2661,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -2659,19 +2671,25 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); supportsMicrotasks ? scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }) - : scheduleCallback$3(ImmediatePriority, cb); + : scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -3473,7 +3491,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -7002,14 +7020,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -8096,7 +8114,7 @@ __DEV__ && children: nextProps.children }); nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128; null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -9784,8 +9802,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -9797,8 +9815,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & 2) !== NoMode) { @@ -11238,6 +11256,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -11332,10 +11351,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -12086,12 +12102,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12917,6 +12927,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -13991,21 +14009,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -14023,7 +14037,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -14085,18 +14099,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -14119,16 +14139,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14224,8 +14242,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -14612,7 +14628,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$41) { handleThrow(root, thrownValue$41); @@ -14637,7 +14653,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -14867,200 +14883,236 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); - setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + setCurrentUpdatePriority(recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -15079,37 +15131,40 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = getCurrentUpdatePriority(); - try { - return ( - setCurrentUpdatePriority(renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - setCurrentUpdatePriority(previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = getCurrentUpdatePriority(); + try { + return ( + setCurrentUpdatePriority(renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -15677,7 +15732,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -15715,7 +15770,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -16021,11 +16076,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -16038,7 +16089,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -16163,7 +16213,6 @@ __DEV__ && parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, 2, @@ -18472,10 +18521,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -18485,9 +18545,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -18954,7 +19011,7 @@ __DEV__ && } return getPublicInstance(component.stateNode); }; - exports.flushPassiveEffects = flushPassiveEffects; + exports.flushPassiveEffects = flushPendingEffects; exports.flushSyncFromReconciler = function (fn) { var prevExecutionContext = executionContext; executionContext |= 1; @@ -19049,7 +19106,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index 3ef06f503910f..bcd402d95e25c 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -80,7 +80,7 @@ __DEV__ && if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -904,14 +904,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -921,29 +920,30 @@ __DEV__ && 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -2371,11 +2371,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now$1()); } @@ -2409,7 +2407,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -2421,6 +2421,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2475,7 +2478,8 @@ __DEV__ && suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -2533,14 +2537,22 @@ __DEV__ && } function performWorkOnRootViaSchedulerTask(root, didTimeout) { nestedUpdateScheduled = currentUpdateIsNested = !1; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2555,7 +2567,7 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); @@ -2565,19 +2577,25 @@ __DEV__ && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); supportsMicrotasks ? scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }) - : scheduleCallback$3(ImmediatePriority, cb); + : scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -3379,7 +3397,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -6908,14 +6926,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -7927,7 +7945,7 @@ __DEV__ && children: nextProps.children }); nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + JSCompiler_temp$jscomp$0.subtreeFlags & 29360128; null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -9616,8 +9634,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -9629,8 +9647,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if ((completedWork.mode & 2) !== NoMode) { @@ -11056,6 +11074,7 @@ __DEV__ && } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -11150,10 +11169,7 @@ __DEV__ && nextEffect = root.return; } } - root = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return root; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -11904,12 +11920,6 @@ __DEV__ && } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12735,6 +12745,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -13809,21 +13827,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -13841,7 +13855,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -13903,18 +13917,24 @@ __DEV__ && completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -13937,16 +13957,14 @@ __DEV__ && } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14042,8 +14060,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -14430,7 +14446,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$41) { handleThrow(root, thrownValue$41); @@ -14455,7 +14471,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -14681,200 +14697,236 @@ __DEV__ && } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); ReactStrictModeWarnings.flushLegacyContextWarning(); ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; enableSchedulingProfiler && enableSchedulingProfiler && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markCommitStarted && injectedProfilingHooks.markCommitStarted(lanes); if (null === finishedWork) - return enableSchedulingProfiler && markCommitStopped(), null; - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - commitStartTime = now(); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); - setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; - executionContext |= CommitContext; - var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects( + enableSchedulingProfiler && markCommitStopped(); + else { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffects(root, finishedWork, lanes); - shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + setCurrentUpdatePriority(recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + (inProgressLanes = lanes), + (inProgressRoot = root), + commitMutationEffectsOnFiber(finishedWork, root), + (inProgressRoot = inProgressLanes = null), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes); - commitLayoutEffects(finishedWork, root, lanes); - enableSchedulingProfiler && - enableSchedulingProfiler && - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(); + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes), + commitLayoutEffects(finishedWork, root, lanes), + enableSchedulingProfiler && + enableSchedulingProfiler && + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - (transitions = spawnedLane) - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), - runWithFiberInDEV( - remainingLanes.source, - renderPriorityLevel, - remainingLanes.value, - spawnedLane - ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - enableSchedulingProfiler && markCommitStopped(); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot$1(finishedWork.stateNode, rootHasLayoutEffect); + isDevToolsPresent && root.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (previousPriority & 42)) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + enableSchedulingProfiler && markCommitStopped(); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); + }); + } } - return null; } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -14893,37 +14945,40 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = getCurrentUpdatePriority(); - try { - return ( - setCurrentUpdatePriority(renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - setCurrentUpdatePriority(previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = getCurrentUpdatePriority(); + try { + return ( + setCurrentUpdatePriority(renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Cannot flush passive effects while already rendering."); isFlushingPassiveEffects = !0; @@ -15491,7 +15546,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -15529,7 +15584,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -15835,11 +15890,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -15852,7 +15903,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -15944,7 +15994,6 @@ __DEV__ && parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, 2, @@ -18246,10 +18295,21 @@ __DEV__ && currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -18259,9 +18319,6 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - SUSPENDED_COMMIT = 1, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -18728,7 +18785,7 @@ __DEV__ && } return getPublicInstance(component.stateNode); }; - exports.flushPassiveEffects = flushPassiveEffects; + exports.flushPassiveEffects = flushPendingEffects; exports.flushSyncFromReconciler = function (fn) { var prevExecutionContext = executionContext; executionContext |= 1; @@ -18823,7 +18880,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index 15543c967c04a..acb1855223b18 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -615,14 +615,13 @@ module.exports = function ($$$config) { return lanes; } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -632,29 +631,29 @@ module.exports = function ($$$config) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1276,8 +1275,7 @@ module.exports = function ($$$config) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -1312,7 +1310,9 @@ module.exports = function ($$$config) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1324,6 +1324,9 @@ module.exports = function ($$$config) { isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -1375,7 +1378,8 @@ module.exports = function ($$$config) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -1428,13 +1432,16 @@ module.exports = function ($$$config) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -1449,17 +1456,23 @@ module.exports = function ($$$config) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { supportsMicrotasks ? scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }) - : scheduleCallback$3(ImmediatePriority, cb); + : scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -4665,12 +4678,12 @@ module.exports = function ($$$config) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -5376,7 +5389,7 @@ module.exports = function ($$$config) { mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 29360128; null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -6701,8 +6714,8 @@ module.exports = function ($$$config) { if (didBailout) for (var child$109 = completedWork.child; null !== child$109; ) (newChildLanes |= child$109.lanes | child$109.childLanes), - (subtreeFlags |= child$109.subtreeFlags & 31457280), - (subtreeFlags |= child$109.flags & 31457280), + (subtreeFlags |= child$109.subtreeFlags & 29360128), + (subtreeFlags |= child$109.flags & 29360128), (child$109.return = completedWork), (child$109 = child$109.sibling); else @@ -7649,6 +7662,7 @@ module.exports = function ($$$config) { } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7753,10 +7767,7 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -9103,6 +9114,14 @@ module.exports = function ($$$config) { ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -10060,8 +10079,6 @@ module.exports = function ($$$config) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -10074,7 +10091,7 @@ module.exports = function ($$$config) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10135,18 +10152,24 @@ module.exports = function ($$$config) { completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -10164,16 +10187,14 @@ module.exports = function ($$$config) { } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10266,8 +10287,6 @@ module.exports = function ($$$config) { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -10553,7 +10572,7 @@ module.exports = function ($$$config) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$176) { handleThrow(root, thrownValue$176); @@ -10569,7 +10588,7 @@ module.exports = function ($$$config) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -10760,160 +10779,188 @@ module.exports = function ($$$config) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); - setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$180 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$180 && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + setCurrentUpdatePriority(recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } + } + function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -10921,37 +10968,40 @@ module.exports = function ($$$config) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = getCurrentUpdatePriority(); - try { - return ( - setCurrentUpdatePriority(renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - setCurrentUpdatePriority(previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = getCurrentUpdatePriority(); + try { + return ( + setCurrentUpdatePriority(renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -11195,7 +11245,7 @@ module.exports = function ($$$config) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -11217,7 +11267,7 @@ module.exports = function ($$$config) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -11467,11 +11517,7 @@ module.exports = function ($$$config) { ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -11484,7 +11530,6 @@ module.exports = function ($$$config) { this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12448,10 +12493,14 @@ module.exports = function ($$$config) { currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null, createFiber = enableObjectFiber @@ -12713,7 +12762,7 @@ module.exports = function ($$$config) { exports.findHostInstanceWithWarning = function (component) { return findHostInstance(component); }; - exports.flushPassiveEffects = flushPassiveEffects; + exports.flushPassiveEffects = flushPendingEffects; exports.flushSyncFromReconciler = function (fn) { var prevExecutionContext = executionContext; executionContext |= 1; @@ -12805,7 +12854,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); @@ -12823,7 +12872,7 @@ module.exports = function ($$$config) { return internals; }; exports.isAlreadyRendering = function () { - return !1; + return 0 !== (executionContext & 6); }; exports.observeVisibleRects = function ( hostRoot, @@ -12902,7 +12951,6 @@ module.exports = function ($$$config) { parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, 2, diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index 4a517a45e497d..44e99202ceca3 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -481,14 +481,13 @@ module.exports = function ($$$config) { return lanes; } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -498,29 +497,29 @@ module.exports = function ($$$config) { 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + !rootHasPendingCommit && + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) : enableSiblingPrerendering && - !root && - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + !rootHasPendingCommit && + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -1142,8 +1141,7 @@ module.exports = function ($$$config) { : (lastScheduledRoot = lastScheduledRoot.next = root)); mightHavePendingSyncWork = !0; didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); enableDeferRootSchedulingToMicrotask || scheduleTaskForRootDuringMicrotask(root, now()); } @@ -1178,7 +1176,9 @@ module.exports = function ($$$config) { (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( root, - root === workInProgressRoot ? JSCompiler_inline_result : 0 + root === workInProgressRoot ? JSCompiler_inline_result : 0, + null !== root.cancelPendingCommit || + root.timeoutHandle !== noTimeout )), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root, JSCompiler_inline_result) || @@ -1190,6 +1190,9 @@ module.exports = function ($$$config) { isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask = !1; var syncTransitionLanes = 0; @@ -1241,7 +1244,8 @@ module.exports = function ($$$config) { suspendedLanes = workInProgressRootRenderLanes; suspendedLanes = getNextLanes( root, - root === currentTime ? suspendedLanes : 0 + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); pingedLanes = root.callbackNode; if ( @@ -1294,13 +1298,16 @@ module.exports = function ($$$config) { return 2; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { + if (0 !== pendingEffectsStatus && 3 !== pendingEffectsStatus) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0, + null !== root.cancelPendingCommit || root.timeoutHandle !== noTimeout ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -1315,17 +1322,23 @@ module.exports = function ($$$config) { : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; performWorkOnRoot(root, lanes, !0); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { supportsMicrotasks ? scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) - : cb(); + ? scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ) + : processRootScheduleInMicrotask(); }) - : scheduleCallback$3(ImmediatePriority, cb); + : scheduleCallback$3( + ImmediatePriority, + processRootScheduleInImmediateTask + ); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -4531,12 +4544,12 @@ module.exports = function ($$$config) { if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error(formatProdErrorMessage(284)); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -5158,7 +5171,7 @@ module.exports = function ($$$config) { mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 31457280; + nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 29360128; null !== didSuspend ? (showFallback = createWorkInProgress(didSuspend, showFallback)) : ((showFallback = createFiberFromFragment( @@ -6482,8 +6495,8 @@ module.exports = function ($$$config) { if (didBailout) for (var child$109 = completedWork.child; null !== child$109; ) (newChildLanes |= child$109.lanes | child$109.childLanes), - (subtreeFlags |= child$109.subtreeFlags & 31457280), - (subtreeFlags |= child$109.flags & 31457280), + (subtreeFlags |= child$109.subtreeFlags & 29360128), + (subtreeFlags |= child$109.flags & 29360128), (child$109.return = completedWork), (child$109 = child$109.sibling); else @@ -7411,6 +7424,7 @@ module.exports = function ($$$config) { } function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); + shouldFireAfterActiveInstanceBlur = !1; for (nextEffect = firstChild; null !== nextEffect; ) { root = nextEffect; firstChild = root.deletions; @@ -7515,10 +7529,7 @@ module.exports = function ($$$config) { nextEffect = root.return; } } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; focusedInstanceHandle = null; - return resolvedPrevProps; } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; @@ -8865,6 +8876,14 @@ module.exports = function ($$$config) { ); flags & 2048 && commitHookEffectListMount(9, finishedWork); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: recursivelyTraversePassiveMountEffects( finishedRoot, @@ -9822,8 +9841,6 @@ module.exports = function ($$$config) { default: throw Error(formatProdErrorMessage(329)); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if ( (lanes & 62914560) === lanes && (alwaysThrottleRetries || 3 === renderWasConcurrent) && @@ -9836,7 +9853,7 @@ module.exports = function ($$$config) { workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -9897,18 +9914,24 @@ module.exports = function ($$$config) { completedRenderStartTime, completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + root.timeoutHandle = noTimeout; + suspendedCommitReason = finishedWork.subtreeFlags; + if ( + suspendedCommitReason & 8192 || + 16785408 === (suspendedCommitReason & 16785408) + ) if ( (startSuspendingCommit(), accumulateSuspenseyCommitOnFiber(finishedWork), - (finishedWork = waitForCommitToBeReady()), - null !== finishedWork) + (suspendedCommitReason = waitForCommitToBeReady()), + null !== suspendedCommitReason) ) { - root.cancelPendingCommit = finishedWork( + root.cancelPendingCommit = suspendedCommitReason( commitRoot.bind( null, root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -9926,16 +9949,14 @@ module.exports = function ($$$config) { } commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10028,8 +10049,6 @@ module.exports = function ($$$config) { } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; timeoutHandle !== noTimeout && ((root.timeoutHandle = noTimeout), cancelTimeout(timeoutHandle)); @@ -10315,7 +10334,7 @@ module.exports = function ($$$config) { throw Error(formatProdErrorMessage(462)); } } - workLoopConcurrent(); + workLoopConcurrentByScheduler(); break; } catch (thrownValue$176) { handleThrow(root, thrownValue$176); @@ -10331,7 +10350,7 @@ module.exports = function ($$$config) { finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -10518,160 +10537,188 @@ module.exports = function ($$$config) { } function commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = getCurrentUpdatePriority(); - try { - setCurrentUpdatePriority(2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); - } finally { - (ReactSharedInternals.T = prevTransition), - setCurrentUpdatePriority(previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, suspendedRetryLanes ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (0 !== pendingEffectsStatus); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - didIncludeCommitPhaseUpdate = !1; - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - (root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null), - scheduleCallback(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })) - : ((root.callbackNode = null), - (root.callbackPriority = 0), - (root.cancelPendingCommit = null)); - transitions = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { - transitions = ReactSharedInternals.T; - ReactSharedInternals.T = null; - updatedLanes = getCurrentUpdatePriority(); - setCurrentUpdatePriority(2); - suspendedRetryLanes = executionContext; - executionContext |= 4; - var shouldFireAfterActiveInstanceBlur$180 = commitBeforeMutationEffects( + if (null !== finishedWork) { + if (finishedWork === root.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + remainingLanes |= concurrentlyUpdatedLanes; + markRootFinished( root, - finishedWork + lanes, + remainingLanes, + spawnedLane, + updatedLanes, + suspendedRetryLanes ); - commitMutationEffectsOnFiber(finishedWork, root); - shouldFireAfterActiveInstanceBlur$180 && afterActiveInstanceBlur(); - resetAfterCommit(root.containerInfo); + didIncludeCommitPhaseUpdate = !1; + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = remainingLanes; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + pendingDidIncludeRenderPhaseUpdate = didIncludeRenderPhaseUpdate; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + transitions = executionContext; + executionContext |= 4; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + setCurrentUpdatePriority(recoverableErrors), + (ReactSharedInternals.T = lanes); + } + } + pendingEffectsStatus = 1; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (1 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitMutationEffectsOnFiber(finishedWork, root), + shouldFireAfterActiveInstanceBlur && afterActiveInstanceBlur(), + resetAfterCommit(root.containerInfo); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } root.current = finishedWork; - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + pendingEffectsStatus = 2; + } + } + function flushLayoutEffects() { + if (2 === pendingEffectsStatus) { + pendingEffectsStatus = 0; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + didIncludeRenderPhaseUpdate = pendingDidIncludeRenderPhaseUpdate, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + var prevExecutionContext = executionContext; + executionContext |= 4; + try { + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + } finally { + (executionContext = prevExecutionContext), + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } requestPaint(); - executionContext = suspendedRetryLanes; - setCurrentUpdatePriority(updatedLanes); - ReactSharedInternals.T = transitions; - } else root.current = finishedWork; - spawnedLane - ? ((spawnedLane = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? (pendingEffectsStatus = 3) + : ((pendingEffectsStatus = 0), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes)); + rootHasLayoutEffect = root.pendingLanes; + 0 === rootHasLayoutEffect && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect = lanesToEventPriority(lanes); + onCommitRoot(finishedWork.stateNode, rootHasLayoutEffect); + if (null !== recoverableErrors) { + finishedWork = ReactSharedInternals.T; + rootHasLayoutEffect = getCurrentUpdatePriority(); + setCurrentUpdatePriority(2); + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; + for ( + previousPriority = 0; + previousPriority < recoverableErrors.length; + previousPriority++ + ) { + var recoverableError = recoverableErrors[previousPriority]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } finally { + (ReactSharedInternals.T = finishedWork), + setCurrentUpdatePriority(rootHasLayoutEffect); + } + } + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + rootHasLayoutEffect = root.pendingLanes; + (enableInfiniteRenderLoopDetection && + (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || + (0 !== (lanes & 4194218) && 0 !== (rootHasLayoutEffect & 42)) + ? root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + if (enableTransitionTracing) { + var prevRootTransitionCallbacks = root.transitionCallbacks; + null !== prevRootTransitionCallbacks && + schedulePostPaintCallback(function (endTime) { + var prevPendingTransitionCallbacks = + currentPendingTransitionCallbacks; + null !== prevPendingTransitionCallbacks + ? ((currentPendingTransitionCallbacks = null), + scheduleCallback(IdlePriority, function () { + processTransitionCallbacks( + prevPendingTransitionCallbacks, + endTime, + prevRootTransitionCallbacks + ); + })) + : (currentEndTime = endTime); }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root); - remainingLanes = root.pendingLanes; - (enableInfiniteRenderLoopDetection && - (didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate)) || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - if (enableTransitionTracing) { - var prevRootTransitionCallbacks = root.transitionCallbacks; - null !== prevRootTransitionCallbacks && - schedulePostPaintCallback(function (endTime) { - var prevPendingTransitionCallbacks = - currentPendingTransitionCallbacks; - null !== prevPendingTransitionCallbacks - ? ((currentPendingTransitionCallbacks = null), - scheduleCallback(IdlePriority, function () { - processTransitionCallbacks( - prevPendingTransitionCallbacks, - endTime, - prevRootTransitionCallbacks - ); - })) - : (currentEndTime = endTime); - }); + } } - return null; } function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && @@ -10679,37 +10726,40 @@ module.exports = function ($$$config) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects(wasDelayedCommit) { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactSharedInternals.T, - previousPriority = getCurrentUpdatePriority(); - try { - return ( - setCurrentUpdatePriority(renderPriority), - (ReactSharedInternals.T = null), - flushPassiveEffectsImpl(wasDelayedCommit) - ); - } finally { - setCurrentUpdatePriority(previousPriority), - (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root, remainingLanes); - } + if (3 !== pendingEffectsStatus) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes); + renderPriority = 32 > renderPriority ? 32 : renderPriority; + var prevTransition = ReactSharedInternals.T, + previousPriority = getCurrentUpdatePriority(); + try { + return ( + setCurrentUpdatePriority(renderPriority), + (ReactSharedInternals.T = null), + flushPassiveEffectsImpl(wasDelayedCommit) + ); + } finally { + setCurrentUpdatePriority(previousPriority), + (ReactSharedInternals.T = prevTransition), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function flushPassiveEffectsImpl() { - if (null === rootWithPendingPassiveEffects) return !1; var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; + var root = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = 0; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; executionContext |= 4; @@ -10953,7 +11003,7 @@ module.exports = function ($$$config) { (workInProgress.flags = 0), (workInProgress.subtreeFlags = 0), (workInProgress.deletions = null)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -10975,7 +11025,7 @@ module.exports = function ($$$config) { return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -11225,11 +11275,7 @@ module.exports = function ($$$config) { ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = noTimeout; this.callbackNode = this.next = @@ -11242,7 +11288,6 @@ module.exports = function ($$$config) { this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12167,10 +12212,14 @@ module.exports = function ($$$config) { currentPendingTransitionCallbacks = null, currentEndTime = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, + pendingDidIncludeRenderPhaseUpdate = !1, nestedUpdateCount = 0, rootWithNestedUpdates = null, createFiber = enableObjectFiber @@ -12432,7 +12481,7 @@ module.exports = function ($$$config) { exports.findHostInstanceWithWarning = function (component) { return findHostInstance(component); }; - exports.flushPassiveEffects = flushPassiveEffects; + exports.flushPassiveEffects = flushPendingEffects; exports.flushSyncFromReconciler = function (fn) { var prevExecutionContext = executionContext; executionContext |= 1; @@ -12524,7 +12573,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); @@ -12542,7 +12591,7 @@ module.exports = function ($$$config) { return internals; }; exports.isAlreadyRendering = function () { - return !1; + return 0 !== (executionContext & 6); }; exports.observeVisibleRects = function ( hostRoot, @@ -12621,7 +12670,6 @@ module.exports = function ($$$config) { parentComponent, callback ) { - 0 === container.tag && flushPassiveEffects(); updateContainerImpl( container.current, 2, diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index c1df4883557e8..48eb4f079a528 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1119() { + function JSCompiler_object_inline_createNodeMock_1116() { return null; } function findHook(fiber, id) { @@ -80,15 +80,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (0 === root.tag && flushPassiveEffects(), - updateContainerImpl(root.current, 2, element, root, null, null), + (updateContainerImpl(root.current, 2, element, root, null, null), flushSyncWork()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -780,14 +779,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -796,28 +794,29 @@ __DEV__ && : ((pingedLanes &= nonIdlePendingLanes), 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -898,6 +897,54 @@ __DEV__ && (root.pingedLanes = 0), (root.warmLanes = 0)); } + 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; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; + for ( + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; + + ) { + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) + for ( + hiddenUpdates[index] = null, index = 0; + index < hiddenUpdatesForLane.length; + index++ + ) { + var update = hiddenUpdatesForLane[index]; + null !== update && (update.lane &= -536870913); + } + remainingLanes &= ~lane; + } + 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); + } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1871,7 +1918,7 @@ __DEV__ && "A cache instance was released after it was already freed. This likely indicates a bug in React." ); 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { + scheduleCallback$2(NormalPriority, function () { cache.controller.abort(); }); } @@ -1932,11 +1979,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); } function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -1968,7 +2013,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -1980,6 +2027,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2021,13 +2071,13 @@ __DEV__ && } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - pingedLanes = workInProgressRootRenderLanes; - suspendedLanes = - root === rootWithPendingPassiveEffects - ? suspendedLanes - : getNextLanes(root, root === currentTime ? pingedLanes : 0); + suspendedLanes = workInProgressRootRenderLanes; + suspendedLanes = getNextLanes( + root, + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -2042,56 +2092,63 @@ __DEV__ && (root.callbackPriority = 0) ); if ( - 0 !== (suspendedLanes & 3) && - !checkIfRootIsPrerendering(root, suspendedLanes) - ) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode) - ) - 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)) - : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 === (suspendedLanes & 3) || + 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; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2106,23 +2163,23 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); } function cancelCallback(callbackNode) { - callbackNode !== fakeActCallbackNode && + callbackNode !== fakeActCallbackNode$1 && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); - scheduleCallback$2(ImmediatePriority, cb); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -2908,7 +2965,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5958,14 +6015,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6944,7 +7001,7 @@ __DEV__ && mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -8001,8 +8058,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -8014,8 +8071,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -9038,6 +9095,56 @@ __DEV__ && ); } } + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((root = nextEffect), + (firstChild = root.child), + 0 !== (root.subtreeFlags & 1024) && null !== firstChild) + ) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + firstChild = root = nextEffect; + var current = firstChild.alternate, + flags = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(firstChild, current); + break; + case 3: + 0 !== (flags & 1024) && + firstChild.stateNode.containerInfo.children.splice(0); + 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; + } + nextEffect = root.return; + } + } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -10083,6 +10190,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -10741,21 +10856,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -10772,7 +10883,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10827,28 +10938,22 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10949,8 +11054,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11253,7 +11356,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$35) { handleThrow(root, thrownValue$35); @@ -11269,7 +11372,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -11476,7 +11579,9 @@ __DEV__ && workInProgress = null; } function commitRoot( - root$jscomp$0, + root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11484,203 +11589,187 @@ __DEV__ && updatedLanes, suspendedRetryLanes ) { - didIncludeRenderPhaseUpdate = ReactSharedInternals.T; - var previousUpdateLanePriority = currentUpdatePriority; - try { - currentUpdatePriority = DiscreteEventPriority; - ReactSharedInternals.T = null; - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root$jscomp$0.finishedWork, - lanes = root$jscomp$0.finishedLanes; - if (null !== finishedWork) { - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root$jscomp$0.finishedWork = null; - root$jscomp$0.finishedLanes = 0; - if (finishedWork === root$jscomp$0.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes, - remainingLanes$jscomp$0 = (remainingLanes |= - concurrentlyUpdatedLanes), - previouslyPendingLanes = root$jscomp$0.pendingLanes; - root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; - root$jscomp$0.suspendedLanes = 0; - root$jscomp$0.pingedLanes = 0; - root$jscomp$0.warmLanes = 0; - root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; - root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; - root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; - root$jscomp$0.shellSuspendCounter = 0; - var entanglements = root$jscomp$0.entanglements, - expirationTimes = root$jscomp$0.expirationTimes, - hiddenUpdates = root$jscomp$0.hiddenUpdates; - for ( - remainingLanes$jscomp$0 = - previouslyPendingLanes & ~remainingLanes$jscomp$0; - 0 < remainingLanes$jscomp$0; - - ) { - var index = 31 - clz32(remainingLanes$jscomp$0), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) { - hiddenUpdates[index] = null; - for (var i = 0; i < hiddenUpdatesForLane.length; i++) { - var update = hiddenUpdatesForLane[i]; - null !== update && (update.lane &= -536870913); - } - } - remainingLanes$jscomp$0 &= ~lane; + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + if (null !== finishedWork) { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + didIncludeRenderPhaseUpdate = + finishedWork.lanes | finishedWork.childLanes; + didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); } - 0 !== spawnedLane && - markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root$jscomp$0.tag && - (root$jscomp$0.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); - root$jscomp$0 === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions)) - : ((root$jscomp$0.callbackNode = null), - (root$jscomp$0.callbackPriority = 0), - (root$jscomp$0.cancelPendingCommit = null)); - commitStartTime = now(); - var rootHasEffect = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { - var prevTransition = ReactSharedInternals.T; - ReactSharedInternals.T = null; - transitions = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - rootHasEffect = executionContext; - executionContext |= CommitContext; - for (nextEffect = finishedWork; null !== nextEffect; ) { - updatedLanes = nextEffect; - var child = updatedLanes.child; - if (0 !== (updatedLanes.subtreeFlags & 1028) && null !== child) - (child.return = updatedLanes), (nextEffect = child); - else - b: for (; null !== nextEffect; ) { - suspendedRetryLanes = updatedLanes = nextEffect; - var current = suspendedRetryLanes.alternate, - flags = suspendedRetryLanes.flags; - switch (suspendedRetryLanes.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - 0 !== (flags & 1024) && - null !== current && - commitClassSnapshot(suspendedRetryLanes, current); - break; - case 3: - 0 !== (flags & 1024) && - suspendedRetryLanes.stateNode.containerInfo.children.splice( - 0 - ); - 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." - ); - } - var sibling = updatedLanes.sibling; - if (null !== sibling) { - sibling.return = updatedLanes.return; - nextEffect = sibling; - break b; - } - nextEffect = updatedLanes.return; - } - } - commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); - root$jscomp$0.current = finishedWork; + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { commitLayoutEffectOnFiber( - root$jscomp$0, + root, finishedWork.alternate, finishedWork ); - requestPaint(); - executionContext = rootHasEffect; - currentUpdatePriority = transitions; - ReactSharedInternals.T = prevTransition; - } else root$jscomp$0.current = finishedWork; - (prevTransition = spawnedLane) - ? ((rootWithPendingPassiveEffects = root$jscomp$0), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root$jscomp$0, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root$jscomp$0.pendingLanes; - 0 === remainingLanes && - (legacyErrorBoundariesThatAlreadyFailed = null); - prevTransition || commitDoubleInvokeEffectsInDEV(root$jscomp$0); - var root = finishedWork.stateNode; - if ( - injectedHook && - "function" === typeof injectedHook.onCommitFiberRoot - ) - try { - var didError = 128 === (root.current.flags & 128); - switch (previousUpdateLanePriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; } - if (null !== recoverableErrors) { - var onRecoverableError = root$jscomp$0.onRecoverableError; + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; for ( finishedWork = 0; finishedWork < recoverableErrors.length; @@ -11695,22 +11784,21 @@ __DEV__ && errorInfo ); } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); } - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root$jscomp$0); - remainingLanes = root$jscomp$0.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - root$jscomp$0 === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), - (rootWithNestedUpdates = root$jscomp$0))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); } - } finally { - (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), - (currentUpdatePriority = previousUpdateLanePriority); + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (previousPriority & 42) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); } } function makeErrorInfo(componentStack) { @@ -11730,90 +11818,79 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects() { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - priority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - renderPriority = ReactSharedInternals.T; - var previousPriority = currentUpdatePriority; - try { - currentUpdatePriority = priority; - ReactSharedInternals.T = null; - if (null === rootWithPendingPassiveEffects) - var JSCompiler_inline_result = !1; - else { - priority = pendingPassiveTransitions; - pendingPassiveTransitions = null; - var root$jscomp$0 = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; - root$jscomp$0.callbackNode = null; - root$jscomp$0.callbackPriority = 0; - root$jscomp$0.cancelPendingCommit = null; - if ( - (executionContext & (RenderContext | CommitContext)) !== - NoContext - ) - throw Error( - "Cannot flush passive effects while already rendering." - ); - isFlushingPassiveEffects = !0; - didScheduleUpdateDuringPassiveEffects = !1; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitPassiveUnmountOnFiber(root$jscomp$0.current); - commitPassiveMountOnFiber( - root$jscomp$0, - root$jscomp$0.current, - lanes, - priority - ); - commitDoubleInvokeEffectsInDEV(root$jscomp$0); - executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(0, !1); - didScheduleUpdateDuringPassiveEffects - ? root$jscomp$0 === rootWithPassiveNestedUpdates - ? nestedPassiveUpdateCount++ - : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = root$jscomp$0)) - : (nestedPassiveUpdateCount = 0); - didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = - !1; - ensureRootIsScheduled(root$jscomp$0); - if ( - injectedHook && - "function" === typeof injectedHook.onPostCommitFiberRoot - ) - try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - var stateNode = root$jscomp$0.current.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - JSCompiler_inline_result = !0; + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + priority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + renderPriority = ReactSharedInternals.T; + var previousPriority = currentUpdatePriority; + try { + currentUpdatePriority = priority; + ReactSharedInternals.T = null; + priority = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root$jscomp$0 = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Cannot flush passive effects while already rendering."); + isFlushingPassiveEffects = !0; + didScheduleUpdateDuringPassiveEffects = !1; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitPassiveUnmountOnFiber(root$jscomp$0.current); + commitPassiveMountOnFiber( + root$jscomp$0, + root$jscomp$0.current, + lanes, + priority + ); + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + executionContext = prevExecutionContext; + flushSyncWorkAcrossRoots_impl(0, !1); + didScheduleUpdateDuringPassiveEffects + ? root$jscomp$0 === rootWithPassiveNestedUpdates + ? nestedPassiveUpdateCount++ + : ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = root$jscomp$0)) + : (nestedPassiveUpdateCount = 0); + didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); } - return JSCompiler_inline_result; - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = renderPriority), - releaseRootPooledCache(root, remainingLanes); - } + var stateNode = root$jscomp$0.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + return !0; + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = renderPriority), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); @@ -12039,6 +12116,12 @@ __DEV__ && } } } + function scheduleCallback(priorityLevel, callback) { + var actQueue = ReactSharedInternals.actQueue; + return null !== actQueue + ? (actQueue.push(callback), fakeActCallbackNode) + : scheduleCallback$3(priorityLevel, callback); + } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -12230,7 +12313,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12268,7 +12351,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12533,11 +12616,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12550,7 +12629,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12958,7 +13036,7 @@ __DEV__ && var current = null, isRendering = !1, isArrayImpl = Array.isArray, - scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$3 = Scheduler$1.unstable_scheduleCallback, cancelCallback$1 = Scheduler$1.unstable_cancelCallback, shouldYield = Scheduler$1.unstable_shouldYield, requestPaint = Scheduler$1.unstable_requestPaint, @@ -13050,7 +13128,7 @@ __DEV__ && }); }; }, - scheduleCallback$1 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, NormalPriority = Scheduler$1.unstable_NormalPriority, CacheContext = { $$typeof: REACT_CONTEXT_TYPE, @@ -13075,7 +13153,7 @@ __DEV__ && mightHavePendingSyncWork = !1, isFlushingWork = !1, currentEventTransitionLane = 0, - fakeActCallbackNode = {}, + fakeActCallbackNode$1 = {}, currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, @@ -14678,10 +14756,19 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -14691,12 +14778,11 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var resolveFamily = null, + var fakeActCallbackNode = {}, + resolveFamily = null, failedBoundaries = null; var hasBadMapPolyfill = !1; try { @@ -14909,10 +14995,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-a9bbe346-20241219", + version: "19.1.0-www-classic-a160102f-20250107", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-classic-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14932,7 +15018,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1119, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1116, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15047,5 +15133,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-classic-a9bbe346-20241219"; + exports.version = "19.1.0-www-classic-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 5f9041df10e8f..626d52a0fad0f 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1119() { + function JSCompiler_object_inline_createNodeMock_1116() { return null; } function findHook(fiber, id) { @@ -80,15 +80,14 @@ __DEV__ && } function scheduleRoot(root, element) { root.context === emptyContextObject && - (0 === root.tag && flushPassiveEffects(), - updateContainerImpl(root.current, 2, element, root, null, null), + (updateContainerImpl(root.current, 2, element, root, null, null), flushSyncWork()); } function scheduleRefresh(root, update) { if (null !== resolveFamily) { var staleFamilies = update.staleFamilies; update = update.updatedFamilies; - flushPassiveEffects(); + flushPendingEffects(); scheduleFibersWithFamiliesRecursively( root.current, update, @@ -780,14 +779,13 @@ __DEV__ && ); } } - function getNextLanes(root, wipLanes) { + function getNextLanes(root, wipLanes, rootHasPendingCommit) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + pingedLanes = root.pingedLanes; + root = root.warmLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), @@ -796,28 +794,29 @@ __DEV__ && : ((pingedLanes &= nonIdlePendingLanes), 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) + : rootHasPendingCommit || + ((rootHasPendingCommit = nonIdlePendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = + getHighestPriorityLanes(rootHasPendingCommit))))) : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), 0 !== nonIdlePendingLanes ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) : 0 !== pingedLanes ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : rootHasPendingCommit || + ((rootHasPendingCommit = pendingLanes & ~root), + 0 !== rootHasPendingCommit && + (nextLanes = getHighestPriorityLanes(rootHasPendingCommit)))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (rootHasPendingCommit = wipLanes & -wipLanes), + suspendedLanes >= rootHasPendingCommit || + (32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194176))) ? wipLanes : nextLanes; } @@ -898,6 +897,54 @@ __DEV__ && (root.pingedLanes = 0), (root.warmLanes = 0)); } + 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; + var entanglements = root.entanglements, + expirationTimes = root.expirationTimes, + hiddenUpdates = root.hiddenUpdates; + for ( + remainingLanes = previouslyPendingLanes & ~remainingLanes; + 0 < remainingLanes; + + ) { + var index = 31 - clz32(remainingLanes), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) + for ( + hiddenUpdates[index] = null, index = 0; + index < hiddenUpdatesForLane.length; + index++ + ) { + var update = hiddenUpdatesForLane[index]; + null !== update && (update.lane &= -536870913); + } + remainingLanes &= ~lane; + } + 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root.tag && + (root.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); + } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1871,7 +1918,7 @@ __DEV__ && "A cache instance was released after it was already freed. This likely indicates a bug in React." ); 0 === cache.refCount && - scheduleCallback$1(NormalPriority, function () { + scheduleCallback$2(NormalPriority, function () { cache.controller.abort(); }); } @@ -1932,11 +1979,9 @@ __DEV__ && mightHavePendingSyncWork = !0; null !== ReactSharedInternals.actQueue ? didScheduleMicrotask_act || - ((didScheduleMicrotask_act = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)) + ((didScheduleMicrotask_act = !0), scheduleImmediateRootScheduleTask()) : didScheduleMicrotask || - ((didScheduleMicrotask = !0), - scheduleImmediateTask(processRootScheduleInMicrotask)); + ((didScheduleMicrotask = !0), scheduleImmediateRootScheduleTask()); } function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { if (!isFlushingWork && mightHavePendingSyncWork) { @@ -1968,7 +2013,9 @@ __DEV__ && (nextLanes = workInProgressRootRenderLanes), (nextLanes = getNextLanes( root, - root === workInProgressRoot ? nextLanes : 0 + root === workInProgressRoot ? nextLanes : 0, + null !== root.cancelPendingCommit || + -1 !== root.timeoutHandle )), 0 === (nextLanes & 3) || checkIfRootIsPrerendering(root, nextLanes) || @@ -1980,6 +2027,9 @@ __DEV__ && isFlushingWork = !1; } } + function processRootScheduleInImmediateTask() { + processRootScheduleInMicrotask(); + } function processRootScheduleInMicrotask() { mightHavePendingSyncWork = didScheduleMicrotask_act = @@ -2021,13 +2071,13 @@ __DEV__ && } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } - suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - pingedLanes = workInProgressRootRenderLanes; - suspendedLanes = - root === rootWithPendingPassiveEffects - ? suspendedLanes - : getNextLanes(root, root === currentTime ? pingedLanes : 0); + suspendedLanes = workInProgressRootRenderLanes; + suspendedLanes = getNextLanes( + root, + root === currentTime ? suspendedLanes : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle + ); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -2042,56 +2092,63 @@ __DEV__ && (root.callbackPriority = 0) ); if ( - 0 !== (suspendedLanes & 3) && - !checkIfRootIsPrerendering(root, suspendedLanes) - ) - return ( - null !== pingedLanes && cancelCallback(pingedLanes), - (root.callbackPriority = 2), - (root.callbackNode = null), - 2 - ); - currentTime = suspendedLanes & -suspendedLanes; - if ( - currentTime !== root.callbackPriority || - (null !== ReactSharedInternals.actQueue && - pingedLanes !== fakeActCallbackNode) - ) - 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)) - : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 === (suspendedLanes & 3) || + 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; + if ( + pendingEffectsStatus !== NO_PENDING_EFFECTS && + pendingEffectsStatus !== PENDING_PASSIVE_PHASE + ) + return (root.callbackNode = null), (root.callbackPriority = 0), null; var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + if (flushPendingEffects(!0) && root.callbackNode !== originalCallbackNode) return null; var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; workInProgressRootRenderLanes$jscomp$0 = getNextLanes( root, - root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + root === workInProgressRoot + ? workInProgressRootRenderLanes$jscomp$0 + : 0, + null !== root.cancelPendingCommit || -1 !== root.timeoutHandle ); if (0 === workInProgressRootRenderLanes$jscomp$0) return null; performWorkOnRoot( @@ -2106,23 +2163,23 @@ __DEV__ && : null; } function performSyncWorkOnRoot(root, lanes) { - if (flushPassiveEffects()) return null; + if (flushPendingEffects()) return null; currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = !1; performWorkOnRoot(root, lanes, !0); } function cancelCallback(callbackNode) { - callbackNode !== fakeActCallbackNode && + callbackNode !== fakeActCallbackNode$1 && null !== callbackNode && cancelCallback$1(callbackNode); } - function scheduleImmediateTask(cb) { + function scheduleImmediateRootScheduleTask() { null !== ReactSharedInternals.actQueue && ReactSharedInternals.actQueue.push(function () { - cb(); + processRootScheduleInMicrotask(); return null; }); - scheduleCallback$2(ImmediatePriority, cb); + scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask); } function requestTransitionLane() { 0 === currentEventTransitionLane && @@ -2908,7 +2965,7 @@ __DEV__ && null; hookTypesUpdateIndexDev = -1; null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + (current.flags & 29360128) !== (workInProgress.flags & 29360128) && error$jscomp$0( "Internal React error: Expected static flag was missing. Please notify the React team." ); @@ -5958,14 +6015,14 @@ __DEV__ && if (null === ref) null !== current && null !== current.ref && - (workInProgress.flags |= 2097664); + (workInProgress.flags |= 4194816); else { if ("function" !== typeof ref && "object" !== typeof ref) throw Error( "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + workInProgress.flags |= 4194816; } } function updateFunctionComponent( @@ -6944,7 +7001,7 @@ __DEV__ && mode: "hidden", children: nextProps.children }); - nextProps.subtreeFlags = didSuspend.subtreeFlags & 31457280; + nextProps.subtreeFlags = didSuspend.subtreeFlags & 29360128; null !== currentFallbackChildFragment ? (nextPrimaryChildren = createWorkInProgress( currentFallbackChildFragment, @@ -8001,8 +8058,8 @@ __DEV__ && ) (newChildLanes |= _child2.lanes | _child2.childLanes), - (subtreeFlags |= _child2.subtreeFlags & 31457280), - (subtreeFlags |= _child2.flags & 31457280), + (subtreeFlags |= _child2.subtreeFlags & 29360128), + (subtreeFlags |= _child2.flags & 29360128), (_treeBaseDuration += _child2.treeBaseDuration), (_child2 = _child2.sibling); completedWork.treeBaseDuration = _treeBaseDuration; @@ -8014,8 +8071,8 @@ __DEV__ && ) (newChildLanes |= _treeBaseDuration.lanes | _treeBaseDuration.childLanes), - (subtreeFlags |= _treeBaseDuration.subtreeFlags & 31457280), - (subtreeFlags |= _treeBaseDuration.flags & 31457280), + (subtreeFlags |= _treeBaseDuration.subtreeFlags & 29360128), + (subtreeFlags |= _treeBaseDuration.flags & 29360128), (_treeBaseDuration.return = completedWork), (_treeBaseDuration = _treeBaseDuration.sibling); else if (0 !== (completedWork.mode & 2)) { @@ -9038,6 +9095,56 @@ __DEV__ && ); } } + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect; ) + if ( + ((root = nextEffect), + (firstChild = root.child), + 0 !== (root.subtreeFlags & 1024) && null !== firstChild) + ) + (firstChild.return = root), (nextEffect = firstChild); + else + for (; null !== nextEffect; ) { + firstChild = root = nextEffect; + var current = firstChild.alternate, + flags = firstChild.flags; + switch (firstChild.tag) { + case 0: + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(firstChild, current); + break; + case 3: + 0 !== (flags & 1024) && + firstChild.stateNode.containerInfo.children.splice(0); + 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; + } + nextEffect = root.return; + } + } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -10083,6 +10190,14 @@ __DEV__ && flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; + case 1: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 3: var prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( @@ -10741,21 +10856,17 @@ __DEV__ && default: throw Error("Unknown root exit status."); } - shouldTimeSlice.finishedWork = forceSync; - shouldTimeSlice.finishedLanes = lanes; if (null !== ReactSharedInternals.actQueue) commitRoot( shouldTimeSlice, + forceSync, + lanes, workInProgressRootRecoverableErrors, workInProgressTransitions, workInProgressRootDidIncludeRecursiveRenderUpdate, workInProgressDeferredLane, workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - exitStatus, - IMMEDIATE_COMMIT, - -0, - 0 + workInProgressSuspendedRetryLanes ); else { if ( @@ -10772,7 +10883,7 @@ __DEV__ && workInProgressDeferredLane, !workInProgressRootDidSkipSuspendedSiblings ); - if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + if (0 !== getNextLanes(shouldTimeSlice, 0, !0)) break a; shouldTimeSlice.timeoutHandle = scheduleTimeout( commitRootWhenReady.bind( null, @@ -10827,28 +10938,22 @@ __DEV__ && lanes, spawnedLane, updatedLanes, - suspendedRetryLanes, - didSkipSuspendedSiblings, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - lanes = finishedWork.subtreeFlags; - (lanes & 8192 || 16785408 === (lanes & 16785408)) && + root.timeoutHandle = -1; + var subtreeFlags = finishedWork.subtreeFlags; + (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) && accumulateSuspenseyCommitOnFiber(finishedWork); commitRoot( root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10949,8 +11054,6 @@ __DEV__ && } } function prepareFreshStack(root, lanes) { - root.finishedWork = null; - root.finishedLanes = 0; var timeoutHandle = root.timeoutHandle; -1 !== timeoutHandle && ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle)); @@ -11253,7 +11356,7 @@ __DEV__ && } null !== ReactSharedInternals.actQueue ? workLoopSync() - : workLoopConcurrent(); + : workLoopConcurrentByScheduler(); break; } catch (thrownValue$35) { handleThrow(root, thrownValue$35); @@ -11269,7 +11372,7 @@ __DEV__ && finishQueueingConcurrentUpdates(); return workInProgressRootExitStatus; } - function workLoopConcurrent() { + function workLoopConcurrentByScheduler() { for (; null !== workInProgress && !shouldYield(); ) performUnitOfWork(workInProgress); } @@ -11476,7 +11579,9 @@ __DEV__ && workInProgress = null; } function commitRoot( - root$jscomp$0, + root, + finishedWork, + lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -11484,203 +11589,187 @@ __DEV__ && updatedLanes, suspendedRetryLanes ) { - didIncludeRenderPhaseUpdate = ReactSharedInternals.T; - var previousUpdateLanePriority = currentUpdatePriority; - try { - currentUpdatePriority = DiscreteEventPriority; - ReactSharedInternals.T = null; - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root$jscomp$0.finishedWork, - lanes = root$jscomp$0.finishedLanes; - if (null !== finishedWork) { - 0 === lanes && - error$jscomp$0( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root$jscomp$0.finishedWork = null; - root$jscomp$0.finishedLanes = 0; - if (finishedWork === root$jscomp$0.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - var remainingLanes = finishedWork.lanes | finishedWork.childLanes, - remainingLanes$jscomp$0 = (remainingLanes |= - concurrentlyUpdatedLanes), - previouslyPendingLanes = root$jscomp$0.pendingLanes; - root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; - root$jscomp$0.suspendedLanes = 0; - root$jscomp$0.pingedLanes = 0; - root$jscomp$0.warmLanes = 0; - root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; - root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; - root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; - root$jscomp$0.shellSuspendCounter = 0; - var entanglements = root$jscomp$0.entanglements, - expirationTimes = root$jscomp$0.expirationTimes, - hiddenUpdates = root$jscomp$0.hiddenUpdates; - for ( - remainingLanes$jscomp$0 = - previouslyPendingLanes & ~remainingLanes$jscomp$0; - 0 < remainingLanes$jscomp$0; - - ) { - var index = 31 - clz32(remainingLanes$jscomp$0), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) { - hiddenUpdates[index] = null; - for (var i = 0; i < hiddenUpdatesForLane.length; i++) { - var update = hiddenUpdatesForLane[i]; - null !== update && (update.lane &= -536870913); - } - } - remainingLanes$jscomp$0 &= ~lane; + root.cancelPendingCommit = null; + do flushPendingEffects(); + while (pendingEffectsStatus !== NO_PENDING_EFFECTS); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + if (null !== finishedWork) { + 0 === lanes && + error$jscomp$0( + "finishedLanes should not be empty during a commit. This is a bug in React." + ); + if (finishedWork === root.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + didIncludeRenderPhaseUpdate = + finishedWork.lanes | finishedWork.childLanes; + didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes; + markRootFinished( + root, + lanes, + didIncludeRenderPhaseUpdate, + spawnedLane, + updatedLanes, + suspendedRetryLanes + ); + root === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + pendingFinishedWork = finishedWork; + pendingEffectsRoot = root; + pendingEffectsLanes = lanes; + pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate; + pendingPassiveTransitions = transitions; + pendingRecoverableErrors = recoverableErrors; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((root.callbackNode = null), + (root.callbackPriority = 0), + scheduleCallback(NormalPriority$1, function () { + flushPassiveEffects(!0); + return null; + })) + : ((root.callbackNode = null), (root.callbackPriority = 0)); + commitStartTime = now(); + lanes = 0 !== (finishedWork.flags & 13878); + if (0 !== (finishedWork.subtreeFlags & 13878) || lanes) { + lanes = ReactSharedInternals.T; + ReactSharedInternals.T = null; + recoverableErrors = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + transitions = executionContext; + executionContext |= CommitContext; + try { + commitBeforeMutationEffects(root, finishedWork); + } finally { + (executionContext = transitions), + (currentUpdatePriority = recoverableErrors), + (ReactSharedInternals.T = lanes); } - 0 !== spawnedLane && - markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root$jscomp$0.tag && - (root$jscomp$0.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); - root$jscomp$0 === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - spawnedLane = !1; - 0 !== (finishedWork.subtreeFlags & 10256) || - 0 !== (finishedWork.flags & 10256) - ? ((spawnedLane = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions)) - : ((root$jscomp$0.callbackNode = null), - (root$jscomp$0.callbackPriority = 0), - (root$jscomp$0.cancelPendingCommit = null)); - commitStartTime = now(); - var rootHasEffect = 0 !== (finishedWork.flags & 15990); - if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { - var prevTransition = ReactSharedInternals.T; - ReactSharedInternals.T = null; - transitions = currentUpdatePriority; - currentUpdatePriority = DiscreteEventPriority; - rootHasEffect = executionContext; - executionContext |= CommitContext; - for (nextEffect = finishedWork; null !== nextEffect; ) { - updatedLanes = nextEffect; - var child = updatedLanes.child; - if (0 !== (updatedLanes.subtreeFlags & 1028) && null !== child) - (child.return = updatedLanes), (nextEffect = child); - else - b: for (; null !== nextEffect; ) { - suspendedRetryLanes = updatedLanes = nextEffect; - var current = suspendedRetryLanes.alternate, - flags = suspendedRetryLanes.flags; - switch (suspendedRetryLanes.tag) { - case 0: - break; - case 11: - case 15: - break; - case 1: - 0 !== (flags & 1024) && - null !== current && - commitClassSnapshot(suspendedRetryLanes, current); - break; - case 3: - 0 !== (flags & 1024) && - suspendedRetryLanes.stateNode.containerInfo.children.splice( - 0 - ); - 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." - ); - } - var sibling = updatedLanes.sibling; - if (null !== sibling) { - sibling.return = updatedLanes.return; - nextEffect = sibling; - break b; - } - nextEffect = updatedLanes.return; - } - } - commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); - root$jscomp$0.current = finishedWork; + } + pendingEffectsStatus = PENDING_MUTATION_PHASE; + flushMutationEffects(); + flushLayoutEffects(); + } + } + function flushMutationEffects() { + if (pendingEffectsStatus === PENDING_MUTATION_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + rootMutationHasEffect = 0 !== (finishedWork.flags & 13878); + if ( + 0 !== (finishedWork.subtreeFlags & 13878) || + rootMutationHasEffect + ) { + rootMutationHasEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { + commitMutationEffectsOnFiber(finishedWork, root); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootMutationHasEffect); + } + } + root.current = finishedWork; + pendingEffectsStatus = PENDING_LAYOUT_PHASE; + } + } + function flushLayoutEffects() { + if (pendingEffectsStatus === PENDING_LAYOUT_PHASE) { + pendingEffectsStatus = NO_PENDING_EFFECTS; + var root = pendingEffectsRoot, + finishedWork = pendingFinishedWork, + lanes = pendingEffectsLanes, + recoverableErrors = pendingRecoverableErrors, + rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772); + if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) { + rootHasLayoutEffect = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + try { commitLayoutEffectOnFiber( - root$jscomp$0, + root, finishedWork.alternate, finishedWork ); - requestPaint(); - executionContext = rootHasEffect; - currentUpdatePriority = transitions; - ReactSharedInternals.T = prevTransition; - } else root$jscomp$0.current = finishedWork; - (prevTransition = spawnedLane) - ? ((rootWithPendingPassiveEffects = root$jscomp$0), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root$jscomp$0, remainingLanes), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - remainingLanes = root$jscomp$0.pendingLanes; - 0 === remainingLanes && - (legacyErrorBoundariesThatAlreadyFailed = null); - prevTransition || commitDoubleInvokeEffectsInDEV(root$jscomp$0); - var root = finishedWork.stateNode; - if ( - injectedHook && - "function" === typeof injectedHook.onCommitFiberRoot - ) - try { - var didError = 128 === (root.current.flags & 128); - switch (previousUpdateLanePriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); + } finally { + (executionContext = prevExecutionContext), + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = rootHasLayoutEffect); + } + } + requestPaint(); + (rootHasLayoutEffect = + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256)) + ? (pendingEffectsStatus = PENDING_PASSIVE_PHASE) + : ((pendingEffectsStatus = NO_PENDING_EFFECTS), + (pendingEffectsRoot = null), + releaseRootPooledCache(root, root.pendingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + previousPriority = root.pendingLanes; + 0 === previousPriority && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootHasLayoutEffect || commitDoubleInvokeEffectsInDEV(root); + rootHasLayoutEffect = lanesToEventPriority(lanes); + finishedWork = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (finishedWork.current.flags & 128); + switch (rootHasLayoutEffect) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; } - if (null !== recoverableErrors) { - var onRecoverableError = root$jscomp$0.onRecoverableError; + injectedHook.onCommitFiberRoot( + rendererID, + finishedWork, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); + } + if (null !== recoverableErrors) { + didError = ReactSharedInternals.T; + schedulerPriority = currentUpdatePriority; + currentUpdatePriority = DiscreteEventPriority; + ReactSharedInternals.T = null; + try { + var onRecoverableError = root.onRecoverableError; for ( finishedWork = 0; finishedWork < recoverableErrors.length; @@ -11695,22 +11784,21 @@ __DEV__ && errorInfo ); } + } finally { + (ReactSharedInternals.T = didError), + (currentUpdatePriority = schedulerPriority); } - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - ensureRootIsScheduled(root$jscomp$0); - remainingLanes = root$jscomp$0.pendingLanes; - 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) - ? ((nestedUpdateScheduled = !0), - root$jscomp$0 === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), - (rootWithNestedUpdates = root$jscomp$0))) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); } - } finally { - (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), - (currentUpdatePriority = previousUpdateLanePriority); + 0 !== (pendingEffectsLanes & 3) && flushPendingEffects(); + ensureRootIsScheduled(root); + previousPriority = root.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (previousPriority & 42) + ? ((nestedUpdateScheduled = !0), + root === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); } } function makeErrorInfo(componentStack) { @@ -11730,90 +11818,79 @@ __DEV__ && null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } + function flushPendingEffects(wasDelayedCommit) { + flushMutationEffects(); + flushLayoutEffects(); + return flushPassiveEffects(wasDelayedCommit); + } function flushPassiveEffects() { - if (null !== rootWithPendingPassiveEffects) { - var root = rootWithPendingPassiveEffects, - remainingLanes = pendingPassiveEffectsRemainingLanes; - pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), - priority = - 0 === DefaultEventPriority || DefaultEventPriority > renderPriority - ? DefaultEventPriority - : renderPriority; - renderPriority = ReactSharedInternals.T; - var previousPriority = currentUpdatePriority; - try { - currentUpdatePriority = priority; - ReactSharedInternals.T = null; - if (null === rootWithPendingPassiveEffects) - var JSCompiler_inline_result = !1; - else { - priority = pendingPassiveTransitions; - pendingPassiveTransitions = null; - var root$jscomp$0 = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; - rootWithPendingPassiveEffects = null; - pendingPassiveEffectsLanes = 0; - root$jscomp$0.callbackNode = null; - root$jscomp$0.callbackPriority = 0; - root$jscomp$0.cancelPendingCommit = null; - if ( - (executionContext & (RenderContext | CommitContext)) !== - NoContext - ) - throw Error( - "Cannot flush passive effects while already rendering." - ); - isFlushingPassiveEffects = !0; - didScheduleUpdateDuringPassiveEffects = !1; - var prevExecutionContext = executionContext; - executionContext |= CommitContext; - commitPassiveUnmountOnFiber(root$jscomp$0.current); - commitPassiveMountOnFiber( - root$jscomp$0, - root$jscomp$0.current, - lanes, - priority - ); - commitDoubleInvokeEffectsInDEV(root$jscomp$0); - executionContext = prevExecutionContext; - flushSyncWorkAcrossRoots_impl(0, !1); - didScheduleUpdateDuringPassiveEffects - ? root$jscomp$0 === rootWithPassiveNestedUpdates - ? nestedPassiveUpdateCount++ - : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = root$jscomp$0)) - : (nestedPassiveUpdateCount = 0); - didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = - !1; - ensureRootIsScheduled(root$jscomp$0); - if ( - injectedHook && - "function" === typeof injectedHook.onPostCommitFiberRoot - ) - try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - error$jscomp$0( - "React instrumentation encountered an error: %s", - err - )); - } - var stateNode = root$jscomp$0.current.stateNode; - stateNode.effectDuration = 0; - stateNode.passiveEffectDuration = 0; - JSCompiler_inline_result = !0; + if (pendingEffectsStatus !== PENDING_PASSIVE_PHASE) return !1; + var root = pendingEffectsRoot, + remainingLanes = pendingEffectsRemainingLanes; + pendingEffectsRemainingLanes = 0; + var renderPriority = lanesToEventPriority(pendingEffectsLanes), + priority = + 0 === DefaultEventPriority || DefaultEventPriority > renderPriority + ? DefaultEventPriority + : renderPriority; + renderPriority = ReactSharedInternals.T; + var previousPriority = currentUpdatePriority; + try { + currentUpdatePriority = priority; + ReactSharedInternals.T = null; + priority = pendingPassiveTransitions; + pendingPassiveTransitions = null; + var root$jscomp$0 = pendingEffectsRoot, + lanes = pendingEffectsLanes; + pendingEffectsStatus = NO_PENDING_EFFECTS; + pendingEffectsRoot = null; + pendingEffectsLanes = 0; + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Cannot flush passive effects while already rendering."); + isFlushingPassiveEffects = !0; + didScheduleUpdateDuringPassiveEffects = !1; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitPassiveUnmountOnFiber(root$jscomp$0.current); + commitPassiveMountOnFiber( + root$jscomp$0, + root$jscomp$0.current, + lanes, + priority + ); + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + executionContext = prevExecutionContext; + flushSyncWorkAcrossRoots_impl(0, !1); + didScheduleUpdateDuringPassiveEffects + ? root$jscomp$0 === rootWithPassiveNestedUpdates + ? nestedPassiveUpdateCount++ + : ((nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = root$jscomp$0)) + : (nestedPassiveUpdateCount = 0); + didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + if ( + injectedHook && + "function" === typeof injectedHook.onPostCommitFiberRoot + ) + try { + injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + error$jscomp$0( + "React instrumentation encountered an error: %s", + err + )); } - return JSCompiler_inline_result; - } finally { - (currentUpdatePriority = previousPriority), - (ReactSharedInternals.T = renderPriority), - releaseRootPooledCache(root, remainingLanes); - } + var stateNode = root$jscomp$0.current.stateNode; + stateNode.effectDuration = 0; + stateNode.passiveEffectDuration = 0; + return !0; + } finally { + (currentUpdatePriority = previousPriority), + (ReactSharedInternals.T = renderPriority), + releaseRootPooledCache(root, remainingLanes); } - return !1; } function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { sourceFiber = createCapturedValueAtFiber(error, sourceFiber); @@ -12039,6 +12116,12 @@ __DEV__ && } } } + function scheduleCallback(priorityLevel, callback) { + var actQueue = ReactSharedInternals.actQueue; + return null !== actQueue + ? (actQueue.push(callback), fakeActCallbackNode) + : scheduleCallback$3(priorityLevel, callback); + } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -12230,7 +12313,7 @@ __DEV__ && (workInProgress.deletions = null), (workInProgress.actualDuration = -0), (workInProgress.actualStartTime = -1.1)); - workInProgress.flags = current.flags & 31457280; + workInProgress.flags = current.flags & 29360128; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; @@ -12268,7 +12351,7 @@ __DEV__ && return workInProgress; } function resetWorkInProgress(workInProgress, renderLanes) { - workInProgress.flags &= 31457282; + workInProgress.flags &= 29360130; var current = workInProgress.alternate; null === current ? ((workInProgress.childLanes = 0), @@ -12533,11 +12616,7 @@ __DEV__ && ) { this.tag = 1; this.containerInfo = containerInfo; - this.finishedWork = - this.pingCache = - this.current = - this.pendingChildren = - null; + this.pingCache = this.current = this.pendingChildren = null; this.timeoutHandle = -1; this.callbackNode = this.next = @@ -12550,7 +12629,6 @@ __DEV__ && this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = - this.finishedLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = @@ -12958,7 +13036,7 @@ __DEV__ && var current = null, isRendering = !1, isArrayImpl = Array.isArray, - scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$3 = Scheduler$1.unstable_scheduleCallback, cancelCallback$1 = Scheduler$1.unstable_cancelCallback, shouldYield = Scheduler$1.unstable_shouldYield, requestPaint = Scheduler$1.unstable_requestPaint, @@ -13050,7 +13128,7 @@ __DEV__ && }); }; }, - scheduleCallback$1 = Scheduler$1.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler$1.unstable_scheduleCallback, NormalPriority = Scheduler$1.unstable_NormalPriority, CacheContext = { $$typeof: REACT_CONTEXT_TYPE, @@ -13075,7 +13153,7 @@ __DEV__ && mightHavePendingSyncWork = !1, isFlushingWork = !1, currentEventTransitionLane = 0, - fakeActCallbackNode = {}, + fakeActCallbackNode$1 = {}, currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, @@ -14678,10 +14756,19 @@ __DEV__ && RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootWithPendingPassiveEffects = null, - pendingPassiveEffectsLanes = 0, - pendingPassiveEffectsRemainingLanes = 0, + IMMEDIATE_COMMIT = 0, + THROTTLED_COMMIT = 2, + NO_PENDING_EFFECTS = 0, + PENDING_MUTATION_PHASE = 1, + PENDING_LAYOUT_PHASE = 2, + PENDING_PASSIVE_PHASE = 3, + pendingEffectsStatus = 0, + pendingEffectsRoot = null, + pendingFinishedWork = null, + pendingEffectsLanes = 0, + pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, + pendingRecoverableErrors = null, NESTED_UPDATE_LIMIT = 50, nestedUpdateCount = 0, rootWithNestedUpdates = null, @@ -14691,12 +14778,11 @@ __DEV__ && nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, - IMMEDIATE_COMMIT = 0, - THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var resolveFamily = null, + var fakeActCallbackNode = {}, + resolveFamily = null, failedBoundaries = null; var hasBadMapPolyfill = !1; try { @@ -14909,10 +14995,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-a9bbe346-20241219", + version: "19.1.0-www-modern-a160102f-20250107", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-a9bbe346-20241219" + reconcilerVersion: "19.1.0-www-modern-a160102f-20250107" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -14932,7 +15018,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1119, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1116, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15047,5 +15133,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-modern-a9bbe346-20241219"; + exports.version = "19.1.0-www-modern-a160102f-20250107"; })(); diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index 660d7df1bdcdf..df80b984ffa6d 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.1.0-www-classic-a9bbe346-20241219 \ No newline at end of file +19.1.0-www-classic-a160102f-20250107 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index 88ea81a6b9f9e..73b12da194cd3 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.1.0-www-modern-a9bbe346-20241219 \ No newline at end of file +19.1.0-www-modern-a160102f-20250107 \ No newline at end of file diff --git a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js index 5d5b294caf548..4e2d45505f05c 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -368,6 +368,7 @@ export default [ "dispatchCommand was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component", "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().", "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().", + "finishedLanes should not be empty during a commit. This is a bug in React.", "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.", "forwardRef render functions accept exactly two parameters: props and ref. %s", "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?", @@ -385,7 +386,6 @@ export default [ "react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer", "ref.measureLayout must be called with a node handle or a ref to a native component.", "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.", - "root.finishedLanes should not be empty during a commit. This is a bug in React.", "sendAccessibilityEvent was called with a ref that isn't a native component. Use React.forwardRef to get access to the underlying native component", "unmountComponentAtNode was removed in React 19. Use root.unmount() instead.", "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", diff --git a/compiled/facebook-www/eslint-plugin-react-hooks.js b/compiled/facebook-www/eslint-plugin-react-hooks.js index 973e9ff8b0851..eb7631802db43 100644 --- a/compiled/facebook-www/eslint-plugin-react-hooks.js +++ b/compiled/facebook-www/eslint-plugin-react-hooks.js @@ -874,7 +874,9 @@ } else if ( codePathNode.parent && ("MethodDefinition" === codePathNode.parent.type || - "ClassProperty" === codePathNode.parent.type) && + "ClassProperty" === codePathNode.parent.type || + "PropertyDefinition" === + codePathNode.parent.type) && codePathNode.parent.value === codePathNode ) { var _message =