From ffde2c00a9279619ad91bdaa1f34cb72d6b09489 Mon Sep 17 00:00:00 2001 From: gnoff Date: Mon, 8 Apr 2024 15:58:13 +0000 Subject: [PATCH] [Fiber] Move updatePriority tracking to renderers (#28751) Currently updatePriority is tracked in the reconciler. `flushSync` is going to be implemented reconciler agnostic soon and we need to move the tracking of this state to the renderer and out of reconciler. This change implements new renderer bin dings for getCurrentUpdatePriority and setCurrentUpdatePriority. I was originally going to have the getter also do the event priority defaulting using window.event so we eliminate getCur rentEventPriority but this makes all the callsites where we store the true current updatePriority on the stack harder to work with so for now they remain separate. I also moved runWithPriority to the renderer since it really belongs whereever the state is being managed and it is only currently exposed in the DOM renderer. Additionally the current update priority is not stored on ReactDOMSharedInternals. While not particularly meaningful in this change it opens the door to implementing `flushSync` outside of the reconciler DiffTrain build for [8e1462e8c471fbec98aac2b3e1326498d0ff7139](https://github.com/facebook/react/commit/8e1462e8c471fbec98aac2b3e1326498d0ff7139) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/ReactART-dev.classic.js | 53 +- compiled/facebook-www/ReactART-dev.modern.js | 53 +- .../facebook-www/ReactART-prod.classic.js | 45 +- compiled/facebook-www/ReactART-prod.modern.js | 30 +- compiled/facebook-www/ReactDOM-dev.classic.js | 394 ++-- compiled/facebook-www/ReactDOM-dev.modern.js | 1954 +++++++++-------- .../facebook-www/ReactDOM-prod.classic.js | 215 +- compiled/facebook-www/ReactDOM-prod.modern.js | 805 ++++--- .../ReactDOM-profiling.classic.js | 201 +- .../facebook-www/ReactDOM-profiling.modern.js | 811 ++++--- .../ReactDOMTesting-dev.classic.js | 394 ++-- .../ReactDOMTesting-dev.modern.js | 1954 +++++++++-------- .../ReactDOMTesting-prod.classic.js | 303 ++- .../ReactDOMTesting-prod.modern.js | 923 ++++---- .../ReactTestRenderer-dev.classic.js | 55 +- .../ReactTestRenderer-dev.modern.js | 55 +- 17 files changed, 4091 insertions(+), 4156 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 89822afbc5..baaec467ff 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0b3b8a6a354b90fe76a9d82bb34487e5d2f71203 +8e1462e8c471fbec98aac2b3e1326498d0ff7139 diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 8bb93fec75..19ae95bf45 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-classic-fcdce517"; + var ReactVersion = "19.0.0-www-classic-6d726b4b"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -2576,17 +2576,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2596,6 +2590,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2961,8 +2958,15 @@ if (__DEV__) { typeof props.children === "string" || typeof props.children === "number" ); } - function getCurrentEventPriority() { - return DefaultEventPriority; + var currentUpdatePriority = NoEventPriority; + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function resolveUpdatePriority() { + return currentUpdatePriority || DefaultEventPriority; } function shouldAttemptEagerTransition() { return false; @@ -25880,26 +25884,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -26633,8 +26620,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; if (fn) { return fn(); @@ -27801,12 +27788,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; commitRootImpl( root, recoverableErrors, @@ -28212,8 +28199,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index a8c89d3233..faf7f68ea7 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -66,7 +66,7 @@ if (__DEV__) { return self; } - var ReactVersion = "19.0.0-www-modern-f3bc72db"; + var ReactVersion = "19.0.0-www-modern-35717797"; var LegacyRoot = 0; var ConcurrentRoot = 1; @@ -2573,17 +2573,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2593,6 +2587,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2958,8 +2955,15 @@ if (__DEV__) { typeof props.children === "string" || typeof props.children === "number" ); } - function getCurrentEventPriority() { - return DefaultEventPriority; + var currentUpdatePriority = NoEventPriority; + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function resolveUpdatePriority() { + return currentUpdatePriority || DefaultEventPriority; } function shouldAttemptEagerTransition() { return false; @@ -25098,26 +25102,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -25840,8 +25827,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; if (fn) { return fn(); @@ -26999,12 +26986,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; commitRootImpl( root, recoverableErrors, @@ -27407,8 +27394,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 3a1cb8965b..552133f652 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -648,7 +648,6 @@ function clearTransitionsForLanes(root, lanes) { lanes &= ~lane; } } -var currentUpdatePriority = 0; function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -826,7 +825,8 @@ function shouldSetTextContent(type, props) { "string" === typeof props.children || "number" === typeof props.children ); } -var valueStack = [], +var currentUpdatePriority = 0, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -8998,16 +8998,14 @@ var legacyErrorBoundariesThatAlreadyFailed = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; function requestUpdateLane(fiber) { - if (0 === (fiber.mode & 1)) return 2; - if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes) - return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; - if (null !== requestCurrentTransition()) - return ( - (fiber = currentEntangledLane), - 0 !== fiber ? fiber : requestTransitionLane() - ); - fiber = currentUpdatePriority; - return 0 !== fiber ? fiber : 32; + return 0 === (fiber.mode & 1) + ? 2 + : 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes + ? workInProgressRootRenderLanes & -workInProgressRootRenderLanes + : null !== requestCurrentTransition() + ? ((fiber = currentEntangledLane), + 0 !== fiber ? fiber : requestTransitionLane()) + : currentUpdatePriority || 32; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -9352,8 +9350,8 @@ function flushSync(fn) { previousPriority = currentUpdatePriority; try { if ( - ((ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), + ((currentUpdatePriority = 2), + (ReactCurrentBatchConfig.transition = null), fn) ) return fn(); @@ -9787,11 +9785,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition, + previousUpdateLanePriority = currentUpdatePriority; try { - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), + (currentUpdatePriority = 2), + (ReactCurrentBatchConfig.transition = null), commitRootImpl( root, recoverableErrors, @@ -9905,14 +9903,13 @@ function flushPassiveEffects() { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig.transition, + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig.transition, previousPriority = currentUpdatePriority; try { return ( + (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { @@ -10657,7 +10654,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "19.0.0-www-classic-2b02e6e9", + version: "19.0.0-www-classic-ce2e7147", rendererPackageName: "react-art" }; var internals$jscomp$inline_1315 = { @@ -10688,7 +10685,7 @@ var internals$jscomp$inline_1315 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-2b02e6e9" + reconcilerVersion: "19.0.0-www-classic-ce2e7147" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1316 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 9333ab3e4e..ba0c110848 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -524,7 +524,6 @@ function clearTransitionsForLanes(root, lanes) { lanes &= ~lane; } } -var currentUpdatePriority = 0; function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -702,7 +701,8 @@ function shouldSetTextContent(type, props) { "string" === typeof props.children || "number" === typeof props.children ); } -var valueStack = [], +var currentUpdatePriority = 0, + valueStack = [], index = -1; function createCursor(defaultValue) { return { current: defaultValue }; @@ -8539,8 +8539,7 @@ function requestUpdateLane() { var actionScopeLane = currentEntangledLane; return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); } - actionScopeLane = currentUpdatePriority; - return 0 !== actionScopeLane ? actionScopeLane : 32; + return currentUpdatePriority || 32; } function requestDeferredLane() { 0 === workInProgressDeferredLane && @@ -8875,8 +8874,8 @@ function flushSync(fn) { previousPriority = currentUpdatePriority; try { if ( - ((ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), + ((currentUpdatePriority = 2), + (ReactCurrentBatchConfig.transition = null), fn) ) return fn(); @@ -9306,11 +9305,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition, + previousUpdateLanePriority = currentUpdatePriority; try { - (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = 2), + (currentUpdatePriority = 2), + (ReactCurrentBatchConfig.transition = null), commitRootImpl( root, recoverableErrors, @@ -9422,14 +9421,13 @@ function flushPassiveEffects() { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig.transition, + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig.transition, previousPriority = currentUpdatePriority; try { return ( + (currentUpdatePriority = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { @@ -10129,7 +10127,7 @@ var slice = Array.prototype.slice, return null; }, bundleType: 0, - version: "19.0.0-www-modern-e55d9247", + version: "19.0.0-www-modern-8d1012db", rendererPackageName: "react-art" }; var internals$jscomp$inline_1296 = { @@ -10160,7 +10158,7 @@ var internals$jscomp$inline_1296 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-e55d9247" + reconcilerVersion: "19.0.0-www-modern-8d1012db" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1297 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index 5edeb66fd6..c711aa310d 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -1245,6 +1245,139 @@ if (__DEV__) { } } + // $FlowFixMe[method-unbinding] + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /* + * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = + (hasToStringTag && value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; // $FlowFixMe[incompatible-return] + + return type; + } + } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return "" + value; + } + + function checkAttributeStringCoercion(value, attributeName) { + { + if (willCoercionThrow(value)) { + error( + "The provided `%s` attribute is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + attributeName, + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "The provided key is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkCSSPropertyStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error( + "The provided `%s` CSS property is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + propName, + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkHtmlStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "The provided HTML markup uses a value of unsupported type %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkFormFieldValueStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "Form field values (value, checked, defaultValue, or defaultChecked props)" + + " must be strings, not %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback$3 = Scheduler.unstable_scheduleCallback; var cancelCallback$1 = Scheduler.unstable_cancelCallback; @@ -2853,27 +2986,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } - function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - - try { - currentUpdatePriority = priority; - return fn(); - } finally { - currentUpdatePriority = previousPriority; - } - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2883,6 +3000,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2901,136 +3021,64 @@ if (__DEV__) { return IdleEventPriority; } - // $FlowFixMe[method-unbinding] - var hasOwnProperty = Object.prototype.hasOwnProperty; + function noop$3() {} - /* - * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ - // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; - var type = - (hasToStringTag && value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; // $FlowFixMe[incompatible-return] + var DefaultDispatcher = { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + }; + var Internals = { + usingClientEntryPoint: false, + Events: null, + ReactDOMCurrentDispatcher: { + current: DefaultDispatcher + }, + findDOMNode: null, + up: + /* currentUpdatePriority */ + NoEventPriority + }; - return type; - } - } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - - function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } + function setCurrentUpdatePriority( + newPriority, // Closure will consistently not inline this function when it has arity 1 + // however when it has arity 2 even if the second arg is omitted at every + // callsite it seems to inline it even when the internal length of the function + // is much longer. I hope this is consistent enough to rely on across builds + IntentionallyUnusedArgument + ) { + Internals.up = newPriority; } - - function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return "" + value; + function getCurrentUpdatePriority() { + return Internals.up; } + function resolveUpdatePriority() { + var updatePriority = Internals.up; - function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error( - "The provided `%s` attribute is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - attributeName, - typeName(value) - ); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + if (updatePriority !== NoEventPriority) { + return updatePriority; } - } - function checkKeyStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "The provided key is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + var currentEvent = window.event; + + if (currentEvent === undefined) { + return DefaultEventPriority; } - } - function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error( - "The provided `%s` CSS property is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - propName, - typeName(value) - ); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } + return getEventPriority(currentEvent.type); } - function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "The provided HTML markup uses a value of unsupported type %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); + function runWithPriority(priority, fn) { + var previousPriority = getCurrentUpdatePriority(); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } - } - function checkFormFieldValueStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "Form field values (value, checked, defaultValue, or defaultChecked props)" + - " must be strings, not %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + try { + setCurrentUpdatePriority(priority); + return fn(); + } finally { + setCurrentUpdatePriority(previousPriority); } } @@ -11195,7 +11243,7 @@ if (__DEV__) { return status === "fulfilled" || status === "rejected"; } - function noop$3() {} + function noop$2() {} function trackUsedThenable(thenableState, thenable, index) { if (ReactCurrentActQueue$3.current !== null) { @@ -11241,7 +11289,7 @@ if (__DEV__) { } // Avoid an unhandled rejection errors for the Promises that we'll // intentionally ignore. - thenable.then(noop$3, noop$3); + thenable.then(noop$2, noop$2); thenable = previous; } } // We use an expando to track the status and result of a thenable so that we @@ -11270,7 +11318,7 @@ if (__DEV__) { // some custom userspace implementation. We treat it as "pending". // Attach a dummy listener, to ensure that any lazy initialization can // happen. Flight lazily parses JSON when the value is actually awaited. - thenable.then(noop$3, noop$3); + thenable.then(noop$2, noop$2); } else { // This is an uncached thenable that we haven't seen before. // Detect infinite ping loops caused by uncached promises. @@ -31512,26 +31560,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -32337,8 +32368,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; if (fn) { return fn(); @@ -33510,12 +33541,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$1.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; commitRootImpl( root, recoverableErrors, @@ -33969,8 +34000,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig$1.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -36120,7 +36151,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-42b57943"; + var ReactVersion = "19.0.0-www-classic-f2dc8e35"; function createPortal$1( children, @@ -40896,7 +40927,7 @@ if (__DEV__) { return false; } - function noop$2() {} + function noop$1() {} function trapClickOnNonInteractiveElement(node) { // Mobile Safari does not fire properly bubble click events on @@ -40908,7 +40939,7 @@ if (__DEV__) { // bookkeeping for it. Not sure if we need to clear it when the listener is // removed. // TODO: Only do this for the relevant Safaris maybe? - node.onclick = noop$2; + node.onclick = noop$1; } var xlinkNamespace = "http://www.w3.org/1999/xlink"; var xmlNamespace = "http://www.w3.org/XML/1998/namespace"; @@ -44101,26 +44132,6 @@ if (__DEV__) { } } - function noop$1() {} - - var DefaultDispatcher = { - prefetchDNS: noop$1, - preconnect: noop$1, - preload: noop$1, - preloadModule: noop$1, - preinitScript: noop$1, - preinitStyle: noop$1, - preinitModuleScript: noop$1 - }; - var Internals = { - usingClientEntryPoint: false, - Events: null, - ReactDOMCurrentDispatcher: { - current: DefaultDispatcher - }, - findDOMNode: null - }; - var ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher; // Unused var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning"; @@ -44528,15 +44539,6 @@ if (__DEV__) { precacheFiberNode(internalInstanceHandle, textNode); return textNode; } - function getCurrentEventPriority() { - var currentEvent = window.event; - - if (currentEvent === undefined) { - return DefaultEventPriority; - } - - return getEventPriority(currentEvent.type); - } var currentPopstateTransitionEvent = null; function shouldAttemptEagerTransition() { var event = window.event; @@ -47921,9 +47923,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(DiscreteEventPriority); @@ -47940,9 +47942,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(ContinuousEventPriority); diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index c6e8c91bff..9f1bf290b2 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -27,26 +27,6 @@ if (__DEV__) { var Scheduler = require("scheduler"); var React = require("react"); - function noop$3() {} - - var DefaultDispatcher = { - prefetchDNS: noop$3, - preconnect: noop$3, - preload: noop$3, - preloadModule: noop$3, - preinitScript: noop$3, - preinitStyle: noop$3, - preinitModuleScript: noop$3 - }; - var Internals = { - usingClientEntryPoint: false, - Events: null, - ReactDOMCurrentDispatcher: { - current: DefaultDispatcher - }, - findDOMNode: null - }; - // This refers to a WWW module. var warningWWW = require("warning"); @@ -115,25 +95,6 @@ if (__DEV__) { } } - /** - * `ReactInstanceMap` maintains a mapping from a public facing stateful - * instance (key) and the internal representation (value). This allows public - * methods to accept the user facing instance as an argument and map them back - * to internal methods. - * - * Note that this module is currently shared and assumed to be stateless. - * If this becomes an actual Map, that will break. - */ - function get(key) { - return key._reactInternals; - } - function set(key, value) { - key._reactInternals = value; - } - - var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require("ReactFeatureFlags"); @@ -176,341 +137,7 @@ if (__DEV__) { var enableSuspenseCallback = true; var disableLegacyMode = true; - var FunctionComponent = 0; - var ClassComponent = 1; - var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - - var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - - var HostComponent = 5; - var HostText = 6; - var Fragment = 7; - var Mode = 8; - var ContextConsumer = 9; - var ContextProvider = 10; - var ForwardRef = 11; - var Profiler = 12; - var SuspenseComponent = 13; - var MemoComponent = 14; - var SimpleMemoComponent = 15; - var LazyComponent = 16; - var IncompleteClassComponent = 17; - var DehydratedFragment = 18; - var SuspenseListComponent = 19; - var ScopeComponent = 21; - var OffscreenComponent = 22; - var LegacyHiddenComponent = 23; - var CacheComponent = 24; - var TracingMarkerComponent = 25; - var HostHoistable = 26; - var HostSingleton = 27; - var IncompleteFunctionComponent = 28; - - // ATTENTION - // When adding new symbols to this file, - // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' - // The Symbol used to tag the ReactElement-like types. - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); // TODO: Delete with enableRenderableContext - - var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_SCOPE_TYPE = Symbol.for("react.scope"); - var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); - var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); - var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - - var maybeIterator = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === "function") { - return maybeIterator; - } - - return null; - } - - function getWrappedName$1(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - - if (displayName) { - return displayName; - } - - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" - ? wrapperName + "(" + functionName + ")" - : wrapperName; - } // Keep in sync with react-reconciler/getComponentNameFromFiber - - function getContextName$1(type) { - return type.displayName || "Context"; - } - - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. - - function getComponentNameFromType(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - if (typeof type === "function") { - if (type.$$typeof === REACT_CLIENT_REFERENCE) { - // TODO: Create a convention for naming client references with debug info. - return null; - } - - return type.displayName || type.name || null; - } - - if (typeof type === "string") { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - - case REACT_PORTAL_TYPE: - return "Portal"; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - - case REACT_SUSPENSE_TYPE: - return "Suspense"; - - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - // Fall through - - case REACT_TRACING_MARKER_TYPE: - if (enableTransitionTracing) { - return "TracingMarker"; - } - } - - if (typeof type === "object") { - { - if (typeof type.tag === "number") { - error( - "Received an unexpected object in getComponentNameFromType(). " + - "This is likely a bug in React. Please file an issue." - ); - } - } - - switch (type.$$typeof) { - case REACT_PROVIDER_TYPE: - if (enableRenderableContext) { - return null; - } else { - var provider = type; - return getContextName$1(provider._context) + ".Provider"; - } - - case REACT_CONTEXT_TYPE: - var context = type; - - if (enableRenderableContext) { - return getContextName$1(context) + ".Provider"; - } else { - return getContextName$1(context) + ".Consumer"; - } - - case REACT_CONSUMER_TYPE: - if (enableRenderableContext) { - var consumer = type; - return getContextName$1(consumer._context) + ".Consumer"; - } else { - return null; - } - - case REACT_FORWARD_REF_TYPE: - return getWrappedName$1(type, type.render, "ForwardRef"); - - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - - if (outerName !== null) { - return outerName; - } - - return getComponentNameFromType(type.type) || "Memo"; - - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ""; - return ( - outerType.displayName || - (functionName !== "" - ? wrapperName + "(" + functionName + ")" - : wrapperName) - ); - } // Keep in sync with shared/getComponentNameFromType - - function getContextName(type) { - return type.displayName || "Context"; - } - - function getComponentNameFromOwner(owner) { - if (typeof owner.tag === "number") { - return getComponentNameFromFiber(owner); - } - - if (typeof owner.name === "string") { - return owner.name; - } - - return null; - } - function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, - type = fiber.type; - - switch (tag) { - case CacheComponent: - return "Cache"; - - case ContextConsumer: - if (enableRenderableContext) { - var consumer = type; - return getContextName(consumer._context) + ".Consumer"; - } else { - var context = type; - return getContextName(context) + ".Consumer"; - } - - case ContextProvider: - if (enableRenderableContext) { - var _context = type; - return getContextName(_context) + ".Provider"; - } else { - var provider = type; - return getContextName(provider._context) + ".Provider"; - } - - case DehydratedFragment: - return "DehydratedFragment"; - - case ForwardRef: - return getWrappedName(type, type.render, "ForwardRef"); - - case Fragment: - return "Fragment"; - - case HostHoistable: - case HostSingleton: - case HostComponent: - // Host component type is the display name (e.g. "div", "View") - return type; - - case HostPortal: - return "Portal"; - - case HostRoot: - return "Root"; - - case HostText: - return "Text"; - - case LazyComponent: - // Name comes from the type in this case; we don't have a tag. - return getComponentNameFromType(type); - - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - // Don't be less specific than shared/getComponentNameFromType - return "StrictMode"; - } - - return "Mode"; - - case OffscreenComponent: - return "Offscreen"; - - case Profiler: - return "Profiler"; - - case ScopeComponent: - return "Scope"; - - case SuspenseComponent: - return "Suspense"; - - case SuspenseListComponent: - return "SuspenseList"; - - case TracingMarkerComponent: - return "TracingMarker"; - // The display name for these tags come from the user-provided type: - - case IncompleteClassComponent: - case IncompleteFunctionComponent: { - break; - } - - // Fallthrough - - case ClassComponent: - case FunctionComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === "function") { - return type.displayName || type.name || null; - } - - if (typeof type === "string") { - return type; - } - - break; - - case LegacyHiddenComponent: { - return "LegacyHidden"; - } - } - - return null; - } + var assign = Object.assign; var NoFlags$1 = /* */ @@ -647,556 +274,6 @@ if (__DEV__) { var StaticMask = LayoutStatic | PassiveStatic | RefStatic | MaySuspendCommit; - var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; - function getNearestMountedFiber(fiber) { - var node = fiber; - var nearestMounted = fiber; - - if (!fiber.alternate) { - // If there is no alternate, this might be a new tree that isn't inserted - // yet. If it is, then it will have a pending insertion effect on it. - var nextNode = node; - - do { - node = nextNode; - - if ((node.flags & (Placement | Hydrating)) !== NoFlags$1) { - // This is an insertion or in-progress hydration. The nearest possible - // mounted fiber is the parent but we need to continue to figure out - // if that one is still mounted. - nearestMounted = node.return; - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - nextNode = node.return; - } while (nextNode); - } else { - while (node.return) { - node = node.return; - } - } - - if (node.tag === HostRoot) { - // TODO: Check if this was a nested HostRoot when used with - // renderContainerIntoSubtree. - return nearestMounted; - } // If we didn't hit the root, that means that we're in an disconnected tree - // that has been unmounted. - - return null; - } - function getSuspenseInstanceFromFiber(fiber) { - if (fiber.tag === SuspenseComponent) { - var suspenseState = fiber.memoizedState; - - if (suspenseState === null) { - var current = fiber.alternate; - - if (current !== null) { - suspenseState = current.memoizedState; - } - } - - if (suspenseState !== null) { - return suspenseState.dehydrated; - } - } - - return null; - } - function getContainerFromFiber(fiber) { - return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; - } - function isMounted(component) { - { - var owner = ReactCurrentOwner$2.current; - - if (owner !== null && owner.tag === ClassComponent) { - var ownerFiber = owner; - var instance = ownerFiber.stateNode; - - if (!instance._warnedAboutRefsInRender) { - error( - "%s is accessing isMounted inside its render() function. " + - "render() should be a pure function of props and state. It should " + - "never access something that requires stale data from the previous " + - "render, such as refs. Move this logic to componentDidMount and " + - "componentDidUpdate instead.", - getComponentNameFromFiber(ownerFiber) || "A component" - ); - } - - instance._warnedAboutRefsInRender = true; - } - } - - var fiber = get(component); - - if (!fiber) { - return false; - } - - return getNearestMountedFiber(fiber) === fiber; - } - - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) { - throw new Error("Unable to find node on an unmounted component."); - } - } - - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - - if (!alternate) { - // If there is no alternate, then we only need to check if it is mounted. - var nearestMounted = getNearestMountedFiber(fiber); - - if (nearestMounted === null) { - throw new Error("Unable to find node on an unmounted component."); - } - - if (nearestMounted !== fiber) { - return null; - } - - return fiber; - } // If we have two possible branches, we'll walk backwards up to the root - // to see what path the root points to. On the way we may hit one of the - // special cases and we'll deal with them. - - var a = fiber; - var b = alternate; - - while (true) { - var parentA = a.return; - - if (parentA === null) { - // We're at the root. - break; - } - - var parentB = parentA.alternate; - - if (parentB === null) { - // There is no alternate. This is an unusual case. Currently, it only - // happens when a Suspense component is hidden. An extra fragment fiber - // is inserted in between the Suspense fiber and its children. Skip - // over this extra fragment fiber and proceed to the next parent. - var nextParent = parentA.return; - - if (nextParent !== null) { - a = b = nextParent; - continue; - } // If there's no parent, we're at the root. - - break; - } // If both copies of the parent fiber point to the same child, we can - // assume that the child is current. This happens when we bailout on low - // priority: the bailed out fiber's child reuses the current child. - - if (parentA.child === parentB.child) { - var child = parentA.child; - - while (child) { - if (child === a) { - // We've determined that A is the current branch. - assertIsMounted(parentA); - return fiber; - } - - if (child === b) { - // We've determined that B is the current branch. - assertIsMounted(parentA); - return alternate; - } - - child = child.sibling; - } // We should never have an alternate for any mounting node. So the only - // way this could possibly happen is if this was unmounted, if at all. - - throw new Error("Unable to find node on an unmounted component."); - } - - if (a.return !== b.return) { - // The return pointer of A and the return pointer of B point to different - // fibers. We assume that return pointers never criss-cross, so A must - // belong to the child set of A.return, and B must belong to the child - // set of B.return. - a = parentA; - b = parentB; - } else { - // The return pointers point to the same fiber. We'll have to use the - // default, slow path: scan the child sets of each parent alternate to see - // which child belongs to which set. - // - // Search parent A's child set - var didFindChild = false; - var _child = parentA.child; - - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentA; - b = parentB; - break; - } - - if (_child === b) { - didFindChild = true; - b = parentA; - a = parentB; - break; - } - - _child = _child.sibling; - } - - if (!didFindChild) { - // Search parent B's child set - _child = parentB.child; - - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentB; - b = parentA; - break; - } - - if (_child === b) { - didFindChild = true; - b = parentB; - a = parentA; - break; - } - - _child = _child.sibling; - } - - if (!didFindChild) { - throw new Error( - "Child was not found in either parent set. This indicates a bug " + - "in React related to the return pointer. Please file an issue." - ); - } - } - } - - if (a.alternate !== b) { - throw new Error( - "Return fibers should always be each others' alternates. " + - "This error is likely caused by a bug in React. Please file an issue." - ); - } - } // If the root is not a host container, we're in a disconnected tree. I.e. - // unmounted. - - if (a.tag !== HostRoot) { - throw new Error("Unable to find node on an unmounted component."); - } - - if (a.stateNode.current === a) { - // We've determined that A is the current branch. - return fiber; - } // Otherwise B has to be current branch. - - return alternate; - } - function findCurrentHostFiber(parent) { - var currentParent = findCurrentFiberUsingSlowPath(parent); - return currentParent !== null - ? findCurrentHostFiberImpl(currentParent) - : null; - } - - function findCurrentHostFiberImpl(node) { - // Next we'll drill down this component to find the first HostComponent/Text. - var tag = node.tag; - - if ( - tag === HostComponent || - tag === HostHoistable || - tag === HostSingleton || - tag === HostText - ) { - return node; - } - - var child = node.child; - - while (child !== null) { - var match = findCurrentHostFiberImpl(child); - - if (match !== null) { - return match; - } - - child = child.sibling; - } - - return null; - } - - function isFiberSuspenseAndTimedOut(fiber) { - var memoizedState = fiber.memoizedState; - return ( - fiber.tag === SuspenseComponent && - memoizedState !== null && - memoizedState.dehydrated === null - ); - } - function doesFiberContain(parentFiber, childFiber) { - var node = childFiber; - var parentFiberAlternate = parentFiber.alternate; - - while (node !== null) { - if (node === parentFiber || node === parentFiberAlternate) { - return true; - } - - node = node.return; - } - - return false; - } - - var assign = Object.assign; - - var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - - function isArray(a) { - return isArrayImpl(a); - } - - var ReactCurrentDispatcher$3 = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the - // same object across all transitions. - - var sharedNotPendingObject = { - pending: false, - data: null, - method: null, - action: null - }; - var NotPending = Object.freeze(sharedNotPendingObject); - - function resolveDispatcher() { - // Copied from react/src/ReactHooks.js. It's the same thing but in a - // different package. - var dispatcher = ReactCurrentDispatcher$3.current; - - { - if (dispatcher === null) { - error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for" + - " one of the following reasons:\n" + - "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + - "2. You might be breaking the Rules of Hooks\n" + - "3. You might have more than one copy of React in the same app\n" + - "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - } - } // Will result in a null access error if accessed outside render phase. We - // intentionally don't throw our own error because this is in a hot path. - // Also helps ensure this is inlined. - - return dispatcher; - } - - function useFormStatus() { - { - var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above. - - return dispatcher.useHostTransitionStatus(); - } - } - function useFormState(action, initialState, permalink) { - { - var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional - - return dispatcher.useFormState(action, initialState, permalink); - } - } - - var valueStack = []; - var fiberStack; - - { - fiberStack = []; - } - - var index = -1; - - function createCursor(defaultValue) { - return { - current: defaultValue - }; - } - - function pop(cursor, fiber) { - if (index < 0) { - { - error("Unexpected pop."); - } - - return; - } - - { - if (fiber !== fiberStack[index]) { - error("Unexpected Fiber popped."); - } - } - - cursor.current = valueStack[index]; - valueStack[index] = null; - - { - fiberStack[index] = null; - } - - index--; - } - - function push(cursor, value, fiber) { - index++; - valueStack[index] = cursor.current; - - { - fiberStack[index] = fiber; - } - - cursor.current = value; - } - - var contextStackCursor = createCursor(null); - var contextFiberStackCursor = createCursor(null); - var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a
) - // NOTE: Since forms cannot be nested, and this feature is only implemented by - // React DOM, we don't technically need this to be a stack. It could be a single - // module variable instead. - - var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant - // imported from the fiber config. However, because of a cycle in the module - // graph, that value isn't defined during this module's initialization. I can't - // think of a way to work around this without moving that value out of the - // fiber config. For now, the "no provider" case is handled when reading, - // inside useHostTransitionStatus. - - var HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; - - function requiredContext(c) { - { - if (c === null) { - error( - "Expected host context to exist. This error is likely caused by a bug " + - "in React. Please file an issue." - ); - } - } - - return c; - } - - function getCurrentRootHostContainer() { - return rootInstanceStackCursor.current; - } - - function getRootHostContainer() { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - return rootInstance; - } - - function getHostTransitionProvider() { - return hostTransitionProviderCursor.current; - } - - function pushHostContainer(fiber, nextRootInstance) { - // Push current root instance onto the stack; - // This allows us to reset root when portals are popped. - push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. - // However, we can't just call getRootHostContext() and push it because - // we'd have a different number of entries on the stack depending on - // whether getRootHostContext() throws somewhere in renderer code or not. - // So we push an empty value first. This lets us safely unwind on errors. - - push(contextStackCursor, null, fiber); - var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. - - pop(contextStackCursor, fiber); - push(contextStackCursor, nextRootContext, fiber); - } - - function popHostContainer(fiber) { - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); - } - - function getHostContext() { - var context = requiredContext(contextStackCursor.current); - return context; - } - - function pushHostContext(fiber) { - { - var stateHook = fiber.memoizedState; - - if (stateHook !== null) { - // Only provide context if this fiber has been upgraded by a host - // transition. We use the same optimization for regular host context below. - push(hostTransitionProviderCursor, fiber, fiber); - } - } - - var context = requiredContext(contextStackCursor.current); - var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - - if (context !== nextContext) { - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); - } - } - - function popHostContext(fiber) { - if (contextFiberStackCursor.current === fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - } - - { - if (hostTransitionProviderCursor.current === fiber) { - // Do not pop unless this Fiber provided the current context. This is mostly - // a performance optimization, but conveniently it also prevents a potential - // data race where a host provider is upgraded (i.e. memoizedState becomes - // non-null) during a concurrent event. This is a bit of a flaw in the way - // we upgrade host components, but because we're accounting for it here, it - // should be fine. - pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back - // to `null`. We can do this because you're not allowd to nest forms. If - // we allowed for multiple nested host transition providers, then we'd - // need to reset this to the parent provider's status. - - { - HostTransitionContext._currentValue = null; - } - } - } - } - // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback$3 = Scheduler.unstable_scheduleCallback; var cancelCallback$1 = Scheduler.unstable_cancelCallback; @@ -2805,27 +1882,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } - function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - - try { - currentUpdatePriority = priority; - return fn(); - } finally { - currentUpdatePriority = previousPriority; - } - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2835,6 +1896,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2853,6 +1917,932 @@ if (__DEV__) { return IdleEventPriority; } + function noop$3() {} + + var DefaultDispatcher = { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + }; + var Internals = { + usingClientEntryPoint: false, + Events: null, + ReactDOMCurrentDispatcher: { + current: DefaultDispatcher + }, + findDOMNode: null, + up: + /* currentUpdatePriority */ + NoEventPriority + }; + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + function get(key) { + return key._reactInternals; + } + function set(key, value) { + key._reactInternals = value; + } + + var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + var FunctionComponent = 0; + var ClassComponent = 1; + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + var HostHoistable = 26; + var HostSingleton = 27; + var IncompleteFunctionComponent = 28; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); // TODO: Delete with enableRenderableContext + + var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_SCOPE_TYPE = Symbol.for("react.scope"); + var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); + var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); + var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + + var maybeIterator = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === "function") { + return maybeIterator; + } + + return null; + } + + function getWrappedName$1(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + + if (displayName) { + return displayName; + } + + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" + ? wrapperName + "(" + functionName + ")" + : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName$1(type) { + return type.displayName || "Context"; + } + + var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + if (typeof type === "function") { + if (type.$$typeof === REACT_CLIENT_REFERENCE) { + // TODO: Create a convention for naming client references with debug info. + return null; + } + + return type.displayName || type.name || null; + } + + if (typeof type === "string") { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + + case REACT_PORTAL_TYPE: + return "Portal"; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + + case REACT_SUSPENSE_TYPE: + return "Suspense"; + + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + // Fall through + + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) { + return "TracingMarker"; + } + } + + if (typeof type === "object") { + { + if (typeof type.tag === "number") { + error( + "Received an unexpected object in getComponentNameFromType(). " + + "This is likely a bug in React. Please file an issue." + ); + } + } + + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) { + return null; + } else { + var provider = type; + return getContextName$1(provider._context) + ".Provider"; + } + + case REACT_CONTEXT_TYPE: + var context = type; + + if (enableRenderableContext) { + return getContextName$1(context) + ".Provider"; + } else { + return getContextName$1(context) + ".Consumer"; + } + + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) { + var consumer = type; + return getContextName$1(consumer._context) + ".Consumer"; + } else { + return null; + } + + case REACT_FORWARD_REF_TYPE: + return getWrappedName$1(type, type.render, "ForwardRef"); + + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + + if (outerName !== null) { + return outerName; + } + + return getComponentNameFromType(type.type) || "Memo"; + + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return ( + outerType.displayName || + (functionName !== "" + ? wrapperName + "(" + functionName + ")" + : wrapperName) + ); + } // Keep in sync with shared/getComponentNameFromType + + function getContextName(type) { + return type.displayName || "Context"; + } + + function getComponentNameFromOwner(owner) { + if (typeof owner.tag === "number") { + return getComponentNameFromFiber(owner); + } + + if (typeof owner.name === "string") { + return owner.name; + } + + return null; + } + function getComponentNameFromFiber(fiber) { + var tag = fiber.tag, + type = fiber.type; + + switch (tag) { + case CacheComponent: + return "Cache"; + + case ContextConsumer: + if (enableRenderableContext) { + var consumer = type; + return getContextName(consumer._context) + ".Consumer"; + } else { + var context = type; + return getContextName(context) + ".Consumer"; + } + + case ContextProvider: + if (enableRenderableContext) { + var _context = type; + return getContextName(_context) + ".Provider"; + } else { + var provider = type; + return getContextName(provider._context) + ".Provider"; + } + + case DehydratedFragment: + return "DehydratedFragment"; + + case ForwardRef: + return getWrappedName(type, type.render, "ForwardRef"); + + case Fragment: + return "Fragment"; + + case HostHoistable: + case HostSingleton: + case HostComponent: + // Host component type is the display name (e.g. "div", "View") + return type; + + case HostPortal: + return "Portal"; + + case HostRoot: + return "Root"; + + case HostText: + return "Text"; + + case LazyComponent: + // Name comes from the type in this case; we don't have a tag. + return getComponentNameFromType(type); + + case Mode: + if (type === REACT_STRICT_MODE_TYPE) { + // Don't be less specific than shared/getComponentNameFromType + return "StrictMode"; + } + + return "Mode"; + + case OffscreenComponent: + return "Offscreen"; + + case Profiler: + return "Profiler"; + + case ScopeComponent: + return "Scope"; + + case SuspenseComponent: + return "Suspense"; + + case SuspenseListComponent: + return "SuspenseList"; + + case TracingMarkerComponent: + return "TracingMarker"; + // The display name for these tags come from the user-provided type: + + case IncompleteClassComponent: + case IncompleteFunctionComponent: { + break; + } + + // Fallthrough + + case ClassComponent: + case FunctionComponent: + case MemoComponent: + case SimpleMemoComponent: + if (typeof type === "function") { + return type.displayName || type.name || null; + } + + if (typeof type === "string") { + return type; + } + + break; + + case LegacyHiddenComponent: { + return "LegacyHidden"; + } + } + + return null; + } + + var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; + function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = fiber; + + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + var nextNode = node; + + do { + node = nextNode; + + if ((node.flags & (Placement | Hydrating)) !== NoFlags$1) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + return null; + } + function getSuspenseInstanceFromFiber(fiber) { + if (fiber.tag === SuspenseComponent) { + var suspenseState = fiber.memoizedState; + + if (suspenseState === null) { + var current = fiber.alternate; + + if (current !== null) { + suspenseState = current.memoizedState; + } + } + + if (suspenseState !== null) { + return suspenseState.dehydrated; + } + } + + return null; + } + function getContainerFromFiber(fiber) { + return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; + } + function isMounted(component) { + { + var owner = ReactCurrentOwner$2.current; + + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + + if (!instance._warnedAboutRefsInRender) { + error( + "%s is accessing isMounted inside its render() function. " + + "render() should be a pure function of props and state. It should " + + "never access something that requires stale data from the previous " + + "render, such as refs. Move this logic to componentDidMount and " + + "componentDidUpdate instead.", + getComponentNameFromFiber(ownerFiber) || "A component" + ); + } + + instance._warnedAboutRefsInRender = true; + } + } + + var fiber = get(component); + + if (!fiber) { + return false; + } + + return getNearestMountedFiber(fiber) === fiber; + } + + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) { + throw new Error("Unable to find node on an unmounted component."); + } + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var nearestMounted = getNearestMountedFiber(fiber); + + if (nearestMounted === null) { + throw new Error("Unable to find node on an unmounted component."); + } + + if (nearestMounted !== fiber) { + return null; + } + + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + var a = fiber; + var b = alternate; + + while (true) { + var parentA = a.return; + + if (parentA === null) { + // We're at the root. + break; + } + + var parentB = parentA.alternate; + + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + if (parentA.child === parentB.child) { + var child = parentA.child; + + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + throw new Error("Unable to find node on an unmounted component."); + } + + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + + _child = _child.sibling; + } + + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + + _child = _child.sibling; + } + + if (!didFindChild) { + throw new Error( + "Child was not found in either parent set. This indicates a bug " + + "in React related to the return pointer. Please file an issue." + ); + } + } + } + + if (a.alternate !== b) { + throw new Error( + "Return fibers should always be each others' alternates. " + + "This error is likely caused by a bug in React. Please file an issue." + ); + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + if (a.tag !== HostRoot) { + throw new Error("Unable to find node on an unmounted component."); + } + + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + return alternate; + } + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + return currentParent !== null + ? findCurrentHostFiberImpl(currentParent) + : null; + } + + function findCurrentHostFiberImpl(node) { + // Next we'll drill down this component to find the first HostComponent/Text. + var tag = node.tag; + + if ( + tag === HostComponent || + tag === HostHoistable || + tag === HostSingleton || + tag === HostText + ) { + return node; + } + + var child = node.child; + + while (child !== null) { + var match = findCurrentHostFiberImpl(child); + + if (match !== null) { + return match; + } + + child = child.sibling; + } + + return null; + } + + function isFiberSuspenseAndTimedOut(fiber) { + var memoizedState = fiber.memoizedState; + return ( + fiber.tag === SuspenseComponent && + memoizedState !== null && + memoizedState.dehydrated === null + ); + } + function doesFiberContain(parentFiber, childFiber) { + var node = childFiber; + var parentFiberAlternate = parentFiber.alternate; + + while (node !== null) { + if (node === parentFiber || node === parentFiberAlternate) { + return true; + } + + node = node.return; + } + + return false; + } + + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + + var ReactCurrentDispatcher$3 = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the + // same object across all transitions. + + var sharedNotPendingObject = { + pending: false, + data: null, + method: null, + action: null + }; + var NotPending = Object.freeze(sharedNotPendingObject); + + function resolveDispatcher() { + // Copied from react/src/ReactHooks.js. It's the same thing but in a + // different package. + var dispatcher = ReactCurrentDispatcher$3.current; + + { + if (dispatcher === null) { + error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for" + + " one of the following reasons:\n" + + "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + + "2. You might be breaking the Rules of Hooks\n" + + "3. You might have more than one copy of React in the same app\n" + + "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + } + } // Will result in a null access error if accessed outside render phase. We + // intentionally don't throw our own error because this is in a hot path. + // Also helps ensure this is inlined. + + return dispatcher; + } + + function useFormStatus() { + { + var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above. + + return dispatcher.useHostTransitionStatus(); + } + } + function useFormState(action, initialState, permalink) { + { + var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional + + return dispatcher.useFormState(action, initialState, permalink); + } + } + + var valueStack = []; + var fiberStack; + + { + fiberStack = []; + } + + var index = -1; + + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + + function pop(cursor, fiber) { + if (index < 0) { + { + error("Unexpected pop."); + } + + return; + } + + { + if (fiber !== fiberStack[index]) { + error("Unexpected Fiber popped."); + } + } + + cursor.current = valueStack[index]; + valueStack[index] = null; + + { + fiberStack[index] = null; + } + + index--; + } + + function push(cursor, value, fiber) { + index++; + valueStack[index] = cursor.current; + + { + fiberStack[index] = fiber; + } + + cursor.current = value; + } + + var contextStackCursor = createCursor(null); + var contextFiberStackCursor = createCursor(null); + var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) + // NOTE: Since forms cannot be nested, and this feature is only implemented by + // React DOM, we don't technically need this to be a stack. It could be a single + // module variable instead. + + var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant + // imported from the fiber config. However, because of a cycle in the module + // graph, that value isn't defined during this module's initialization. I can't + // think of a way to work around this without moving that value out of the + // fiber config. For now, the "no provider" case is handled when reading, + // inside useHostTransitionStatus. + + var HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; + + function requiredContext(c) { + { + if (c === null) { + error( + "Expected host context to exist. This error is likely caused by a bug " + + "in React. Please file an issue." + ); + } + } + + return c; + } + + function getCurrentRootHostContainer() { + return rootInstanceStackCursor.current; + } + + function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; + } + + function getHostTransitionProvider() { + return hostTransitionProviderCursor.current; + } + + function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + + push(contextStackCursor, null, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. + + pop(contextStackCursor, fiber); + push(contextStackCursor, nextRootContext, fiber); + } + + function popHostContainer(fiber) { + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + + function getHostContext() { + var context = requiredContext(contextStackCursor.current); + return context; + } + + function pushHostContext(fiber) { + { + var stateHook = fiber.memoizedState; + + if (stateHook !== null) { + // Only provide context if this fiber has been upgraded by a host + // transition. We use the same optimization for regular host context below. + push(hostTransitionProviderCursor, fiber, fiber); + } + } + + var context = requiredContext(contextStackCursor.current); + var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. + + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } + } + + function popHostContext(fiber) { + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + } + + { + if (hostTransitionProviderCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. This is mostly + // a performance optimization, but conveniently it also prevents a potential + // data race where a host provider is upgraded (i.e. memoizedState becomes + // non-null) during a concurrent event. This is a bit of a flaw in the way + // we upgrade host components, but because we're accounting for it here, it + // should be fine. + pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back + // to `null`. We can do this because you're not allowd to nest forms. If + // we allowed for multiple nested host transition providers, then we'd + // need to reset this to the parent provider's status. + + { + HostTransitionContext._currentValue = null; + } + } + } + } + // $FlowFixMe[method-unbinding] var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -2986,6 +2976,44 @@ if (__DEV__) { } } + function setCurrentUpdatePriority( + newPriority, // Closure will consistently not inline this function when it has arity 1 + // however when it has arity 2 even if the second arg is omitted at every + // callsite it seems to inline it even when the internal length of the function + // is much longer. I hope this is consistent enough to rely on across builds + IntentionallyUnusedArgument + ) { + Internals.up = newPriority; + } + function getCurrentUpdatePriority() { + return Internals.up; + } + function resolveUpdatePriority() { + var updatePriority = Internals.up; + + if (updatePriority !== NoEventPriority) { + return updatePriority; + } + + var currentEvent = window.event; + + if (currentEvent === undefined) { + return DefaultEventPriority; + } + + return getEventPriority(currentEvent.type); + } + function runWithPriority(priority, fn) { + var previousPriority = getCurrentUpdatePriority(); + + try { + setCurrentUpdatePriority(priority); + return fn(); + } finally { + setCurrentUpdatePriority(previousPriority); + } + } + var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = "__reactFiber$" + randomKey; var internalPropsKey = "__reactProps$" + randomKey; @@ -15313,15 +15341,6 @@ if (__DEV__) { precacheFiberNode(internalInstanceHandle, textNode); return textNode; } - function getCurrentEventPriority() { - var currentEvent = window.event; - - if (currentEvent === undefined) { - return DefaultEventPriority; - } - - return getEventPriority(currentEvent.type); - } var currentPopstateTransitionEvent = null; function shouldAttemptEagerTransition() { var event = window.event; @@ -41139,26 +41158,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -41939,8 +41941,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; if (fn) { return fn(); @@ -43103,12 +43105,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$1.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; commitRootImpl( root, recoverableErrors, @@ -43559,8 +43561,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig$1.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -45614,7 +45616,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-f952ab86"; + var ReactVersion = "19.0.0-www-modern-23cba840"; function createPortal$1( children, @@ -46271,9 +46273,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(DiscreteEventPriority); @@ -46290,9 +46292,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(ContinuousEventPriority); diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 936fef6ac6..5979e36430 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -437,7 +437,8 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue = null)); } -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var hasOwnProperty = Object.prototype.hasOwnProperty, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -717,15 +718,6 @@ function clearTransitionsForLanes(root, lanes) { lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -736,8 +728,33 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - allNativeEvents = new Set(); +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var allNativeEvents = new Set(); allNativeEvents.add("beforeblur"); allNativeEvents.add("afterblur"); var registrationNameDependencies = {}; @@ -1763,7 +1780,7 @@ function prepareToHydrateHostInstance(fiber) { ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), + null != props.onClick && (instance.onclick = noop$1), (instance = !0)) : (instance = !1); !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); @@ -2403,12 +2420,12 @@ function isThenableResolved(thenable) { thenable = thenable.status; return "fulfilled" === thenable || "rejected" === thenable; } -function noop$3() {} +function noop$2() {} function trackUsedThenable(thenableState, thenable, index) { index = thenableState[index]; void 0 === index ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + : index !== thenable && (thenable.then(noop$2, noop$2), (thenable = index)); switch (thenable.status) { case "fulfilled": return thenable.value; @@ -2418,7 +2435,7 @@ function trackUsedThenable(thenableState, thenable, index) { throw Error(formatProdErrorMessage(483)); throw thenableState; default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + if ("string" === typeof thenable.status) thenable.then(noop$2, noop$2); else { thenableState = workInProgressRoot; if (null !== thenableState && 100 < thenableState.shellSuspendCounter) @@ -4088,8 +4105,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -4121,7 +4138,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -9049,7 +9066,7 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (parent = parent._reactRootContainer), (null !== parent && void 0 !== parent) || null !== before.onclick || - (before.onclick = noop$2)); + (before.onclick = noop$1)); else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) for ( insertOrAppendPlacementNodeIntoContainer(node, before, parent), @@ -10795,10 +10812,10 @@ function requestUpdateLane(fiber) { (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane() ); - fiber = currentUpdatePriority; - if (0 !== fiber) return fiber; - fiber = window.event; - fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type); + fiber = Internals.up; + 0 === fiber && + ((fiber = window.event), + (fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type))); return fiber; } function requestDeferredLane() { @@ -11173,16 +11190,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -11617,11 +11630,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -11632,7 +11645,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -11677,8 +11690,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -11698,7 +11711,7 @@ function commitRootImpl( commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else root.current = finishedWork; rootDoesHavePassiveEffects @@ -11762,18 +11775,17 @@ function flushPassiveEffects() { var root$196 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$196, remainingLanes); } @@ -13051,14 +13063,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$349; if (canUseDOM) { - var isSupported$jscomp$inline_1485 = "oninput" in document; - if (!isSupported$jscomp$inline_1485) { - var element$jscomp$inline_1486 = document.createElement("div"); - element$jscomp$inline_1486.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1485 = - "function" === typeof element$jscomp$inline_1486.oninput; + var isSupported$jscomp$inline_1495 = "oninput" in document; + if (!isSupported$jscomp$inline_1495) { + var element$jscomp$inline_1496 = document.createElement("div"); + element$jscomp$inline_1496.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1495 = + "function" === typeof element$jscomp$inline_1496.oninput; } - JSCompiler_inline_result$jscomp$349 = isSupported$jscomp$inline_1485; + JSCompiler_inline_result$jscomp$349 = isSupported$jscomp$inline_1495; } else JSCompiler_inline_result$jscomp$349 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$349 && @@ -13433,20 +13445,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1526 = 0; - i$jscomp$inline_1526 < simpleEventPluginEvents.length; - i$jscomp$inline_1526++ + var i$jscomp$inline_1536 = 0; + i$jscomp$inline_1536 < simpleEventPluginEvents.length; + i$jscomp$inline_1536++ ) { - var eventName$jscomp$inline_1527 = - simpleEventPluginEvents[i$jscomp$inline_1526], - domEventName$jscomp$inline_1528 = - eventName$jscomp$inline_1527.toLowerCase(), - capitalizedEvent$jscomp$inline_1529 = - eventName$jscomp$inline_1527[0].toUpperCase() + - eventName$jscomp$inline_1527.slice(1); + var eventName$jscomp$inline_1537 = + simpleEventPluginEvents[i$jscomp$inline_1536], + domEventName$jscomp$inline_1538 = + eventName$jscomp$inline_1537.toLowerCase(), + capitalizedEvent$jscomp$inline_1539 = + eventName$jscomp$inline_1537[0].toUpperCase() + + eventName$jscomp$inline_1537.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1528, - "on" + capitalizedEvent$jscomp$inline_1529 + domEventName$jscomp$inline_1538, + "on" + capitalizedEvent$jscomp$inline_1539 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14289,7 +14301,7 @@ function checkForUnmatchedText(serverText, clientText) { clientText = normalizeMarkupForTextOrAttribute(clientText); return normalizeMarkupForTextOrAttribute(serverText) === clientText ? !0 : !1; } -function noop$2() {} +function noop$1() {} function setProp(domElement, tag, key, value, props, prevValue) { switch (key) { case "children": @@ -14387,7 +14399,7 @@ function setProp(domElement, tag, key, value, props, prevValue) { domElement.setAttribute(key, value); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "onScroll": null != value && listenToNonDelegatedEvent("scroll", domElement); @@ -14635,7 +14647,7 @@ function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) { null != value && listenToNonDelegatedEvent("scrollend", domElement); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "suppressContentEditableWarning": case "suppressHydrationWarning": @@ -15211,24 +15223,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { (null == propKey$227 && null == propKey) || setProp(domElement, tag, lastProp, propKey$227, nextProps, propKey); } -function noop$1() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$1, - preconnect: noop$1, - preload: noop$1, - preloadModule: noop$1, - preinitScript: noop$1, - preinitStyle: noop$1, - preinitModuleScript: noop$1 - } - }, - findDOMNode: null - }, - ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, +var ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, eventsEnabled = null, selectionInformation = null; function getOwnerDocumentFromRootContainer(rootContainerElement) { @@ -16668,14 +16663,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16685,14 +16680,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16901,7 +16896,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -16974,17 +16969,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1702 = { +var devToolsConfig$jscomp$inline_1716 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-5528dca9", + version: "19.0.0-www-classic-cebfb288", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2132 = { - bundleType: devToolsConfig$jscomp$inline_1702.bundleType, - version: devToolsConfig$jscomp$inline_1702.version, - rendererPackageName: devToolsConfig$jscomp$inline_1702.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1702.rendererConfig, +var internals$jscomp$inline_2152 = { + bundleType: devToolsConfig$jscomp$inline_1716.bundleType, + version: devToolsConfig$jscomp$inline_1716.version, + rendererPackageName: devToolsConfig$jscomp$inline_1716.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1716.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17000,26 +16995,26 @@ var internals$jscomp$inline_2132 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1702.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1716.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-5528dca9" + reconcilerVersion: "19.0.0-www-classic-cebfb288" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2133 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2153 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2133.isDisabled && - hook$jscomp$inline_2133.supportsFiber + !hook$jscomp$inline_2153.isDisabled && + hook$jscomp$inline_2153.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2133.inject( - internals$jscomp$inline_2132 + (rendererID = hook$jscomp$inline_2153.inject( + internals$jscomp$inline_2152 )), - (injectedHook = hook$jscomp$inline_2133); + (injectedHook = hook$jscomp$inline_2153); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -17463,4 +17458,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-5528dca9"; +exports.version = "19.0.0-www-classic-cebfb288"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 65c01ff7f9..f7245f9d45 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -15,41 +15,7 @@ */ "use strict"; var Scheduler = require("scheduler"), - React = require("react"); -function noop$3() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$3, - preconnect: noop$3, - preload: noop$3, - preloadModule: noop$3, - preinitScript: noop$3, - preinitStyle: noop$3, - preinitModuleScript: noop$3 - } - }, - findDOMNode: null -}; -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + React = require("react"), dynamicFeatureFlags = require("ReactFeatureFlags"), disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, enableTrustedTypesIntegration = @@ -80,257 +46,8 @@ var ReactSharedInternals = dynamicFeatureFlags.favorSafetyOverHydrationPerf, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} -Symbol.for("react.client.reference"); -function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; -} -function getSuspenseInstanceFromFiber(fiber) { - if (13 === fiber.tag) { - var suspenseState = fiber.memoizedState; - null === suspenseState && - ((fiber = fiber.alternate), - null !== fiber && (suspenseState = fiber.memoizedState)); - if (null !== suspenseState) return suspenseState.dehydrated; - } - return null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$1 = parentA.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) { - for (child$1 = parentB.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiber(parent) { - parent = findCurrentFiberUsingSlowPath(parent); - return null !== parent ? findCurrentHostFiberImpl(parent) : null; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} -function isFiberSuspenseAndTimedOut(fiber) { - var memoizedState = fiber.memoizedState; - return ( - 13 === fiber.tag && - null !== memoizedState && - null === memoizedState.dehydrated - ); -} -function doesFiberContain(parentFiber, childFiber) { - for ( - var parentFiberAlternate = parentFiber.alternate; - null !== childFiber; - - ) { - if (childFiber === parentFiber || childFiber === parentFiberAlternate) - return !0; - childFiber = childFiber.return; - } - return !1; -} -var assign = Object.assign, - isArrayImpl = Array.isArray, - ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, - sharedNotPendingObject = { - pending: !1, - data: null, - method: null, - action: null - }, - valueStack = [], - index = -1; -function createCursor(defaultValue) { - return { current: defaultValue }; -} -function pop(cursor) { - 0 > index || - ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); -} -function push(cursor, value) { - index++; - valueStack[index] = cursor.current; - cursor.current = value; -} -var contextStackCursor = createCursor(null), - contextFiberStackCursor = createCursor(null), - rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance); - push(contextFiberStackCursor, fiber); - push(contextStackCursor, null); - fiber = nextRootInstance.nodeType; - switch (fiber) { - case 9: - case 11: - nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) - ? (nextRootInstance = nextRootInstance.namespaceURI) - ? getOwnHostContext(nextRootInstance) - : 0 - : 0; - break; - default: - if ( - ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), - (nextRootInstance = fiber.tagName), - (fiber = fiber.namespaceURI)) - ) - (fiber = getOwnHostContext(fiber)), - (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); - else - switch (nextRootInstance) { - case "svg": - nextRootInstance = 1; - break; - case "math": - nextRootInstance = 2; - break; - default: - nextRootInstance = 0; - } - } - pop(contextStackCursor); - push(contextStackCursor, nextRootInstance); -} -function popHostContainer() { - pop(contextStackCursor); - pop(contextFiberStackCursor); - pop(rootInstanceStackCursor); -} -function pushHostContext(fiber) { - null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); - var context = contextStackCursor.current; - var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); - context !== JSCompiler_inline_result && - (push(contextFiberStackCursor, fiber), - push(contextStackCursor, JSCompiler_inline_result)); -} -function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor), pop(contextFiberStackCursor)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor), - (HostTransitionContext._currentValue = null)); -} -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + assign = Object.assign, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -343,6 +60,8 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null; function onCommitRoot(root) { @@ -540,18 +259,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$5 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$5; - remainingLanes[index$5] = 0; - expirationTimes[index$5] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$5]; + var index$3 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$3; + remainingLanes[index$3] = 0; + expirationTimes[index$3] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$3]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$5] = null, index$5 = 0; - index$5 < hiddenUpdatesForLane.length; - index$5++ + hiddenUpdates[index$3] = null, index$3 = 0; + index$3 < hiddenUpdatesForLane.length; + index$3++ ) { - var update = hiddenUpdatesForLane[index$5]; + var update = hiddenUpdatesForLane[index$3]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -571,10 +290,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$6 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$6; - (lane & entangledLanes) | (root[index$6] & entangledLanes) && - (root[index$6] |= entangledLanes); + var index$4 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$4; + (lane & entangledLanes) | (root[index$4] & entangledLanes) && + (root[index$4] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -589,11 +308,11 @@ function upgradePendingLanesToSync(root, lanesToUpgrade) { function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - index$9 = root.transitionLanes[index$9]; - null !== index$9 && - index$9.forEach(function (transition) { + var index$7 = 31 - clz32(lanes), + lane = 1 << index$7; + index$7 = root.transitionLanes[index$7]; + null !== index$7 && + index$7.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -603,22 +322,13 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - null !== root.transitionLanes[index$10] && - (root.transitionLanes[index$10] = null); + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + null !== root.transitionLanes[index$8] && + (root.transitionLanes[index$8] = null); lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -629,8 +339,298 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - randomKey = Math.random().toString(36).slice(2), +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function formatProdErrorMessage(code) { + var url = "https://react.dev/errors/" + code; + if (1 < arguments.length) { + url += "?args[]=" + encodeURIComponent(arguments[1]); + for (var i = 2; i < arguments.length; i++) + url += "&args[]=" + encodeURIComponent(arguments[i]); + } + return ( + "Minified React error #" + + code + + "; visit " + + url + + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." + ); +} +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} +Symbol.for("react.client.reference"); +function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return; ) node = node.return; + else { + fiber = node; + do + (node = fiber), + 0 !== (node.flags & 4098) && (nearestMounted = node.return), + (fiber = node.return); + while (fiber); + } + return 3 === node.tag ? nearestMounted : null; +} +function getSuspenseInstanceFromFiber(fiber) { + if (13 === fiber.tag) { + var suspenseState = fiber.memoizedState; + null === suspenseState && + ((fiber = fiber.alternate), + null !== fiber && (suspenseState = fiber.memoizedState)); + if (null !== suspenseState) return suspenseState.dehydrated; + } + return null; +} +function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error(formatProdErrorMessage(188)); +} +function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) throw Error(formatProdErrorMessage(188)); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error(formatProdErrorMessage(188)); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, child$10 = parentA.child; child$10; ) { + if (child$10 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (child$10 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$10 = child$10.sibling; + } + if (!didFindChild) { + for (child$10 = parentB.child; child$10; ) { + if (child$10 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (child$10 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$10 = child$10.sibling; + } + if (!didFindChild) throw Error(formatProdErrorMessage(189)); + } + } + if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); + } + if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); + return a.stateNode.current === a ? fiber : alternate; +} +function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; +} +function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; + } + return null; +} +function isFiberSuspenseAndTimedOut(fiber) { + var memoizedState = fiber.memoizedState; + return ( + 13 === fiber.tag && + null !== memoizedState && + null === memoizedState.dehydrated + ); +} +function doesFiberContain(parentFiber, childFiber) { + for ( + var parentFiberAlternate = parentFiber.alternate; + null !== childFiber; + + ) { + if (childFiber === parentFiber || childFiber === parentFiberAlternate) + return !0; + childFiber = childFiber.return; + } + return !1; +} +var isArrayImpl = Array.isArray, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + sharedNotPendingObject = { + pending: !1, + data: null, + method: null, + action: null + }, + valueStack = [], + index = -1; +function createCursor(defaultValue) { + return { current: defaultValue }; +} +function pop(cursor) { + 0 > index || + ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); +} +function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; +} +var contextStackCursor = createCursor(null), + contextFiberStackCursor = createCursor(null), + rootInstanceStackCursor = createCursor(null), + hostTransitionProviderCursor = createCursor(null), + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor, null); + fiber = nextRootInstance.nodeType; + switch (fiber) { + case 9: + case 11: + nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) + ? (nextRootInstance = nextRootInstance.namespaceURI) + ? getOwnHostContext(nextRootInstance) + : 0 + : 0; + break; + default: + if ( + ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), + (nextRootInstance = fiber.tagName), + (fiber = fiber.namespaceURI)) + ) + (fiber = getOwnHostContext(fiber)), + (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); + else + switch (nextRootInstance) { + case "svg": + nextRootInstance = 1; + break; + case "math": + nextRootInstance = 2; + break; + default: + nextRootInstance = 0; + } + } + pop(contextStackCursor); + push(contextStackCursor, nextRootInstance); +} +function popHostContainer() { + pop(contextStackCursor); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); +} +function pushHostContext(fiber) { + null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); + var context = contextStackCursor.current; + var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); + context !== JSCompiler_inline_result && + (push(contextFiberStackCursor, fiber), + push(contextStackCursor, JSCompiler_inline_result)); +} +function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor), pop(contextFiberStackCursor)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor), + (HostTransitionContext._currentValue = null)); +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, @@ -2073,14 +2073,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$295; if (canUseDOM) { - var isSupported$jscomp$inline_421 = "oninput" in document; - if (!isSupported$jscomp$inline_421) { - var element$jscomp$inline_422 = document.createElement("div"); - element$jscomp$inline_422.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_421 = - "function" === typeof element$jscomp$inline_422.oninput; + var isSupported$jscomp$inline_426 = "oninput" in document; + if (!isSupported$jscomp$inline_426) { + var element$jscomp$inline_427 = document.createElement("div"); + element$jscomp$inline_427.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_426 = + "function" === typeof element$jscomp$inline_427.oninput; } - JSCompiler_inline_result$jscomp$295 = isSupported$jscomp$inline_421; + JSCompiler_inline_result$jscomp$295 = isSupported$jscomp$inline_426; } else JSCompiler_inline_result$jscomp$295 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$295 && @@ -2510,19 +2510,19 @@ for ( } console.error(error); }, - i$jscomp$inline_462 = 0; - i$jscomp$inline_462 < simpleEventPluginEvents.length; - i$jscomp$inline_462++ + i$jscomp$inline_467 = 0; + i$jscomp$inline_467 < simpleEventPluginEvents.length; + i$jscomp$inline_467++ ) { - var eventName$jscomp$inline_463 = - simpleEventPluginEvents[i$jscomp$inline_462], - domEventName$jscomp$inline_464 = eventName$jscomp$inline_463.toLowerCase(), - capitalizedEvent$jscomp$inline_465 = - eventName$jscomp$inline_463[0].toUpperCase() + - eventName$jscomp$inline_463.slice(1); + var eventName$jscomp$inline_468 = + simpleEventPluginEvents[i$jscomp$inline_467], + domEventName$jscomp$inline_469 = eventName$jscomp$inline_468.toLowerCase(), + capitalizedEvent$jscomp$inline_470 = + eventName$jscomp$inline_468[0].toUpperCase() + + eventName$jscomp$inline_468.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_464, - "on" + capitalizedEvent$jscomp$inline_465 + domEventName$jscomp$inline_469, + "on" + capitalizedEvent$jscomp$inline_470 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5633,12 +5633,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$3 = 31 - clz32(pendingLanes), - lane = 1 << index$3, - expirationTime = expirationTimes[index$3]; + var index$1 = 31 - clz32(pendingLanes), + lane = 1 << index$1, + expirationTime = expirationTimes[index$1]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$3] = computeExpirationTime(lane, currentTime); + expirationTimes[index$1] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -7703,8 +7703,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -7736,7 +7736,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -14100,11 +14100,13 @@ function requestUpdateLane() { var actionScopeLane = currentEntangledLane; return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); } - actionScopeLane = currentUpdatePriority; - if (0 !== actionScopeLane) return actionScopeLane; - actionScopeLane = window.event; - actionScopeLane = - void 0 === actionScopeLane ? 32 : getEventPriority(actionScopeLane.type); + actionScopeLane = Internals.up; + 0 === actionScopeLane && + ((actionScopeLane = window.event), + (actionScopeLane = + void 0 === actionScopeLane + ? 32 + : getEventPriority(actionScopeLane.type))); return actionScopeLane; } function requestDeferredLane() { @@ -14139,11 +14141,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$8 = 31 - clz32(lane), - transitions = transitionLanesMap[index$8]; + index$6 = 31 - clz32(lane), + transitions = transitionLanesMap[index$6]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$8] = transitions; + transitionLanesMap[index$6] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -14402,9 +14404,9 @@ function markRootSuspended(root, suspendedLanes, spawnedLane) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4; - expirationTimes[index$4] = -1; + var index$2 = 31 - clz32(lanes), + lane = 1 << index$2; + expirationTimes[index$2] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14457,16 +14459,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -14522,9 +14520,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$2 = 31 - clz32(allEntangledLanes), - lane = 1 << index$2; - lanes |= root[index$2]; + var index$0 = 31 - clz32(allEntangledLanes), + lane = 1 << index$0; + lanes |= root[index$0]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -14897,11 +14895,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -14912,7 +14910,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -14957,8 +14955,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -14978,7 +14976,7 @@ function commitRootImpl( commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else root.current = finishedWork; rootDoesHavePassiveEffects @@ -15040,18 +15038,17 @@ function flushPassiveEffects() { var root$276 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$276, remainingLanes); } @@ -15724,14 +15721,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -15741,14 +15738,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16275,7 +16272,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -16349,17 +16346,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1685 = { +var devToolsConfig$jscomp$inline_1699 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-1997acbe", + version: "19.0.0-www-modern-2d7322be", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2112 = { - bundleType: devToolsConfig$jscomp$inline_1685.bundleType, - version: devToolsConfig$jscomp$inline_1685.version, - rendererPackageName: devToolsConfig$jscomp$inline_1685.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1685.rendererConfig, +var internals$jscomp$inline_2132 = { + bundleType: devToolsConfig$jscomp$inline_1699.bundleType, + version: devToolsConfig$jscomp$inline_1699.version, + rendererPackageName: devToolsConfig$jscomp$inline_1699.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1699.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16375,26 +16372,26 @@ var internals$jscomp$inline_2112 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1685.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1699.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-1997acbe" + reconcilerVersion: "19.0.0-www-modern-2d7322be" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2113 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2133 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2113.isDisabled && - hook$jscomp$inline_2113.supportsFiber + !hook$jscomp$inline_2133.isDisabled && + hook$jscomp$inline_2133.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2113.inject( - internals$jscomp$inline_2112 + (rendererID = hook$jscomp$inline_2133.inject( + internals$jscomp$inline_2132 )), - (injectedHook = hook$jscomp$inline_2113); + (injectedHook = hook$jscomp$inline_2133); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -16685,4 +16682,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-1997acbe"; +exports.version = "19.0.0-www-modern-2d7322be"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 6856d51bd5..8621de5bbe 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -442,7 +442,8 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue = null)); } -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var hasOwnProperty = Object.prototype.hasOwnProperty, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -853,15 +854,6 @@ function clearTransitionsForLanes(root, lanes) { lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -872,8 +864,33 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - allNativeEvents = new Set(); +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var allNativeEvents = new Set(); allNativeEvents.add("beforeblur"); allNativeEvents.add("afterblur"); var registrationNameDependencies = {}; @@ -1899,7 +1916,7 @@ function prepareToHydrateHostInstance(fiber) { ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), + null != props.onClick && (instance.onclick = noop$1), (instance = !0)) : (instance = !1); !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); @@ -2539,12 +2556,12 @@ function isThenableResolved(thenable) { thenable = thenable.status; return "fulfilled" === thenable || "rejected" === thenable; } -function noop$3() {} +function noop$2() {} function trackUsedThenable(thenableState, thenable, index) { index = thenableState[index]; void 0 === index ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + : index !== thenable && (thenable.then(noop$2, noop$2), (thenable = index)); switch (thenable.status) { case "fulfilled": return thenable.value; @@ -2554,7 +2571,7 @@ function trackUsedThenable(thenableState, thenable, index) { throw Error(formatProdErrorMessage(483)); throw thenableState; default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + if ("string" === typeof thenable.status) thenable.then(noop$2, noop$2); else { thenableState = workInProgressRoot; if (null !== thenableState && 100 < thenableState.shellSuspendCounter) @@ -4224,8 +4241,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -4257,7 +4274,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -9553,7 +9570,7 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (parent = parent._reactRootContainer), (null !== parent && void 0 !== parent) || null !== before.onclick || - (before.onclick = noop$2)); + (before.onclick = noop$1)); else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) for ( insertOrAppendPlacementNodeIntoContainer(node, before, parent), @@ -11386,10 +11403,10 @@ function requestUpdateLane(fiber) { (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane() ); - fiber = currentUpdatePriority; - if (0 !== fiber) return fiber; - fiber = window.event; - fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type); + fiber = Internals.up; + 0 === fiber && + ((fiber = window.event), + (fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type))); return fiber; } function requestDeferredLane() { @@ -11768,16 +11785,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -12290,11 +12303,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -12305,7 +12318,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -12356,8 +12369,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -12388,7 +12401,7 @@ function commitRootImpl( injectedProfilingHooks.markLayoutEffectsStopped(); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else (root.current = finishedWork), (commitTime = now()); rootDoesHavePassiveEffects @@ -12455,18 +12468,17 @@ function flushPassiveEffects() { var root$216 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$216, remainingLanes); } @@ -13799,14 +13811,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$370; if (canUseDOM) { - var isSupported$jscomp$inline_1571 = "oninput" in document; - if (!isSupported$jscomp$inline_1571) { - var element$jscomp$inline_1572 = document.createElement("div"); - element$jscomp$inline_1572.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1571 = - "function" === typeof element$jscomp$inline_1572.oninput; + var isSupported$jscomp$inline_1581 = "oninput" in document; + if (!isSupported$jscomp$inline_1581) { + var element$jscomp$inline_1582 = document.createElement("div"); + element$jscomp$inline_1582.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1581 = + "function" === typeof element$jscomp$inline_1582.oninput; } - JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1571; + JSCompiler_inline_result$jscomp$370 = isSupported$jscomp$inline_1581; } else JSCompiler_inline_result$jscomp$370 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$370 && @@ -14181,20 +14193,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1612 = 0; - i$jscomp$inline_1612 < simpleEventPluginEvents.length; - i$jscomp$inline_1612++ + var i$jscomp$inline_1622 = 0; + i$jscomp$inline_1622 < simpleEventPluginEvents.length; + i$jscomp$inline_1622++ ) { - var eventName$jscomp$inline_1613 = - simpleEventPluginEvents[i$jscomp$inline_1612], - domEventName$jscomp$inline_1614 = - eventName$jscomp$inline_1613.toLowerCase(), - capitalizedEvent$jscomp$inline_1615 = - eventName$jscomp$inline_1613[0].toUpperCase() + - eventName$jscomp$inline_1613.slice(1); + var eventName$jscomp$inline_1623 = + simpleEventPluginEvents[i$jscomp$inline_1622], + domEventName$jscomp$inline_1624 = + eventName$jscomp$inline_1623.toLowerCase(), + capitalizedEvent$jscomp$inline_1625 = + eventName$jscomp$inline_1623[0].toUpperCase() + + eventName$jscomp$inline_1623.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1614, - "on" + capitalizedEvent$jscomp$inline_1615 + domEventName$jscomp$inline_1624, + "on" + capitalizedEvent$jscomp$inline_1625 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15037,7 +15049,7 @@ function checkForUnmatchedText(serverText, clientText) { clientText = normalizeMarkupForTextOrAttribute(clientText); return normalizeMarkupForTextOrAttribute(serverText) === clientText ? !0 : !1; } -function noop$2() {} +function noop$1() {} function setProp(domElement, tag, key, value, props, prevValue) { switch (key) { case "children": @@ -15135,7 +15147,7 @@ function setProp(domElement, tag, key, value, props, prevValue) { domElement.setAttribute(key, value); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "onScroll": null != value && listenToNonDelegatedEvent("scroll", domElement); @@ -15383,7 +15395,7 @@ function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) { null != value && listenToNonDelegatedEvent("scrollend", domElement); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "suppressContentEditableWarning": case "suppressHydrationWarning": @@ -15959,24 +15971,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { (null == propKey$248 && null == propKey) || setProp(domElement, tag, lastProp, propKey$248, nextProps, propKey); } -function noop$1() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$1, - preconnect: noop$1, - preload: noop$1, - preloadModule: noop$1, - preinitScript: noop$1, - preinitStyle: noop$1, - preinitModuleScript: noop$1 - } - }, - findDOMNode: null - }, - ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, +var ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, eventsEnabled = null, selectionInformation = null; function getOwnerDocumentFromRootContainer(rootContainerElement) { @@ -17416,14 +17411,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -17433,14 +17428,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -17649,7 +17644,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -17722,10 +17717,10 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1788 = { +var devToolsConfig$jscomp$inline_1802 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-3938fdc5", + version: "19.0.0-www-classic-34921157", rendererPackageName: "react-dom" }; (function (internals) { @@ -17743,10 +17738,10 @@ var devToolsConfig$jscomp$inline_1788 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1788.bundleType, - version: devToolsConfig$jscomp$inline_1788.version, - rendererPackageName: devToolsConfig$jscomp$inline_1788.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1788.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1802.bundleType, + version: devToolsConfig$jscomp$inline_1802.version, + rendererPackageName: devToolsConfig$jscomp$inline_1802.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1802.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17762,14 +17757,14 @@ var devToolsConfig$jscomp$inline_1788 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1788.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1802.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-3938fdc5" + reconcilerVersion: "19.0.0-www-classic-34921157" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -18212,7 +18207,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-3938fdc5"; +exports.version = "19.0.0-www-classic-34921157"; "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 06b39fc7db..9da6386ad8 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -19,41 +19,7 @@ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var Scheduler = require("scheduler"), - React = require("react"); -function noop$3() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$3, - preconnect: noop$3, - preload: noop$3, - preloadModule: noop$3, - preinitScript: noop$3, - preinitStyle: noop$3, - preinitModuleScript: noop$3 - } - }, - findDOMNode: null -}; -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + React = require("react"), dynamicFeatureFlags = require("ReactFeatureFlags"), disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, enableTrustedTypesIntegration = @@ -85,257 +51,8 @@ var ReactSharedInternals = disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler, - REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} -Symbol.for("react.client.reference"); -function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; -} -function getSuspenseInstanceFromFiber(fiber) { - if (13 === fiber.tag) { - var suspenseState = fiber.memoizedState; - null === suspenseState && - ((fiber = fiber.alternate), - null !== fiber && (suspenseState = fiber.memoizedState)); - if (null !== suspenseState) return suspenseState.dehydrated; - } - return null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$1 = parentA.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) { - for (child$1 = parentB.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiber(parent) { - parent = findCurrentFiberUsingSlowPath(parent); - return null !== parent ? findCurrentHostFiberImpl(parent) : null; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} -function isFiberSuspenseAndTimedOut(fiber) { - var memoizedState = fiber.memoizedState; - return ( - 13 === fiber.tag && - null !== memoizedState && - null === memoizedState.dehydrated - ); -} -function doesFiberContain(parentFiber, childFiber) { - for ( - var parentFiberAlternate = parentFiber.alternate; - null !== childFiber; - - ) { - if (childFiber === parentFiber || childFiber === parentFiberAlternate) - return !0; - childFiber = childFiber.return; - } - return !1; -} -var assign = Object.assign, - isArrayImpl = Array.isArray, - ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, - sharedNotPendingObject = { - pending: !1, - data: null, - method: null, - action: null - }, - valueStack = [], - index = -1; -function createCursor(defaultValue) { - return { current: defaultValue }; -} -function pop(cursor) { - 0 > index || - ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); -} -function push(cursor, value) { - index++; - valueStack[index] = cursor.current; - cursor.current = value; -} -var contextStackCursor = createCursor(null), - contextFiberStackCursor = createCursor(null), - rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance); - push(contextFiberStackCursor, fiber); - push(contextStackCursor, null); - fiber = nextRootInstance.nodeType; - switch (fiber) { - case 9: - case 11: - nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) - ? (nextRootInstance = nextRootInstance.namespaceURI) - ? getOwnHostContext(nextRootInstance) - : 0 - : 0; - break; - default: - if ( - ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), - (nextRootInstance = fiber.tagName), - (fiber = fiber.namespaceURI)) - ) - (fiber = getOwnHostContext(fiber)), - (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); - else - switch (nextRootInstance) { - case "svg": - nextRootInstance = 1; - break; - case "math": - nextRootInstance = 2; - break; - default: - nextRootInstance = 0; - } - } - pop(contextStackCursor); - push(contextStackCursor, nextRootInstance); -} -function popHostContainer() { - pop(contextStackCursor); - pop(contextFiberStackCursor); - pop(rootInstanceStackCursor); -} -function pushHostContext(fiber) { - null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); - var context = contextStackCursor.current; - var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); - context !== JSCompiler_inline_result && - (push(contextFiberStackCursor, fiber), - push(contextStackCursor, JSCompiler_inline_result)); -} -function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor), pop(contextFiberStackCursor)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor), - (HostTransitionContext._currentValue = null)); -} -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + assign = Object.assign, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -348,6 +65,8 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null, injectedProfilingHooks = null, @@ -392,7 +111,7 @@ function injectProfilingHooks(profilingHooks) { } function getLaneLabelMap() { if (enableSchedulingProfiler) { - for (var map = new Map(), lane = 1, index$2 = 0; 31 > index$2; index$2++) { + for (var map = new Map(), lane = 1, index$0 = 0; 31 > index$0; index$0++) { var label = getLabelForLane(lane); map.set(lane, label); lane *= 2; @@ -646,18 +365,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$6 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$6; - remainingLanes[index$6] = 0; - expirationTimes[index$6] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$6]; + var index$4 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$4; + remainingLanes[index$4] = 0; + expirationTimes[index$4] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$4]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$6] = null, index$6 = 0; - index$6 < hiddenUpdatesForLane.length; - index$6++ + hiddenUpdates[index$4] = null, index$4 = 0; + index$4 < hiddenUpdatesForLane.length; + index$4++ ) { - var update = hiddenUpdatesForLane[index$6]; + var update = hiddenUpdatesForLane[index$4]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -677,10 +396,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$7 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$7; - (lane & entangledLanes) | (root[index$7] & entangledLanes) && - (root[index$7] |= entangledLanes); + var index$5 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$5; + (lane & entangledLanes) | (root[index$5] & entangledLanes) && + (root[index$5] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -695,9 +414,9 @@ function upgradePendingLanesToSync(root, lanesToUpgrade) { function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - root[index$9].add(fiber); + var index$7 = 31 - clz32(lanes), + lane = 1 << index$7; + root[index$7].add(fiber); lanes &= ~lane; } } @@ -709,27 +428,27 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$10 = 31 - clz32(lanes); - root = 1 << index$10; - index$10 = pendingUpdatersLaneMap[index$10]; - 0 < index$10.size && - (index$10.forEach(function (fiber) { + var index$8 = 31 - clz32(lanes); + root = 1 << index$8; + index$8 = pendingUpdatersLaneMap[index$8]; + 0 < index$8.size && + (index$8.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$10.clear()); + index$8.clear()); lanes &= ~root; } } function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$12 = 31 - clz32(lanes), - lane = 1 << index$12; - index$12 = root.transitionLanes[index$12]; - null !== index$12 && - index$12.forEach(function (transition) { + var index$10 = 31 - clz32(lanes), + lane = 1 << index$10; + index$10 = root.transitionLanes[index$10]; + null !== index$10 && + index$10.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -739,22 +458,13 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$13 = 31 - clz32(lanes), - lane = 1 << index$13; - null !== root.transitionLanes[index$13] && - (root.transitionLanes[index$13] = null); + var index$11 = 31 - clz32(lanes), + lane = 1 << index$11; + null !== root.transitionLanes[index$11] && + (root.transitionLanes[index$11] = null); lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -765,8 +475,298 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - randomKey = Math.random().toString(36).slice(2), +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function formatProdErrorMessage(code) { + var url = "https://react.dev/errors/" + code; + if (1 < arguments.length) { + url += "?args[]=" + encodeURIComponent(arguments[1]); + for (var i = 2; i < arguments.length; i++) + url += "&args[]=" + encodeURIComponent(arguments[i]); + } + return ( + "Minified React error #" + + code + + "; visit " + + url + + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." + ); +} +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} +Symbol.for("react.client.reference"); +function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return; ) node = node.return; + else { + fiber = node; + do + (node = fiber), + 0 !== (node.flags & 4098) && (nearestMounted = node.return), + (fiber = node.return); + while (fiber); + } + return 3 === node.tag ? nearestMounted : null; +} +function getSuspenseInstanceFromFiber(fiber) { + if (13 === fiber.tag) { + var suspenseState = fiber.memoizedState; + null === suspenseState && + ((fiber = fiber.alternate), + null !== fiber && (suspenseState = fiber.memoizedState)); + if (null !== suspenseState) return suspenseState.dehydrated; + } + return null; +} +function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error(formatProdErrorMessage(188)); +} +function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) throw Error(formatProdErrorMessage(188)); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error(formatProdErrorMessage(188)); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, child$13 = parentA.child; child$13; ) { + if (child$13 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (child$13 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$13 = child$13.sibling; + } + if (!didFindChild) { + for (child$13 = parentB.child; child$13; ) { + if (child$13 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (child$13 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$13 = child$13.sibling; + } + if (!didFindChild) throw Error(formatProdErrorMessage(189)); + } + } + if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); + } + if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); + return a.stateNode.current === a ? fiber : alternate; +} +function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; +} +function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; + } + return null; +} +function isFiberSuspenseAndTimedOut(fiber) { + var memoizedState = fiber.memoizedState; + return ( + 13 === fiber.tag && + null !== memoizedState && + null === memoizedState.dehydrated + ); +} +function doesFiberContain(parentFiber, childFiber) { + for ( + var parentFiberAlternate = parentFiber.alternate; + null !== childFiber; + + ) { + if (childFiber === parentFiber || childFiber === parentFiberAlternate) + return !0; + childFiber = childFiber.return; + } + return !1; +} +var isArrayImpl = Array.isArray, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + sharedNotPendingObject = { + pending: !1, + data: null, + method: null, + action: null + }, + valueStack = [], + index = -1; +function createCursor(defaultValue) { + return { current: defaultValue }; +} +function pop(cursor) { + 0 > index || + ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); +} +function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; +} +var contextStackCursor = createCursor(null), + contextFiberStackCursor = createCursor(null), + rootInstanceStackCursor = createCursor(null), + hostTransitionProviderCursor = createCursor(null), + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor, null); + fiber = nextRootInstance.nodeType; + switch (fiber) { + case 9: + case 11: + nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) + ? (nextRootInstance = nextRootInstance.namespaceURI) + ? getOwnHostContext(nextRootInstance) + : 0 + : 0; + break; + default: + if ( + ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), + (nextRootInstance = fiber.tagName), + (fiber = fiber.namespaceURI)) + ) + (fiber = getOwnHostContext(fiber)), + (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); + else + switch (nextRootInstance) { + case "svg": + nextRootInstance = 1; + break; + case "math": + nextRootInstance = 2; + break; + default: + nextRootInstance = 0; + } + } + pop(contextStackCursor); + push(contextStackCursor, nextRootInstance); +} +function popHostContainer() { + pop(contextStackCursor); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); +} +function pushHostContext(fiber) { + null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); + var context = contextStackCursor.current; + var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); + context !== JSCompiler_inline_result && + (push(contextFiberStackCursor, fiber), + push(contextStackCursor, JSCompiler_inline_result)); +} +function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor), pop(contextFiberStackCursor)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor), + (HostTransitionContext._currentValue = null)); +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, @@ -2209,14 +2209,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$316; if (canUseDOM) { - var isSupported$jscomp$inline_442 = "oninput" in document; - if (!isSupported$jscomp$inline_442) { - var element$jscomp$inline_443 = document.createElement("div"); - element$jscomp$inline_443.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_442 = - "function" === typeof element$jscomp$inline_443.oninput; + var isSupported$jscomp$inline_447 = "oninput" in document; + if (!isSupported$jscomp$inline_447) { + var element$jscomp$inline_448 = document.createElement("div"); + element$jscomp$inline_448.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_447 = + "function" === typeof element$jscomp$inline_448.oninput; } - JSCompiler_inline_result$jscomp$316 = isSupported$jscomp$inline_442; + JSCompiler_inline_result$jscomp$316 = isSupported$jscomp$inline_447; } else JSCompiler_inline_result$jscomp$316 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$316 && @@ -2646,19 +2646,19 @@ for ( } console.error(error); }, - i$jscomp$inline_483 = 0; - i$jscomp$inline_483 < simpleEventPluginEvents.length; - i$jscomp$inline_483++ + i$jscomp$inline_488 = 0; + i$jscomp$inline_488 < simpleEventPluginEvents.length; + i$jscomp$inline_488++ ) { - var eventName$jscomp$inline_484 = - simpleEventPluginEvents[i$jscomp$inline_483], - domEventName$jscomp$inline_485 = eventName$jscomp$inline_484.toLowerCase(), - capitalizedEvent$jscomp$inline_486 = - eventName$jscomp$inline_484[0].toUpperCase() + - eventName$jscomp$inline_484.slice(1); + var eventName$jscomp$inline_489 = + simpleEventPluginEvents[i$jscomp$inline_488], + domEventName$jscomp$inline_490 = eventName$jscomp$inline_489.toLowerCase(), + capitalizedEvent$jscomp$inline_491 = + eventName$jscomp$inline_489[0].toUpperCase() + + eventName$jscomp$inline_489.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_485, - "on" + capitalizedEvent$jscomp$inline_486 + domEventName$jscomp$inline_490, + "on" + capitalizedEvent$jscomp$inline_491 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5769,12 +5769,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$4 = 31 - clz32(pendingLanes), - lane = 1 << index$4, - expirationTime = expirationTimes[index$4]; + var index$2 = 31 - clz32(pendingLanes), + lane = 1 << index$2, + expirationTime = expirationTimes[index$2]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$4] = computeExpirationTime(lane, currentTime); + expirationTimes[index$2] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -7839,8 +7839,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -7872,7 +7872,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -14674,11 +14674,13 @@ function requestUpdateLane() { var actionScopeLane = currentEntangledLane; return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); } - actionScopeLane = currentUpdatePriority; - if (0 !== actionScopeLane) return actionScopeLane; - actionScopeLane = window.event; - actionScopeLane = - void 0 === actionScopeLane ? 32 : getEventPriority(actionScopeLane.type); + actionScopeLane = Internals.up; + 0 === actionScopeLane && + ((actionScopeLane = window.event), + (actionScopeLane = + void 0 === actionScopeLane + ? 32 + : getEventPriority(actionScopeLane.type))); return actionScopeLane; } function requestDeferredLane() { @@ -14714,11 +14716,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$11 = 31 - clz32(lane), - transitions = transitionLanesMap[index$11]; + index$9 = 31 - clz32(lane), + transitions = transitionLanesMap[index$9]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$11] = transitions; + transitionLanesMap[index$9] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -14978,9 +14980,9 @@ function markRootSuspended(root, suspendedLanes, spawnedLane) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5; - expirationTimes[index$5] = -1; + var index$3 = 31 - clz32(lanes), + lane = 1 << index$3; + expirationTimes[index$3] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -15035,16 +15037,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -15100,9 +15098,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$3 = 31 - clz32(allEntangledLanes), - lane = 1 << index$3; - lanes |= root[index$3]; + var index$1 = 31 - clz32(allEntangledLanes), + lane = 1 << index$1; + lanes |= root[index$1]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -15553,11 +15551,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -15568,7 +15566,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -15619,8 +15617,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -15651,7 +15649,7 @@ function commitRootImpl( injectedProfilingHooks.markLayoutEffectsStopped(); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else (root.current = finishedWork), (commitTime = now()); rootDoesHavePassiveEffects @@ -15716,18 +15714,17 @@ function flushPassiveEffects() { var root$296 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$296, remainingLanes); } @@ -16455,14 +16452,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16472,14 +16469,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -17006,7 +17003,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -17080,10 +17077,10 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1771 = { +var devToolsConfig$jscomp$inline_1785 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-d410647d", + version: "19.0.0-www-modern-6416d78c", rendererPackageName: "react-dom" }; (function (internals) { @@ -17101,10 +17098,10 @@ var devToolsConfig$jscomp$inline_1771 = { } catch (err) {} return hook.checkDCE ? !0 : !1; })({ - bundleType: devToolsConfig$jscomp$inline_1771.bundleType, - version: devToolsConfig$jscomp$inline_1771.version, - rendererPackageName: devToolsConfig$jscomp$inline_1771.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1771.rendererConfig, + bundleType: devToolsConfig$jscomp$inline_1785.bundleType, + version: devToolsConfig$jscomp$inline_1785.version, + rendererPackageName: devToolsConfig$jscomp$inline_1785.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1785.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17120,14 +17117,14 @@ var devToolsConfig$jscomp$inline_1771 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1771.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1785.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-d410647d" + reconcilerVersion: "19.0.0-www-modern-6416d78c" }); var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); if ("function" !== typeof ReactFiberErrorDialogWWW.showErrorDialog) @@ -17417,7 +17414,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-d410647d"; +exports.version = "19.0.0-www-modern-6416d78c"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 63f35c82f3..695962ec0c 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -1237,6 +1237,139 @@ if (__DEV__) { } } + // $FlowFixMe[method-unbinding] + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /* + * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol + * and Temporal.* types. See https://github.com/facebook/react/pull/22064. + * + * The functions in this module will throw an easier-to-understand, + * easier-to-debug exception with a clear errors message message explaining the + * problem. (Instead of a confusing exception thrown inside the implementation + * of the `value` object). + */ + // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. + function typeName(value) { + { + // toStringTag is needed for namespaced types like Temporal.Instant + var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; + var type = + (hasToStringTag && value[Symbol.toStringTag]) || + value.constructor.name || + "Object"; // $FlowFixMe[incompatible-return] + + return type; + } + } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. + + function willCoercionThrow(value) { + { + try { + testStringCoercion(value); + return false; + } catch (e) { + return true; + } + } + } + + function testStringCoercion(value) { + // If you ended up here by following an exception call stack, here's what's + // happened: you supplied an object or symbol value to React (as a prop, key, + // DOM attribute, CSS property, string ref, etc.) and when React tried to + // coerce it to a string using `'' + value`, an exception was thrown. + // + // The most common types that will cause this exception are `Symbol` instances + // and Temporal objects like `Temporal.Instant`. But any object that has a + // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this + // exception. (Library authors do this to prevent users from using built-in + // numeric operators like `+` or comparison operators like `>=` because custom + // methods are needed to perform accurate arithmetic or comparison.) + // + // To fix the problem, coerce this object or symbol value to a string before + // passing it to React. The most reliable way is usually `String(value)`. + // + // To find which value is throwing, check the browser or debugger console. + // Before this exception was thrown, there should be `console.error` output + // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the + // problem and how that type was used: key, atrribute, input value prop, etc. + // In most cases, this console output also shows the component and its + // ancestor components where the exception happened. + // + // eslint-disable-next-line react-internal/safe-string-coercion + return "" + value; + } + + function checkAttributeStringCoercion(value, attributeName) { + { + if (willCoercionThrow(value)) { + error( + "The provided `%s` attribute is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + attributeName, + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkKeyStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "The provided key is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkCSSPropertyStringCoercion(value, propName) { + { + if (willCoercionThrow(value)) { + error( + "The provided `%s` CSS property is an unsupported type %s." + + " This value must be coerced to a string before using it here.", + propName, + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkHtmlStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "The provided HTML markup uses a value of unsupported type %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + function checkFormFieldValueStringCoercion(value) { + { + if (willCoercionThrow(value)) { + error( + "Form field values (value, checked, defaultValue, or defaultChecked props)" + + " must be strings, not %s." + + " This value must be coerced to a string before using it here.", + typeName(value) + ); + + return testStringCoercion(value); // throw (to help callers find troubleshooting comments) + } + } + } + // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback$3 = Scheduler.unstable_scheduleCallback; var cancelCallback$1 = Scheduler.unstable_cancelCallback; @@ -2845,27 +2978,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } - function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - - try { - currentUpdatePriority = priority; - return fn(); - } finally { - currentUpdatePriority = previousPriority; - } - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2875,6 +2992,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2893,136 +3013,64 @@ if (__DEV__) { return IdleEventPriority; } - // $FlowFixMe[method-unbinding] - var hasOwnProperty = Object.prototype.hasOwnProperty; + function noop$3() {} - /* - * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ - // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag; - var type = - (hasToStringTag && value[Symbol.toStringTag]) || - value.constructor.name || - "Object"; // $FlowFixMe[incompatible-return] + var DefaultDispatcher = { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + }; + var Internals = { + usingClientEntryPoint: false, + Events: null, + ReactDOMCurrentDispatcher: { + current: DefaultDispatcher + }, + findDOMNode: null, + up: + /* currentUpdatePriority */ + NoEventPriority + }; - return type; - } - } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - - function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } + function setCurrentUpdatePriority( + newPriority, // Closure will consistently not inline this function when it has arity 1 + // however when it has arity 2 even if the second arg is omitted at every + // callsite it seems to inline it even when the internal length of the function + // is much longer. I hope this is consistent enough to rely on across builds + IntentionallyUnusedArgument + ) { + Internals.up = newPriority; } - - function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return "" + value; + function getCurrentUpdatePriority() { + return Internals.up; } + function resolveUpdatePriority() { + var updatePriority = Internals.up; - function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error( - "The provided `%s` attribute is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - attributeName, - typeName(value) - ); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + if (updatePriority !== NoEventPriority) { + return updatePriority; } - } - function checkKeyStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "The provided key is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + var currentEvent = window.event; + + if (currentEvent === undefined) { + return DefaultEventPriority; } - } - function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error( - "The provided `%s` CSS property is an unsupported type %s." + - " This value must be coerced to a string before using it here.", - propName, - typeName(value) - ); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } + return getEventPriority(currentEvent.type); } - function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "The provided HTML markup uses a value of unsupported type %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); + function runWithPriority(priority, fn) { + var previousPriority = getCurrentUpdatePriority(); - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } - } - function checkFormFieldValueStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error( - "Form field values (value, checked, defaultValue, or defaultChecked props)" + - " must be strings, not %s." + - " This value must be coerced to a string before using it here.", - typeName(value) - ); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } + try { + setCurrentUpdatePriority(priority); + return fn(); + } finally { + setCurrentUpdatePriority(previousPriority); } } @@ -11332,7 +11380,7 @@ if (__DEV__) { return status === "fulfilled" || status === "rejected"; } - function noop$3() {} + function noop$2() {} function trackUsedThenable(thenableState, thenable, index) { if (ReactCurrentActQueue$3.current !== null) { @@ -11378,7 +11426,7 @@ if (__DEV__) { } // Avoid an unhandled rejection errors for the Promises that we'll // intentionally ignore. - thenable.then(noop$3, noop$3); + thenable.then(noop$2, noop$2); thenable = previous; } } // We use an expando to track the status and result of a thenable so that we @@ -11407,7 +11455,7 @@ if (__DEV__) { // some custom userspace implementation. We treat it as "pending". // Attach a dummy listener, to ensure that any lazy initialization can // happen. Flight lazily parses JSON when the value is actually awaited. - thenable.then(noop$3, noop$3); + thenable.then(noop$2, noop$2); } else { // This is an uncached thenable that we haven't seen before. // Detect infinite ping loops caused by uncached promises. @@ -32136,26 +32184,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -32961,8 +32992,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; if (fn) { return fn(); @@ -34134,12 +34165,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$1.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; commitRootImpl( root, recoverableErrors, @@ -34593,8 +34624,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig$1.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -36744,7 +36775,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-5448b1f5"; + var ReactVersion = "19.0.0-www-classic-9d1adced"; function createPortal$1( children, @@ -41520,7 +41551,7 @@ if (__DEV__) { return false; } - function noop$2() {} + function noop$1() {} function trapClickOnNonInteractiveElement(node) { // Mobile Safari does not fire properly bubble click events on @@ -41532,7 +41563,7 @@ if (__DEV__) { // bookkeeping for it. Not sure if we need to clear it when the listener is // removed. // TODO: Only do this for the relevant Safaris maybe? - node.onclick = noop$2; + node.onclick = noop$1; } var xlinkNamespace = "http://www.w3.org/1999/xlink"; var xmlNamespace = "http://www.w3.org/XML/1998/namespace"; @@ -44725,26 +44756,6 @@ if (__DEV__) { } } - function noop$1() {} - - var DefaultDispatcher = { - prefetchDNS: noop$1, - preconnect: noop$1, - preload: noop$1, - preloadModule: noop$1, - preinitScript: noop$1, - preinitStyle: noop$1, - preinitModuleScript: noop$1 - }; - var Internals = { - usingClientEntryPoint: false, - Events: null, - ReactDOMCurrentDispatcher: { - current: DefaultDispatcher - }, - findDOMNode: null - }; - var ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher; // Unused var SUPPRESS_HYDRATION_WARNING = "suppressHydrationWarning"; @@ -45152,15 +45163,6 @@ if (__DEV__) { precacheFiberNode(internalInstanceHandle, textNode); return textNode; } - function getCurrentEventPriority() { - var currentEvent = window.event; - - if (currentEvent === undefined) { - return DefaultEventPriority; - } - - return getEventPriority(currentEvent.type); - } var currentPopstateTransitionEvent = null; function shouldAttemptEagerTransition() { var event = window.event; @@ -48677,9 +48679,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(DiscreteEventPriority); @@ -48696,9 +48698,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(ContinuousEventPriority); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index be05704e49..738db3b636 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -19,26 +19,6 @@ if (__DEV__) { var Scheduler = require("scheduler"); var React = require("react"); - function noop$3() {} - - var DefaultDispatcher = { - prefetchDNS: noop$3, - preconnect: noop$3, - preload: noop$3, - preloadModule: noop$3, - preinitScript: noop$3, - preinitStyle: noop$3, - preinitModuleScript: noop$3 - }; - var Internals = { - usingClientEntryPoint: false, - Events: null, - ReactDOMCurrentDispatcher: { - current: DefaultDispatcher - }, - findDOMNode: null - }; - // This refers to a WWW module. var warningWWW = require("warning"); @@ -107,25 +87,6 @@ if (__DEV__) { } } - /** - * `ReactInstanceMap` maintains a mapping from a public facing stateful - * instance (key) and the internal representation (value). This allows public - * methods to accept the user facing instance as an argument and map them back - * to internal methods. - * - * Note that this module is currently shared and assumed to be stateless. - * If this becomes an actual Map, that will break. - */ - function get(key) { - return key._reactInternals; - } - function set(key, value) { - key._reactInternals = value; - } - - var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - // Re-export dynamic flags from the www version. var dynamicFeatureFlags = require("ReactFeatureFlags"); @@ -168,341 +129,7 @@ if (__DEV__) { var enableSuspenseCallback = true; var disableLegacyMode = true; - var FunctionComponent = 0; - var ClassComponent = 1; - var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - - var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - - var HostComponent = 5; - var HostText = 6; - var Fragment = 7; - var Mode = 8; - var ContextConsumer = 9; - var ContextProvider = 10; - var ForwardRef = 11; - var Profiler = 12; - var SuspenseComponent = 13; - var MemoComponent = 14; - var SimpleMemoComponent = 15; - var LazyComponent = 16; - var IncompleteClassComponent = 17; - var DehydratedFragment = 18; - var SuspenseListComponent = 19; - var ScopeComponent = 21; - var OffscreenComponent = 22; - var LegacyHiddenComponent = 23; - var CacheComponent = 24; - var TracingMarkerComponent = 25; - var HostHoistable = 26; - var HostSingleton = 27; - var IncompleteFunctionComponent = 28; - - // ATTENTION - // When adding new symbols to this file, - // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' - // The Symbol used to tag the ReactElement-like types. - var REACT_ELEMENT_TYPE = Symbol.for("react.element"); - var REACT_PORTAL_TYPE = Symbol.for("react.portal"); - var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); - var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); - var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); - var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); // TODO: Delete with enableRenderableContext - - var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"); - var REACT_CONTEXT_TYPE = Symbol.for("react.context"); - var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); - var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); - var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); - var REACT_MEMO_TYPE = Symbol.for("react.memo"); - var REACT_LAZY_TYPE = Symbol.for("react.lazy"); - var REACT_SCOPE_TYPE = Symbol.for("react.scope"); - var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); - var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); - var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); - var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); - var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); - var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = "@@iterator"; - function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable !== "object") { - return null; - } - - var maybeIterator = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable[FAUX_ITERATOR_SYMBOL]; - - if (typeof maybeIterator === "function") { - return maybeIterator; - } - - return null; - } - - function getWrappedName$1(outerType, innerType, wrapperName) { - var displayName = outerType.displayName; - - if (displayName) { - return displayName; - } - - var functionName = innerType.displayName || innerType.name || ""; - return functionName !== "" - ? wrapperName + "(" + functionName + ")" - : wrapperName; - } // Keep in sync with react-reconciler/getComponentNameFromFiber - - function getContextName$1(type) { - return type.displayName || "Context"; - } - - var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. - - function getComponentNameFromType(type) { - if (type == null) { - // Host root, text node or just invalid type. - return null; - } - - if (typeof type === "function") { - if (type.$$typeof === REACT_CLIENT_REFERENCE) { - // TODO: Create a convention for naming client references with debug info. - return null; - } - - return type.displayName || type.name || null; - } - - if (typeof type === "string") { - return type; - } - - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - - case REACT_PORTAL_TYPE: - return "Portal"; - - case REACT_PROFILER_TYPE: - return "Profiler"; - - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - - case REACT_SUSPENSE_TYPE: - return "Suspense"; - - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - // Fall through - - case REACT_TRACING_MARKER_TYPE: - if (enableTransitionTracing) { - return "TracingMarker"; - } - } - - if (typeof type === "object") { - { - if (typeof type.tag === "number") { - error( - "Received an unexpected object in getComponentNameFromType(). " + - "This is likely a bug in React. Please file an issue." - ); - } - } - - switch (type.$$typeof) { - case REACT_PROVIDER_TYPE: - if (enableRenderableContext) { - return null; - } else { - var provider = type; - return getContextName$1(provider._context) + ".Provider"; - } - - case REACT_CONTEXT_TYPE: - var context = type; - - if (enableRenderableContext) { - return getContextName$1(context) + ".Provider"; - } else { - return getContextName$1(context) + ".Consumer"; - } - - case REACT_CONSUMER_TYPE: - if (enableRenderableContext) { - var consumer = type; - return getContextName$1(consumer._context) + ".Consumer"; - } else { - return null; - } - - case REACT_FORWARD_REF_TYPE: - return getWrappedName$1(type, type.render, "ForwardRef"); - - case REACT_MEMO_TYPE: - var outerName = type.displayName || null; - - if (outerName !== null) { - return outerName; - } - - return getComponentNameFromType(type.type) || "Memo"; - - case REACT_LAZY_TYPE: { - var lazyComponent = type; - var payload = lazyComponent._payload; - var init = lazyComponent._init; - - try { - return getComponentNameFromType(init(payload)); - } catch (x) { - return null; - } - } - } - } - - return null; - } - - function getWrappedName(outerType, innerType, wrapperName) { - var functionName = innerType.displayName || innerType.name || ""; - return ( - outerType.displayName || - (functionName !== "" - ? wrapperName + "(" + functionName + ")" - : wrapperName) - ); - } // Keep in sync with shared/getComponentNameFromType - - function getContextName(type) { - return type.displayName || "Context"; - } - - function getComponentNameFromOwner(owner) { - if (typeof owner.tag === "number") { - return getComponentNameFromFiber(owner); - } - - if (typeof owner.name === "string") { - return owner.name; - } - - return null; - } - function getComponentNameFromFiber(fiber) { - var tag = fiber.tag, - type = fiber.type; - - switch (tag) { - case CacheComponent: - return "Cache"; - - case ContextConsumer: - if (enableRenderableContext) { - var consumer = type; - return getContextName(consumer._context) + ".Consumer"; - } else { - var context = type; - return getContextName(context) + ".Consumer"; - } - - case ContextProvider: - if (enableRenderableContext) { - var _context = type; - return getContextName(_context) + ".Provider"; - } else { - var provider = type; - return getContextName(provider._context) + ".Provider"; - } - - case DehydratedFragment: - return "DehydratedFragment"; - - case ForwardRef: - return getWrappedName(type, type.render, "ForwardRef"); - - case Fragment: - return "Fragment"; - - case HostHoistable: - case HostSingleton: - case HostComponent: - // Host component type is the display name (e.g. "div", "View") - return type; - - case HostPortal: - return "Portal"; - - case HostRoot: - return "Root"; - - case HostText: - return "Text"; - - case LazyComponent: - // Name comes from the type in this case; we don't have a tag. - return getComponentNameFromType(type); - - case Mode: - if (type === REACT_STRICT_MODE_TYPE) { - // Don't be less specific than shared/getComponentNameFromType - return "StrictMode"; - } - - return "Mode"; - - case OffscreenComponent: - return "Offscreen"; - - case Profiler: - return "Profiler"; - - case ScopeComponent: - return "Scope"; - - case SuspenseComponent: - return "Suspense"; - - case SuspenseListComponent: - return "SuspenseList"; - - case TracingMarkerComponent: - return "TracingMarker"; - // The display name for these tags come from the user-provided type: - - case IncompleteClassComponent: - case IncompleteFunctionComponent: { - break; - } - - // Fallthrough - - case ClassComponent: - case FunctionComponent: - case MemoComponent: - case SimpleMemoComponent: - if (typeof type === "function") { - return type.displayName || type.name || null; - } - - if (typeof type === "string") { - return type; - } - - break; - - case LegacyHiddenComponent: { - return "LegacyHidden"; - } - } - - return null; - } + var assign = Object.assign; var NoFlags$1 = /* */ @@ -639,556 +266,6 @@ if (__DEV__) { var StaticMask = LayoutStatic | PassiveStatic | RefStatic | MaySuspendCommit; - var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; - function getNearestMountedFiber(fiber) { - var node = fiber; - var nearestMounted = fiber; - - if (!fiber.alternate) { - // If there is no alternate, this might be a new tree that isn't inserted - // yet. If it is, then it will have a pending insertion effect on it. - var nextNode = node; - - do { - node = nextNode; - - if ((node.flags & (Placement | Hydrating)) !== NoFlags$1) { - // This is an insertion or in-progress hydration. The nearest possible - // mounted fiber is the parent but we need to continue to figure out - // if that one is still mounted. - nearestMounted = node.return; - } // $FlowFixMe[incompatible-type] we bail out when we get a null - - nextNode = node.return; - } while (nextNode); - } else { - while (node.return) { - node = node.return; - } - } - - if (node.tag === HostRoot) { - // TODO: Check if this was a nested HostRoot when used with - // renderContainerIntoSubtree. - return nearestMounted; - } // If we didn't hit the root, that means that we're in an disconnected tree - // that has been unmounted. - - return null; - } - function getSuspenseInstanceFromFiber(fiber) { - if (fiber.tag === SuspenseComponent) { - var suspenseState = fiber.memoizedState; - - if (suspenseState === null) { - var current = fiber.alternate; - - if (current !== null) { - suspenseState = current.memoizedState; - } - } - - if (suspenseState !== null) { - return suspenseState.dehydrated; - } - } - - return null; - } - function getContainerFromFiber(fiber) { - return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; - } - function isMounted(component) { - { - var owner = ReactCurrentOwner$2.current; - - if (owner !== null && owner.tag === ClassComponent) { - var ownerFiber = owner; - var instance = ownerFiber.stateNode; - - if (!instance._warnedAboutRefsInRender) { - error( - "%s is accessing isMounted inside its render() function. " + - "render() should be a pure function of props and state. It should " + - "never access something that requires stale data from the previous " + - "render, such as refs. Move this logic to componentDidMount and " + - "componentDidUpdate instead.", - getComponentNameFromFiber(ownerFiber) || "A component" - ); - } - - instance._warnedAboutRefsInRender = true; - } - } - - var fiber = get(component); - - if (!fiber) { - return false; - } - - return getNearestMountedFiber(fiber) === fiber; - } - - function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) { - throw new Error("Unable to find node on an unmounted component."); - } - } - - function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - - if (!alternate) { - // If there is no alternate, then we only need to check if it is mounted. - var nearestMounted = getNearestMountedFiber(fiber); - - if (nearestMounted === null) { - throw new Error("Unable to find node on an unmounted component."); - } - - if (nearestMounted !== fiber) { - return null; - } - - return fiber; - } // If we have two possible branches, we'll walk backwards up to the root - // to see what path the root points to. On the way we may hit one of the - // special cases and we'll deal with them. - - var a = fiber; - var b = alternate; - - while (true) { - var parentA = a.return; - - if (parentA === null) { - // We're at the root. - break; - } - - var parentB = parentA.alternate; - - if (parentB === null) { - // There is no alternate. This is an unusual case. Currently, it only - // happens when a Suspense component is hidden. An extra fragment fiber - // is inserted in between the Suspense fiber and its children. Skip - // over this extra fragment fiber and proceed to the next parent. - var nextParent = parentA.return; - - if (nextParent !== null) { - a = b = nextParent; - continue; - } // If there's no parent, we're at the root. - - break; - } // If both copies of the parent fiber point to the same child, we can - // assume that the child is current. This happens when we bailout on low - // priority: the bailed out fiber's child reuses the current child. - - if (parentA.child === parentB.child) { - var child = parentA.child; - - while (child) { - if (child === a) { - // We've determined that A is the current branch. - assertIsMounted(parentA); - return fiber; - } - - if (child === b) { - // We've determined that B is the current branch. - assertIsMounted(parentA); - return alternate; - } - - child = child.sibling; - } // We should never have an alternate for any mounting node. So the only - // way this could possibly happen is if this was unmounted, if at all. - - throw new Error("Unable to find node on an unmounted component."); - } - - if (a.return !== b.return) { - // The return pointer of A and the return pointer of B point to different - // fibers. We assume that return pointers never criss-cross, so A must - // belong to the child set of A.return, and B must belong to the child - // set of B.return. - a = parentA; - b = parentB; - } else { - // The return pointers point to the same fiber. We'll have to use the - // default, slow path: scan the child sets of each parent alternate to see - // which child belongs to which set. - // - // Search parent A's child set - var didFindChild = false; - var _child = parentA.child; - - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentA; - b = parentB; - break; - } - - if (_child === b) { - didFindChild = true; - b = parentA; - a = parentB; - break; - } - - _child = _child.sibling; - } - - if (!didFindChild) { - // Search parent B's child set - _child = parentB.child; - - while (_child) { - if (_child === a) { - didFindChild = true; - a = parentB; - b = parentA; - break; - } - - if (_child === b) { - didFindChild = true; - b = parentB; - a = parentA; - break; - } - - _child = _child.sibling; - } - - if (!didFindChild) { - throw new Error( - "Child was not found in either parent set. This indicates a bug " + - "in React related to the return pointer. Please file an issue." - ); - } - } - } - - if (a.alternate !== b) { - throw new Error( - "Return fibers should always be each others' alternates. " + - "This error is likely caused by a bug in React. Please file an issue." - ); - } - } // If the root is not a host container, we're in a disconnected tree. I.e. - // unmounted. - - if (a.tag !== HostRoot) { - throw new Error("Unable to find node on an unmounted component."); - } - - if (a.stateNode.current === a) { - // We've determined that A is the current branch. - return fiber; - } // Otherwise B has to be current branch. - - return alternate; - } - function findCurrentHostFiber(parent) { - var currentParent = findCurrentFiberUsingSlowPath(parent); - return currentParent !== null - ? findCurrentHostFiberImpl(currentParent) - : null; - } - - function findCurrentHostFiberImpl(node) { - // Next we'll drill down this component to find the first HostComponent/Text. - var tag = node.tag; - - if ( - tag === HostComponent || - tag === HostHoistable || - tag === HostSingleton || - tag === HostText - ) { - return node; - } - - var child = node.child; - - while (child !== null) { - var match = findCurrentHostFiberImpl(child); - - if (match !== null) { - return match; - } - - child = child.sibling; - } - - return null; - } - - function isFiberSuspenseAndTimedOut(fiber) { - var memoizedState = fiber.memoizedState; - return ( - fiber.tag === SuspenseComponent && - memoizedState !== null && - memoizedState.dehydrated === null - ); - } - function doesFiberContain(parentFiber, childFiber) { - var node = childFiber; - var parentFiberAlternate = parentFiber.alternate; - - while (node !== null) { - if (node === parentFiber || node === parentFiberAlternate) { - return true; - } - - node = node.return; - } - - return false; - } - - var assign = Object.assign; - - var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - - function isArray(a) { - return isArrayImpl(a); - } - - var ReactCurrentDispatcher$3 = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the - // same object across all transitions. - - var sharedNotPendingObject = { - pending: false, - data: null, - method: null, - action: null - }; - var NotPending = Object.freeze(sharedNotPendingObject); - - function resolveDispatcher() { - // Copied from react/src/ReactHooks.js. It's the same thing but in a - // different package. - var dispatcher = ReactCurrentDispatcher$3.current; - - { - if (dispatcher === null) { - error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for" + - " one of the following reasons:\n" + - "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + - "2. You might be breaking the Rules of Hooks\n" + - "3. You might have more than one copy of React in the same app\n" + - "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - } - } // Will result in a null access error if accessed outside render phase. We - // intentionally don't throw our own error because this is in a hot path. - // Also helps ensure this is inlined. - - return dispatcher; - } - - function useFormStatus() { - { - var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above. - - return dispatcher.useHostTransitionStatus(); - } - } - function useFormState(action, initialState, permalink) { - { - var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional - - return dispatcher.useFormState(action, initialState, permalink); - } - } - - var valueStack = []; - var fiberStack; - - { - fiberStack = []; - } - - var index = -1; - - function createCursor(defaultValue) { - return { - current: defaultValue - }; - } - - function pop(cursor, fiber) { - if (index < 0) { - { - error("Unexpected pop."); - } - - return; - } - - { - if (fiber !== fiberStack[index]) { - error("Unexpected Fiber popped."); - } - } - - cursor.current = valueStack[index]; - valueStack[index] = null; - - { - fiberStack[index] = null; - } - - index--; - } - - function push(cursor, value, fiber) { - index++; - valueStack[index] = cursor.current; - - { - fiberStack[index] = fiber; - } - - cursor.current = value; - } - - var contextStackCursor = createCursor(null); - var contextFiberStackCursor = createCursor(null); - var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) - // NOTE: Since forms cannot be nested, and this feature is only implemented by - // React DOM, we don't technically need this to be a stack. It could be a single - // module variable instead. - - var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant - // imported from the fiber config. However, because of a cycle in the module - // graph, that value isn't defined during this module's initialization. I can't - // think of a way to work around this without moving that value out of the - // fiber config. For now, the "no provider" case is handled when reading, - // inside useHostTransitionStatus. - - var HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; - - function requiredContext(c) { - { - if (c === null) { - error( - "Expected host context to exist. This error is likely caused by a bug " + - "in React. Please file an issue." - ); - } - } - - return c; - } - - function getCurrentRootHostContainer() { - return rootInstanceStackCursor.current; - } - - function getRootHostContainer() { - var rootInstance = requiredContext(rootInstanceStackCursor.current); - return rootInstance; - } - - function getHostTransitionProvider() { - return hostTransitionProviderCursor.current; - } - - function pushHostContainer(fiber, nextRootInstance) { - // Push current root instance onto the stack; - // This allows us to reset root when portals are popped. - push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - - push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. - // However, we can't just call getRootHostContext() and push it because - // we'd have a different number of entries on the stack depending on - // whether getRootHostContext() throws somewhere in renderer code or not. - // So we push an empty value first. This lets us safely unwind on errors. - - push(contextStackCursor, null, fiber); - var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. - - pop(contextStackCursor, fiber); - push(contextStackCursor, nextRootContext, fiber); - } - - function popHostContainer(fiber) { - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - pop(rootInstanceStackCursor, fiber); - } - - function getHostContext() { - var context = requiredContext(contextStackCursor.current); - return context; - } - - function pushHostContext(fiber) { - { - var stateHook = fiber.memoizedState; - - if (stateHook !== null) { - // Only provide context if this fiber has been upgraded by a host - // transition. We use the same optimization for regular host context below. - push(hostTransitionProviderCursor, fiber, fiber); - } - } - - var context = requiredContext(contextStackCursor.current); - var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. - - if (context !== nextContext) { - // Track the context and the Fiber that provided it. - // This enables us to pop only Fibers that provide unique contexts. - push(contextFiberStackCursor, fiber, fiber); - push(contextStackCursor, nextContext, fiber); - } - } - - function popHostContext(fiber) { - if (contextFiberStackCursor.current === fiber) { - // Do not pop unless this Fiber provided the current context. - // pushHostContext() only pushes Fibers that provide unique contexts. - pop(contextStackCursor, fiber); - pop(contextFiberStackCursor, fiber); - } - - { - if (hostTransitionProviderCursor.current === fiber) { - // Do not pop unless this Fiber provided the current context. This is mostly - // a performance optimization, but conveniently it also prevents a potential - // data race where a host provider is upgraded (i.e. memoizedState becomes - // non-null) during a concurrent event. This is a bit of a flaw in the way - // we upgrade host components, but because we're accounting for it here, it - // should be fine. - pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back - // to `null`. We can do this because you're not allowd to nest forms. If - // we allowed for multiple nested host transition providers, then we'd - // need to reset this to the parent provider's status. - - { - HostTransitionContext._currentValue = null; - } - } - } - } - // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback$3 = Scheduler.unstable_scheduleCallback; var cancelCallback$1 = Scheduler.unstable_cancelCallback; @@ -2797,27 +1874,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } - function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - - try { - currentUpdatePriority = priority; - return fn(); - } finally { - currentUpdatePriority = previousPriority; - } - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2827,6 +1888,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2845,6 +1909,932 @@ if (__DEV__) { return IdleEventPriority; } + function noop$3() {} + + var DefaultDispatcher = { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + }; + var Internals = { + usingClientEntryPoint: false, + Events: null, + ReactDOMCurrentDispatcher: { + current: DefaultDispatcher + }, + findDOMNode: null, + up: + /* currentUpdatePriority */ + NoEventPriority + }; + + /** + * `ReactInstanceMap` maintains a mapping from a public facing stateful + * instance (key) and the internal representation (value). This allows public + * methods to accept the user facing instance as an argument and map them back + * to internal methods. + * + * Note that this module is currently shared and assumed to be stateless. + * If this becomes an actual Map, that will break. + */ + function get(key) { + return key._reactInternals; + } + function set(key, value) { + key._reactInternals = value; + } + + var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + + var FunctionComponent = 0; + var ClassComponent = 1; + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. + + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. + + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; + var HostHoistable = 26; + var HostSingleton = 27; + var IncompleteFunctionComponent = 28; + + // ATTENTION + // When adding new symbols to this file, + // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' + // The Symbol used to tag the ReactElement-like types. + var REACT_ELEMENT_TYPE = Symbol.for("react.element"); + var REACT_PORTAL_TYPE = Symbol.for("react.portal"); + var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); + var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"); + var REACT_PROFILER_TYPE = Symbol.for("react.profiler"); + var REACT_PROVIDER_TYPE = Symbol.for("react.provider"); // TODO: Delete with enableRenderableContext + + var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"); + var REACT_CONTEXT_TYPE = Symbol.for("react.context"); + var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"); + var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"); + var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"); + var REACT_MEMO_TYPE = Symbol.for("react.memo"); + var REACT_LAZY_TYPE = Symbol.for("react.lazy"); + var REACT_SCOPE_TYPE = Symbol.for("react.scope"); + var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"); + var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); + var REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"); + var REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"); + var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"); + var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = "@@iterator"; + function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable !== "object") { + return null; + } + + var maybeIterator = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable[FAUX_ITERATOR_SYMBOL]; + + if (typeof maybeIterator === "function") { + return maybeIterator; + } + + return null; + } + + function getWrappedName$1(outerType, innerType, wrapperName) { + var displayName = outerType.displayName; + + if (displayName) { + return displayName; + } + + var functionName = innerType.displayName || innerType.name || ""; + return functionName !== "" + ? wrapperName + "(" + functionName + ")" + : wrapperName; + } // Keep in sync with react-reconciler/getComponentNameFromFiber + + function getContextName$1(type) { + return type.displayName || "Context"; + } + + var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. + + function getComponentNameFromType(type) { + if (type == null) { + // Host root, text node or just invalid type. + return null; + } + + if (typeof type === "function") { + if (type.$$typeof === REACT_CLIENT_REFERENCE) { + // TODO: Create a convention for naming client references with debug info. + return null; + } + + return type.displayName || type.name || null; + } + + if (typeof type === "string") { + return type; + } + + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + + case REACT_PORTAL_TYPE: + return "Portal"; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + + case REACT_SUSPENSE_TYPE: + return "Suspense"; + + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + // Fall through + + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) { + return "TracingMarker"; + } + } + + if (typeof type === "object") { + { + if (typeof type.tag === "number") { + error( + "Received an unexpected object in getComponentNameFromType(). " + + "This is likely a bug in React. Please file an issue." + ); + } + } + + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) { + return null; + } else { + var provider = type; + return getContextName$1(provider._context) + ".Provider"; + } + + case REACT_CONTEXT_TYPE: + var context = type; + + if (enableRenderableContext) { + return getContextName$1(context) + ".Provider"; + } else { + return getContextName$1(context) + ".Consumer"; + } + + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) { + var consumer = type; + return getContextName$1(consumer._context) + ".Consumer"; + } else { + return null; + } + + case REACT_FORWARD_REF_TYPE: + return getWrappedName$1(type, type.render, "ForwardRef"); + + case REACT_MEMO_TYPE: + var outerName = type.displayName || null; + + if (outerName !== null) { + return outerName; + } + + return getComponentNameFromType(type.type) || "Memo"; + + case REACT_LAZY_TYPE: { + var lazyComponent = type; + var payload = lazyComponent._payload; + var init = lazyComponent._init; + + try { + return getComponentNameFromType(init(payload)); + } catch (x) { + return null; + } + } + } + } + + return null; + } + + function getWrappedName(outerType, innerType, wrapperName) { + var functionName = innerType.displayName || innerType.name || ""; + return ( + outerType.displayName || + (functionName !== "" + ? wrapperName + "(" + functionName + ")" + : wrapperName) + ); + } // Keep in sync with shared/getComponentNameFromType + + function getContextName(type) { + return type.displayName || "Context"; + } + + function getComponentNameFromOwner(owner) { + if (typeof owner.tag === "number") { + return getComponentNameFromFiber(owner); + } + + if (typeof owner.name === "string") { + return owner.name; + } + + return null; + } + function getComponentNameFromFiber(fiber) { + var tag = fiber.tag, + type = fiber.type; + + switch (tag) { + case CacheComponent: + return "Cache"; + + case ContextConsumer: + if (enableRenderableContext) { + var consumer = type; + return getContextName(consumer._context) + ".Consumer"; + } else { + var context = type; + return getContextName(context) + ".Consumer"; + } + + case ContextProvider: + if (enableRenderableContext) { + var _context = type; + return getContextName(_context) + ".Provider"; + } else { + var provider = type; + return getContextName(provider._context) + ".Provider"; + } + + case DehydratedFragment: + return "DehydratedFragment"; + + case ForwardRef: + return getWrappedName(type, type.render, "ForwardRef"); + + case Fragment: + return "Fragment"; + + case HostHoistable: + case HostSingleton: + case HostComponent: + // Host component type is the display name (e.g. "div", "View") + return type; + + case HostPortal: + return "Portal"; + + case HostRoot: + return "Root"; + + case HostText: + return "Text"; + + case LazyComponent: + // Name comes from the type in this case; we don't have a tag. + return getComponentNameFromType(type); + + case Mode: + if (type === REACT_STRICT_MODE_TYPE) { + // Don't be less specific than shared/getComponentNameFromType + return "StrictMode"; + } + + return "Mode"; + + case OffscreenComponent: + return "Offscreen"; + + case Profiler: + return "Profiler"; + + case ScopeComponent: + return "Scope"; + + case SuspenseComponent: + return "Suspense"; + + case SuspenseListComponent: + return "SuspenseList"; + + case TracingMarkerComponent: + return "TracingMarker"; + // The display name for these tags come from the user-provided type: + + case IncompleteClassComponent: + case IncompleteFunctionComponent: { + break; + } + + // Fallthrough + + case ClassComponent: + case FunctionComponent: + case MemoComponent: + case SimpleMemoComponent: + if (typeof type === "function") { + return type.displayName || type.name || null; + } + + if (typeof type === "string") { + return type; + } + + break; + + case LegacyHiddenComponent: { + return "LegacyHidden"; + } + } + + return null; + } + + var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner; + function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = fiber; + + if (!fiber.alternate) { + // If there is no alternate, this might be a new tree that isn't inserted + // yet. If it is, then it will have a pending insertion effect on it. + var nextNode = node; + + do { + node = nextNode; + + if ((node.flags & (Placement | Hydrating)) !== NoFlags$1) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } // $FlowFixMe[incompatible-type] we bail out when we get a null + + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + return null; + } + function getSuspenseInstanceFromFiber(fiber) { + if (fiber.tag === SuspenseComponent) { + var suspenseState = fiber.memoizedState; + + if (suspenseState === null) { + var current = fiber.alternate; + + if (current !== null) { + suspenseState = current.memoizedState; + } + } + + if (suspenseState !== null) { + return suspenseState.dehydrated; + } + } + + return null; + } + function getContainerFromFiber(fiber) { + return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; + } + function isMounted(component) { + { + var owner = ReactCurrentOwner$2.current; + + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + + if (!instance._warnedAboutRefsInRender) { + error( + "%s is accessing isMounted inside its render() function. " + + "render() should be a pure function of props and state. It should " + + "never access something that requires stale data from the previous " + + "render, such as refs. Move this logic to componentDidMount and " + + "componentDidUpdate instead.", + getComponentNameFromFiber(ownerFiber) || "A component" + ); + } + + instance._warnedAboutRefsInRender = true; + } + } + + var fiber = get(component); + + if (!fiber) { + return false; + } + + return getNearestMountedFiber(fiber) === fiber; + } + + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) { + throw new Error("Unable to find node on an unmounted component."); + } + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + + if (!alternate) { + // If there is no alternate, then we only need to check if it is mounted. + var nearestMounted = getNearestMountedFiber(fiber); + + if (nearestMounted === null) { + throw new Error("Unable to find node on an unmounted component."); + } + + if (nearestMounted !== fiber) { + return null; + } + + return fiber; + } // If we have two possible branches, we'll walk backwards up to the root + // to see what path the root points to. On the way we may hit one of the + // special cases and we'll deal with them. + + var a = fiber; + var b = alternate; + + while (true) { + var parentA = a.return; + + if (parentA === null) { + // We're at the root. + break; + } + + var parentB = parentA.alternate; + + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, we're at the root. + + break; + } // If both copies of the parent fiber point to the same child, we can + // assume that the child is current. This happens when we bailout on low + // priority: the bailed out fiber's child reuses the current child. + + if (parentA.child === parentB.child) { + var child = parentA.child; + + while (child) { + if (child === a) { + // We've determined that A is the current branch. + assertIsMounted(parentA); + return fiber; + } + + if (child === b) { + // We've determined that B is the current branch. + assertIsMounted(parentA); + return alternate; + } + + child = child.sibling; + } // We should never have an alternate for any mounting node. So the only + // way this could possibly happen is if this was unmounted, if at all. + + throw new Error("Unable to find node on an unmounted component."); + } + + if (a.return !== b.return) { + // The return pointer of A and the return pointer of B point to different + // fibers. We assume that return pointers never criss-cross, so A must + // belong to the child set of A.return, and B must belong to the child + // set of B.return. + a = parentA; + b = parentB; + } else { + // The return pointers point to the same fiber. We'll have to use the + // default, slow path: scan the child sets of each parent alternate to see + // which child belongs to which set. + // + // Search parent A's child set + var didFindChild = false; + var _child = parentA.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + + _child = _child.sibling; + } + + if (!didFindChild) { + // Search parent B's child set + _child = parentB.child; + + while (_child) { + if (_child === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + + if (_child === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + + _child = _child.sibling; + } + + if (!didFindChild) { + throw new Error( + "Child was not found in either parent set. This indicates a bug " + + "in React related to the return pointer. Please file an issue." + ); + } + } + } + + if (a.alternate !== b) { + throw new Error( + "Return fibers should always be each others' alternates. " + + "This error is likely caused by a bug in React. Please file an issue." + ); + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + if (a.tag !== HostRoot) { + throw new Error("Unable to find node on an unmounted component."); + } + + if (a.stateNode.current === a) { + // We've determined that A is the current branch. + return fiber; + } // Otherwise B has to be current branch. + + return alternate; + } + function findCurrentHostFiber(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + return currentParent !== null + ? findCurrentHostFiberImpl(currentParent) + : null; + } + + function findCurrentHostFiberImpl(node) { + // Next we'll drill down this component to find the first HostComponent/Text. + var tag = node.tag; + + if ( + tag === HostComponent || + tag === HostHoistable || + tag === HostSingleton || + tag === HostText + ) { + return node; + } + + var child = node.child; + + while (child !== null) { + var match = findCurrentHostFiberImpl(child); + + if (match !== null) { + return match; + } + + child = child.sibling; + } + + return null; + } + + function isFiberSuspenseAndTimedOut(fiber) { + var memoizedState = fiber.memoizedState; + return ( + fiber.tag === SuspenseComponent && + memoizedState !== null && + memoizedState.dehydrated === null + ); + } + function doesFiberContain(parentFiber, childFiber) { + var node = childFiber; + var parentFiberAlternate = parentFiber.alternate; + + while (node !== null) { + if (node === parentFiber || node === parentFiberAlternate) { + return true; + } + + node = node.return; + } + + return false; + } + + var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare + + function isArray(a) { + return isArrayImpl(a); + } + + var ReactCurrentDispatcher$3 = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the + // same object across all transitions. + + var sharedNotPendingObject = { + pending: false, + data: null, + method: null, + action: null + }; + var NotPending = Object.freeze(sharedNotPendingObject); + + function resolveDispatcher() { + // Copied from react/src/ReactHooks.js. It's the same thing but in a + // different package. + var dispatcher = ReactCurrentDispatcher$3.current; + + { + if (dispatcher === null) { + error( + "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for" + + " one of the following reasons:\n" + + "1. You might have mismatching versions of React and the renderer (such as React DOM)\n" + + "2. You might be breaking the Rules of Hooks\n" + + "3. You might have more than one copy of React in the same app\n" + + "See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); + } + } // Will result in a null access error if accessed outside render phase. We + // intentionally don't throw our own error because this is in a hot path. + // Also helps ensure this is inlined. + + return dispatcher; + } + + function useFormStatus() { + { + var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above. + + return dispatcher.useHostTransitionStatus(); + } + } + function useFormState(action, initialState, permalink) { + { + var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional + + return dispatcher.useFormState(action, initialState, permalink); + } + } + + var valueStack = []; + var fiberStack; + + { + fiberStack = []; + } + + var index = -1; + + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + + function pop(cursor, fiber) { + if (index < 0) { + { + error("Unexpected pop."); + } + + return; + } + + { + if (fiber !== fiberStack[index]) { + error("Unexpected Fiber popped."); + } + } + + cursor.current = valueStack[index]; + valueStack[index] = null; + + { + fiberStack[index] = null; + } + + index--; + } + + function push(cursor, value, fiber) { + index++; + valueStack[index] = cursor.current; + + { + fiberStack[index] = fiber; + } + + cursor.current = value; + } + + var contextStackCursor = createCursor(null); + var contextFiberStackCursor = createCursor(null); + var rootInstanceStackCursor = createCursor(null); // Represents the nearest host transition provider (in React DOM, a ) + // NOTE: Since forms cannot be nested, and this feature is only implemented by + // React DOM, we don't technically need this to be a stack. It could be a single + // module variable instead. + + var hostTransitionProviderCursor = createCursor(null); // TODO: This should initialize to NotPendingTransition, a constant + // imported from the fiber config. However, because of a cycle in the module + // graph, that value isn't defined during this module's initialization. I can't + // think of a way to work around this without moving that value out of the + // fiber config. For now, the "no provider" case is handled when reading, + // inside useHostTransitionStatus. + + var HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; + + function requiredContext(c) { + { + if (c === null) { + error( + "Expected host context to exist. This error is likely caused by a bug " + + "in React. Please file an issue." + ); + } + } + + return c; + } + + function getCurrentRootHostContainer() { + return rootInstanceStackCursor.current; + } + + function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; + } + + function getHostTransitionProvider() { + return hostTransitionProviderCursor.current; + } + + function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + + push(contextStackCursor, null, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. + + pop(contextStackCursor, fiber); + push(contextStackCursor, nextRootContext, fiber); + } + + function popHostContainer(fiber) { + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); + } + + function getHostContext() { + var context = requiredContext(contextStackCursor.current); + return context; + } + + function pushHostContext(fiber) { + { + var stateHook = fiber.memoizedState; + + if (stateHook !== null) { + // Only provide context if this fiber has been upgraded by a host + // transition. We use the same optimization for regular host context below. + push(hostTransitionProviderCursor, fiber, fiber); + } + } + + var context = requiredContext(contextStackCursor.current); + var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. + + if (context !== nextContext) { + // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor, nextContext, fiber); + } + } + + function popHostContext(fiber) { + if (contextFiberStackCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + pop(contextStackCursor, fiber); + pop(contextFiberStackCursor, fiber); + } + + { + if (hostTransitionProviderCursor.current === fiber) { + // Do not pop unless this Fiber provided the current context. This is mostly + // a performance optimization, but conveniently it also prevents a potential + // data race where a host provider is upgraded (i.e. memoizedState becomes + // non-null) during a concurrent event. This is a bit of a flaw in the way + // we upgrade host components, but because we're accounting for it here, it + // should be fine. + pop(hostTransitionProviderCursor, fiber); // When popping the transition provider, we reset the context value back + // to `null`. We can do this because you're not allowd to nest forms. If + // we allowed for multiple nested host transition providers, then we'd + // need to reset this to the parent provider's status. + + { + HostTransitionContext._currentValue = null; + } + } + } + } + // $FlowFixMe[method-unbinding] var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -2978,6 +2968,44 @@ if (__DEV__) { } } + function setCurrentUpdatePriority( + newPriority, // Closure will consistently not inline this function when it has arity 1 + // however when it has arity 2 even if the second arg is omitted at every + // callsite it seems to inline it even when the internal length of the function + // is much longer. I hope this is consistent enough to rely on across builds + IntentionallyUnusedArgument + ) { + Internals.up = newPriority; + } + function getCurrentUpdatePriority() { + return Internals.up; + } + function resolveUpdatePriority() { + var updatePriority = Internals.up; + + if (updatePriority !== NoEventPriority) { + return updatePriority; + } + + var currentEvent = window.event; + + if (currentEvent === undefined) { + return DefaultEventPriority; + } + + return getEventPriority(currentEvent.type); + } + function runWithPriority(priority, fn) { + var previousPriority = getCurrentUpdatePriority(); + + try { + setCurrentUpdatePriority(priority); + return fn(); + } finally { + setCurrentUpdatePriority(previousPriority); + } + } + var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = "__reactFiber$" + randomKey; var internalPropsKey = "__reactProps$" + randomKey; @@ -15450,15 +15478,6 @@ if (__DEV__) { precacheFiberNode(internalInstanceHandle, textNode); return textNode; } - function getCurrentEventPriority() { - var currentEvent = window.event; - - if (currentEvent === undefined) { - return DefaultEventPriority; - } - - return getEventPriority(currentEvent.type); - } var currentPopstateTransitionEvent = null; function shouldAttemptEagerTransition() { var event = window.event; @@ -41895,26 +41914,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -42695,8 +42697,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; if (fn) { return fn(); @@ -43859,12 +43861,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$1.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig$1.transition = null; commitRootImpl( root, recoverableErrors, @@ -44315,8 +44317,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig$1.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig$1.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -46370,7 +46372,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-42782f6f"; + var ReactVersion = "19.0.0-www-modern-4ef02bf5"; function createPortal$1( children, @@ -47027,9 +47029,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(DiscreteEventPriority); @@ -47046,9 +47048,9 @@ if (__DEV__) { container, nativeEvent ) { - var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = getCurrentUpdatePriority(); try { setCurrentUpdatePriority(ContinuousEventPriority); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index 7f2b377d81..61cd4e8936 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -437,7 +437,8 @@ function popHostContext(fiber) { (pop(hostTransitionProviderCursor), (HostTransitionContext._currentValue = null)); } -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, +var hasOwnProperty = Object.prototype.hasOwnProperty, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -717,15 +718,6 @@ function clearTransitionsForLanes(root, lanes) { lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -736,52 +728,77 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - tagToRoleMappings = { - ARTICLE: "article", - ASIDE: "complementary", - BODY: "document", - BUTTON: "button", - DATALIST: "listbox", - DD: "definition", - DETAILS: "group", - DIALOG: "dialog", - DT: "term", - FIELDSET: "group", - FIGURE: "figure", - FORM: "form", - FOOTER: "contentinfo", - H1: "heading", - H2: "heading", - H3: "heading", - H4: "heading", - H5: "heading", - H6: "heading", - HEADER: "banner", - HR: "separator", - LEGEND: "legend", - LI: "listitem", - MATH: "math", - MAIN: "main", - MENU: "list", - NAV: "navigation", - OL: "list", - OPTGROUP: "group", - OPTION: "option", - OUTPUT: "status", - PROGRESS: "progressbar", - SECTION: "region", - SUMMARY: "button", - TABLE: "table", - TBODY: "rowgroup", - TEXTAREA: "textbox", - TFOOT: "rowgroup", - TD: "cell", - TH: "columnheader", - THEAD: "rowgroup", - TR: "row", - UL: "list" - }; +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var tagToRoleMappings = { + ARTICLE: "article", + ASIDE: "complementary", + BODY: "document", + BUTTON: "button", + DATALIST: "listbox", + DD: "definition", + DETAILS: "group", + DIALOG: "dialog", + DT: "term", + FIELDSET: "group", + FIGURE: "figure", + FORM: "form", + FOOTER: "contentinfo", + H1: "heading", + H2: "heading", + H3: "heading", + H4: "heading", + H5: "heading", + H6: "heading", + HEADER: "banner", + HR: "separator", + LEGEND: "legend", + LI: "listitem", + MATH: "math", + MAIN: "main", + MENU: "list", + NAV: "navigation", + OL: "list", + OPTGROUP: "group", + OPTION: "option", + OUTPUT: "status", + PROGRESS: "progressbar", + SECTION: "region", + SUMMARY: "button", + TABLE: "table", + TBODY: "rowgroup", + TEXTAREA: "textbox", + TFOOT: "rowgroup", + TD: "cell", + TH: "columnheader", + THEAD: "rowgroup", + TR: "row", + UL: "list" +}; function getImplicitRole(element) { var mappedByTag = tagToRoleMappings[element.tagName]; if (void 0 !== mappedByTag) return mappedByTag; @@ -1849,7 +1866,7 @@ function prepareToHydrateHostInstance(fiber) { ? (null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), + null != props.onClick && (instance.onclick = noop$1), (instance = !0)) : (instance = !1); !instance && favorSafetyOverHydrationPerf && throwOnHydrationMismatch(fiber); @@ -2489,12 +2506,12 @@ function isThenableResolved(thenable) { thenable = thenable.status; return "fulfilled" === thenable || "rejected" === thenable; } -function noop$3() {} +function noop$2() {} function trackUsedThenable(thenableState, thenable, index) { index = thenableState[index]; void 0 === index ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + : index !== thenable && (thenable.then(noop$2, noop$2), (thenable = index)); switch (thenable.status) { case "fulfilled": return thenable.value; @@ -2504,7 +2521,7 @@ function trackUsedThenable(thenableState, thenable, index) { throw Error(formatProdErrorMessage(483)); throw thenableState; default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + if ("string" === typeof thenable.status) thenable.then(noop$2, noop$2); else { thenableState = workInProgressRoot; if (null !== thenableState && 100 < thenableState.shellSuspendCounter) @@ -4174,8 +4191,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -4207,7 +4224,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -9135,7 +9152,7 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (parent = parent._reactRootContainer), (null !== parent && void 0 !== parent) || null !== before.onclick || - (before.onclick = noop$2)); + (before.onclick = noop$1)); else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) for ( insertOrAppendPlacementNodeIntoContainer(node, before, parent), @@ -11067,10 +11084,10 @@ function requestUpdateLane(fiber) { (fiber = currentEntangledLane), 0 !== fiber ? fiber : requestTransitionLane() ); - fiber = currentUpdatePriority; - if (0 !== fiber) return fiber; - fiber = window.event; - fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type); + fiber = Internals.up; + 0 === fiber && + ((fiber = window.event), + (fiber = void 0 === fiber ? 32 : getEventPriority(fiber.type))); return fiber; } function requestDeferredLane() { @@ -11445,16 +11462,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -11889,11 +11902,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -11904,7 +11917,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -11949,8 +11962,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -11970,7 +11983,7 @@ function commitRootImpl( commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else root.current = finishedWork; rootDoesHavePassiveEffects @@ -12034,18 +12047,17 @@ function flushPassiveEffects() { var root$197 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$197, remainingLanes); } @@ -13323,14 +13335,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$351; if (canUseDOM) { - var isSupported$jscomp$inline_1512 = "oninput" in document; - if (!isSupported$jscomp$inline_1512) { - var element$jscomp$inline_1513 = document.createElement("div"); - element$jscomp$inline_1513.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1512 = - "function" === typeof element$jscomp$inline_1513.oninput; + var isSupported$jscomp$inline_1522 = "oninput" in document; + if (!isSupported$jscomp$inline_1522) { + var element$jscomp$inline_1523 = document.createElement("div"); + element$jscomp$inline_1523.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1522 = + "function" === typeof element$jscomp$inline_1523.oninput; } - JSCompiler_inline_result$jscomp$351 = isSupported$jscomp$inline_1512; + JSCompiler_inline_result$jscomp$351 = isSupported$jscomp$inline_1522; } else JSCompiler_inline_result$jscomp$351 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$351 && @@ -13705,20 +13717,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1553 = 0; - i$jscomp$inline_1553 < simpleEventPluginEvents.length; - i$jscomp$inline_1553++ + var i$jscomp$inline_1563 = 0; + i$jscomp$inline_1563 < simpleEventPluginEvents.length; + i$jscomp$inline_1563++ ) { - var eventName$jscomp$inline_1554 = - simpleEventPluginEvents[i$jscomp$inline_1553], - domEventName$jscomp$inline_1555 = - eventName$jscomp$inline_1554.toLowerCase(), - capitalizedEvent$jscomp$inline_1556 = - eventName$jscomp$inline_1554[0].toUpperCase() + - eventName$jscomp$inline_1554.slice(1); + var eventName$jscomp$inline_1564 = + simpleEventPluginEvents[i$jscomp$inline_1563], + domEventName$jscomp$inline_1565 = + eventName$jscomp$inline_1564.toLowerCase(), + capitalizedEvent$jscomp$inline_1566 = + eventName$jscomp$inline_1564[0].toUpperCase() + + eventName$jscomp$inline_1564.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1555, - "on" + capitalizedEvent$jscomp$inline_1556 + domEventName$jscomp$inline_1565, + "on" + capitalizedEvent$jscomp$inline_1566 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14561,7 +14573,7 @@ function checkForUnmatchedText(serverText, clientText) { clientText = normalizeMarkupForTextOrAttribute(clientText); return normalizeMarkupForTextOrAttribute(serverText) === clientText ? !0 : !1; } -function noop$2() {} +function noop$1() {} function setProp(domElement, tag, key, value, props, prevValue) { switch (key) { case "children": @@ -14659,7 +14671,7 @@ function setProp(domElement, tag, key, value, props, prevValue) { domElement.setAttribute(key, value); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "onScroll": null != value && listenToNonDelegatedEvent("scroll", domElement); @@ -14907,7 +14919,7 @@ function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) { null != value && listenToNonDelegatedEvent("scrollend", domElement); break; case "onClick": - null != value && (domElement.onclick = noop$2); + null != value && (domElement.onclick = noop$1); break; case "suppressContentEditableWarning": case "suppressHydrationWarning": @@ -15483,24 +15495,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { (null == propKey$228 && null == propKey) || setProp(domElement, tag, lastProp, propKey$228, nextProps, propKey); } -function noop$1() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$1, - preconnect: noop$1, - preload: noop$1, - preloadModule: noop$1, - preinitScript: noop$1, - preinitStyle: noop$1, - preinitModuleScript: noop$1 - } - }, - findDOMNode: null - }, - ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, +var ReactDOMCurrentDispatcher$1 = Internals.ReactDOMCurrentDispatcher, eventsEnabled = null, selectionInformation = null; function getOwnerDocumentFromRootContainer(rootContainerElement) { @@ -16997,14 +16992,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -17014,14 +17009,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -17230,7 +17225,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -17303,17 +17298,17 @@ Internals.Events = [ return fn(a); } ]; -var devToolsConfig$jscomp$inline_1729 = { +var devToolsConfig$jscomp$inline_1743 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-classic-203d498a", + version: "19.0.0-www-classic-a94fe4e6", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2140 = { - bundleType: devToolsConfig$jscomp$inline_1729.bundleType, - version: devToolsConfig$jscomp$inline_1729.version, - rendererPackageName: devToolsConfig$jscomp$inline_1729.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1729.rendererConfig, +var internals$jscomp$inline_2160 = { + bundleType: devToolsConfig$jscomp$inline_1743.bundleType, + version: devToolsConfig$jscomp$inline_1743.version, + rendererPackageName: devToolsConfig$jscomp$inline_1743.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1743.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -17329,26 +17324,26 @@ var internals$jscomp$inline_2140 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1729.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1743.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-classic-203d498a" + reconcilerVersion: "19.0.0-www-classic-a94fe4e6" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2141 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2161 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2141.isDisabled && - hook$jscomp$inline_2141.supportsFiber + !hook$jscomp$inline_2161.isDisabled && + hook$jscomp$inline_2161.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2141.inject( - internals$jscomp$inline_2140 + (rendererID = hook$jscomp$inline_2161.inject( + internals$jscomp$inline_2160 )), - (injectedHook = hook$jscomp$inline_2141); + (injectedHook = hook$jscomp$inline_2161); } catch (err) {} } var ReactFiberErrorDialogWWW = require("ReactFiberErrorDialog"); @@ -17935,4 +17930,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-classic-203d498a"; +exports.version = "19.0.0-www-classic-a94fe4e6"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index bf6c9ec995..5958ddb20d 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -15,41 +15,7 @@ */ "use strict"; var Scheduler = require("scheduler"), - React = require("react"); -function noop$3() {} -var Internals = { - usingClientEntryPoint: !1, - Events: null, - ReactDOMCurrentDispatcher: { - current: { - prefetchDNS: noop$3, - preconnect: noop$3, - preload: noop$3, - preloadModule: noop$3, - preinitScript: noop$3, - preinitStyle: noop$3, - preinitModuleScript: noop$3 - } - }, - findDOMNode: null -}; -function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); -} -var ReactSharedInternals = - React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + React = require("react"), dynamicFeatureFlags = require("ReactFeatureFlags"), disableIEWorkarounds = dynamicFeatureFlags.disableIEWorkarounds, enableTrustedTypesIntegration = @@ -80,316 +46,8 @@ var ReactSharedInternals = dynamicFeatureFlags.favorSafetyOverHydrationPerf, disableDefaultPropsExceptForClasses = dynamicFeatureFlags.disableDefaultPropsExceptForClasses, - REACT_ELEMENT_TYPE = Symbol.for("react.element"), - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), - REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), - REACT_PROFILER_TYPE = Symbol.for("react.profiler"), - REACT_PROVIDER_TYPE = Symbol.for("react.provider"), - REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), - REACT_CONTEXT_TYPE = Symbol.for("react.context"), - REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), - REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), - REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), - REACT_MEMO_TYPE = Symbol.for("react.memo"), - REACT_LAZY_TYPE = Symbol.for("react.lazy"), - REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), - REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), - REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), - MAYBE_ITERATOR_SYMBOL = Symbol.iterator; -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || "object" !== typeof maybeIterable) return null; - maybeIterable = - (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || - maybeIterable["@@iterator"]; - return "function" === typeof maybeIterable ? maybeIterable : null; -} -var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); -function getComponentNameFromType(type) { - if (null == type) return null; - if ("function" === typeof type) - return type.$$typeof === REACT_CLIENT_REFERENCE - ? null - : type.displayName || type.name || null; - if ("string" === typeof type) return type; - switch (type) { - case REACT_FRAGMENT_TYPE: - return "Fragment"; - case REACT_PORTAL_TYPE: - return "Portal"; - case REACT_PROFILER_TYPE: - return "Profiler"; - case REACT_STRICT_MODE_TYPE: - return "StrictMode"; - case REACT_SUSPENSE_TYPE: - return "Suspense"; - case REACT_SUSPENSE_LIST_TYPE: - return "SuspenseList"; - case REACT_TRACING_MARKER_TYPE: - if (enableTransitionTracing) return "TracingMarker"; - } - if ("object" === typeof type) - switch (type.$$typeof) { - case REACT_PROVIDER_TYPE: - if (enableRenderableContext) break; - else return (type._context.displayName || "Context") + ".Provider"; - case REACT_CONTEXT_TYPE: - return enableRenderableContext - ? (type.displayName || "Context") + ".Provider" - : (type.displayName || "Context") + ".Consumer"; - case REACT_CONSUMER_TYPE: - if (enableRenderableContext) - return (type._context.displayName || "Context") + ".Consumer"; - break; - case REACT_FORWARD_REF_TYPE: - var innerType = type.render; - type = type.displayName; - type || - ((type = innerType.displayName || innerType.name || ""), - (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); - return type; - case REACT_MEMO_TYPE: - return ( - (innerType = type.displayName || null), - null !== innerType - ? innerType - : getComponentNameFromType(type.type) || "Memo" - ); - case REACT_LAZY_TYPE: - innerType = type._payload; - type = type._init; - try { - return getComponentNameFromType(type(innerType)); - } catch (x) {} - } - return null; -} -function getNearestMountedFiber(fiber) { - var node = fiber, - nearestMounted = fiber; - if (fiber.alternate) for (; node.return; ) node = node.return; - else { - fiber = node; - do - (node = fiber), - 0 !== (node.flags & 4098) && (nearestMounted = node.return), - (fiber = node.return); - while (fiber); - } - return 3 === node.tag ? nearestMounted : null; -} -function getSuspenseInstanceFromFiber(fiber) { - if (13 === fiber.tag) { - var suspenseState = fiber.memoizedState; - null === suspenseState && - ((fiber = fiber.alternate), - null !== fiber && (suspenseState = fiber.memoizedState)); - if (null !== suspenseState) return suspenseState.dehydrated; - } - return null; -} -function assertIsMounted(fiber) { - if (getNearestMountedFiber(fiber) !== fiber) - throw Error(formatProdErrorMessage(188)); -} -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - alternate = getNearestMountedFiber(fiber); - if (null === alternate) throw Error(formatProdErrorMessage(188)); - return alternate !== fiber ? null : fiber; - } - for (var a = fiber, b = alternate; ; ) { - var parentA = a.return; - if (null === parentA) break; - var parentB = parentA.alternate; - if (null === parentB) { - b = parentA.return; - if (null !== b) { - a = b; - continue; - } - break; - } - if (parentA.child === parentB.child) { - for (parentB = parentA.child; parentB; ) { - if (parentB === a) return assertIsMounted(parentA), fiber; - if (parentB === b) return assertIsMounted(parentA), alternate; - parentB = parentB.sibling; - } - throw Error(formatProdErrorMessage(188)); - } - if (a.return !== b.return) (a = parentA), (b = parentB); - else { - for (var didFindChild = !1, child$1 = parentA.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentA; - b = parentB; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentA; - a = parentB; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) { - for (child$1 = parentB.child; child$1; ) { - if (child$1 === a) { - didFindChild = !0; - a = parentB; - b = parentA; - break; - } - if (child$1 === b) { - didFindChild = !0; - b = parentB; - a = parentA; - break; - } - child$1 = child$1.sibling; - } - if (!didFindChild) throw Error(formatProdErrorMessage(189)); - } - } - if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); - } - if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); - return a.stateNode.current === a ? fiber : alternate; -} -function findCurrentHostFiber(parent) { - parent = findCurrentFiberUsingSlowPath(parent); - return null !== parent ? findCurrentHostFiberImpl(parent) : null; -} -function findCurrentHostFiberImpl(node) { - var tag = node.tag; - if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; - for (node = node.child; null !== node; ) { - tag = findCurrentHostFiberImpl(node); - if (null !== tag) return tag; - node = node.sibling; - } - return null; -} -function isFiberSuspenseAndTimedOut(fiber) { - var memoizedState = fiber.memoizedState; - return ( - 13 === fiber.tag && - null !== memoizedState && - null === memoizedState.dehydrated - ); -} -function doesFiberContain(parentFiber, childFiber) { - for ( - var parentFiberAlternate = parentFiber.alternate; - null !== childFiber; - - ) { - if (childFiber === parentFiber || childFiber === parentFiberAlternate) - return !0; - childFiber = childFiber.return; - } - return !1; -} -var assign = Object.assign, - isArrayImpl = Array.isArray, - ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, - sharedNotPendingObject = { - pending: !1, - data: null, - method: null, - action: null - }, - valueStack = [], - index = -1; -function createCursor(defaultValue) { - return { current: defaultValue }; -} -function pop(cursor) { - 0 > index || - ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); -} -function push(cursor, value) { - index++; - valueStack[index] = cursor.current; - cursor.current = value; -} -var contextStackCursor = createCursor(null), - contextFiberStackCursor = createCursor(null), - rootInstanceStackCursor = createCursor(null), - hostTransitionProviderCursor = createCursor(null), - HostTransitionContext = { - $$typeof: REACT_CONTEXT_TYPE, - Provider: null, - Consumer: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function pushHostContainer(fiber, nextRootInstance) { - push(rootInstanceStackCursor, nextRootInstance); - push(contextFiberStackCursor, fiber); - push(contextStackCursor, null); - fiber = nextRootInstance.nodeType; - switch (fiber) { - case 9: - case 11: - nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) - ? (nextRootInstance = nextRootInstance.namespaceURI) - ? getOwnHostContext(nextRootInstance) - : 0 - : 0; - break; - default: - if ( - ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), - (nextRootInstance = fiber.tagName), - (fiber = fiber.namespaceURI)) - ) - (fiber = getOwnHostContext(fiber)), - (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); - else - switch (nextRootInstance) { - case "svg": - nextRootInstance = 1; - break; - case "math": - nextRootInstance = 2; - break; - default: - nextRootInstance = 0; - } - } - pop(contextStackCursor); - push(contextStackCursor, nextRootInstance); -} -function popHostContainer() { - pop(contextStackCursor); - pop(contextFiberStackCursor); - pop(rootInstanceStackCursor); -} -function pushHostContext(fiber) { - null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); - var context = contextStackCursor.current; - var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); - context !== JSCompiler_inline_result && - (push(contextFiberStackCursor, fiber), - push(contextStackCursor, JSCompiler_inline_result)); -} -function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && - (pop(contextStackCursor), pop(contextFiberStackCursor)); - hostTransitionProviderCursor.current === fiber && - (pop(hostTransitionProviderCursor), - (HostTransitionContext._currentValue = null)); -} -var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + assign = Object.assign, + scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -402,6 +60,8 @@ var scheduleCallback$3 = Scheduler.unstable_scheduleCallback, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, + ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, rendererID = null, injectedHook = null; function onCommitRoot(root) { @@ -599,18 +259,18 @@ function markRootFinished(root, remainingLanes, spawnedLane) { 0 < noLongerPendingLanes; ) { - var index$5 = 31 - clz32(noLongerPendingLanes), - lane = 1 << index$5; - remainingLanes[index$5] = 0; - expirationTimes[index$5] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$5]; + var index$3 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$3; + remainingLanes[index$3] = 0; + expirationTimes[index$3] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$3]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$5] = null, index$5 = 0; - index$5 < hiddenUpdatesForLane.length; - index$5++ + hiddenUpdates[index$3] = null, index$3 = 0; + index$3 < hiddenUpdatesForLane.length; + index$3++ ) { - var update = hiddenUpdatesForLane[index$5]; + var update = hiddenUpdatesForLane[index$3]; null !== update && (update.lane &= -536870913); } noLongerPendingLanes &= ~lane; @@ -630,10 +290,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$6 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$6; - (lane & entangledLanes) | (root[index$6] & entangledLanes) && - (root[index$6] |= entangledLanes); + var index$4 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$4; + (lane & entangledLanes) | (root[index$4] & entangledLanes) && + (root[index$4] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -648,11 +308,11 @@ function upgradePendingLanesToSync(root, lanesToUpgrade) { function getTransitionsForLanes(root, lanes) { if (!enableTransitionTracing) return null; for (var transitionsForLanes = []; 0 < lanes; ) { - var index$9 = 31 - clz32(lanes), - lane = 1 << index$9; - index$9 = root.transitionLanes[index$9]; - null !== index$9 && - index$9.forEach(function (transition) { + var index$7 = 31 - clz32(lanes), + lane = 1 << index$7; + index$7 = root.transitionLanes[index$7]; + null !== index$7 && + index$7.forEach(function (transition) { transitionsForLanes.push(transition); }); lanes &= ~lane; @@ -662,22 +322,13 @@ function getTransitionsForLanes(root, lanes) { function clearTransitionsForLanes(root, lanes) { if (enableTransitionTracing) for (; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - null !== root.transitionLanes[index$10] && - (root.transitionLanes[index$10] = null); + var index$8 = 31 - clz32(lanes), + lane = 1 << index$8; + null !== root.transitionLanes[index$8] && + (root.transitionLanes[index$8] = null); lanes &= ~lane; } } -var currentUpdatePriority = 0; -function runWithPriority(priority, fn) { - var previousPriority = currentUpdatePriority; - try { - return (currentUpdatePriority = priority), fn(); - } finally { - currentUpdatePriority = previousPriority; - } -} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -688,8 +339,357 @@ function lanesToEventPriority(lanes) { : 8 : 2; } -var hasOwnProperty = Object.prototype.hasOwnProperty, - randomKey = Math.random().toString(36).slice(2), +function noop$3() {} +var Internals = { + usingClientEntryPoint: !1, + Events: null, + ReactDOMCurrentDispatcher: { + current: { + prefetchDNS: noop$3, + preconnect: noop$3, + preload: noop$3, + preloadModule: noop$3, + preinitScript: noop$3, + preinitStyle: noop$3, + preinitModuleScript: noop$3 + } + }, + findDOMNode: null, + up: 0 +}; +function formatProdErrorMessage(code) { + var url = "https://react.dev/errors/" + code; + if (1 < arguments.length) { + url += "?args[]=" + encodeURIComponent(arguments[1]); + for (var i = 2; i < arguments.length; i++) + url += "&args[]=" + encodeURIComponent(arguments[i]); + } + return ( + "Minified React error #" + + code + + "; visit " + + url + + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." + ); +} +var REACT_ELEMENT_TYPE = Symbol.for("react.element"), + REACT_PORTAL_TYPE = Symbol.for("react.portal"), + REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), + REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), + REACT_PROFILER_TYPE = Symbol.for("react.profiler"), + REACT_PROVIDER_TYPE = Symbol.for("react.provider"), + REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), + REACT_CONTEXT_TYPE = Symbol.for("react.context"), + REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), + REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), + REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), + REACT_MEMO_TYPE = Symbol.for("react.memo"), + REACT_LAZY_TYPE = Symbol.for("react.lazy"), + REACT_SCOPE_TYPE = Symbol.for("react.scope"), + REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), + REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), + REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), + REACT_TRACING_MARKER_TYPE = Symbol.for("react.tracing_marker"), + REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), + MAYBE_ITERATOR_SYMBOL = Symbol.iterator; +function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = + (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) || + maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; +} +var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); +function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) + return type.$$typeof === REACT_CLIENT_REFERENCE + ? null + : type.displayName || type.name || null; + if ("string" === typeof type) return type; + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + case REACT_PORTAL_TYPE: + return "Portal"; + case REACT_PROFILER_TYPE: + return "Profiler"; + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + case REACT_SUSPENSE_TYPE: + return "Suspense"; + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + case REACT_TRACING_MARKER_TYPE: + if (enableTransitionTracing) return "TracingMarker"; + } + if ("object" === typeof type) + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + if (enableRenderableContext) break; + else return (type._context.displayName || "Context") + ".Provider"; + case REACT_CONTEXT_TYPE: + return enableRenderableContext + ? (type.displayName || "Context") + ".Provider" + : (type.displayName || "Context") + ".Consumer"; + case REACT_CONSUMER_TYPE: + if (enableRenderableContext) + return (type._context.displayName || "Context") + ".Consumer"; + break; + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || + ((type = innerType.displayName || innerType.name || ""), + (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef")); + return type; + case REACT_MEMO_TYPE: + return ( + (innerType = type.displayName || null), + null !== innerType + ? innerType + : getComponentNameFromType(type.type) || "Memo" + ); + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + } + return null; +} +function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return; ) node = node.return; + else { + fiber = node; + do + (node = fiber), + 0 !== (node.flags & 4098) && (nearestMounted = node.return), + (fiber = node.return); + while (fiber); + } + return 3 === node.tag ? nearestMounted : null; +} +function getSuspenseInstanceFromFiber(fiber) { + if (13 === fiber.tag) { + var suspenseState = fiber.memoizedState; + null === suspenseState && + ((fiber = fiber.alternate), + null !== fiber && (suspenseState = fiber.memoizedState)); + if (null !== suspenseState) return suspenseState.dehydrated; + } + return null; +} +function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) + throw Error(formatProdErrorMessage(188)); +} +function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) throw Error(formatProdErrorMessage(188)); + return alternate !== fiber ? null : fiber; + } + for (var a = fiber, b = alternate; ; ) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + if (null === parentB) { + b = parentA.return; + if (null !== b) { + a = b; + continue; + } + break; + } + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB; ) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + throw Error(formatProdErrorMessage(188)); + } + if (a.return !== b.return) (a = parentA), (b = parentB); + else { + for (var didFindChild = !1, child$10 = parentA.child; child$10; ) { + if (child$10 === a) { + didFindChild = !0; + a = parentA; + b = parentB; + break; + } + if (child$10 === b) { + didFindChild = !0; + b = parentA; + a = parentB; + break; + } + child$10 = child$10.sibling; + } + if (!didFindChild) { + for (child$10 = parentB.child; child$10; ) { + if (child$10 === a) { + didFindChild = !0; + a = parentB; + b = parentA; + break; + } + if (child$10 === b) { + didFindChild = !0; + b = parentB; + a = parentA; + break; + } + child$10 = child$10.sibling; + } + if (!didFindChild) throw Error(formatProdErrorMessage(189)); + } + } + if (a.alternate !== b) throw Error(formatProdErrorMessage(190)); + } + if (3 !== a.tag) throw Error(formatProdErrorMessage(188)); + return a.stateNode.current === a ? fiber : alternate; +} +function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; +} +function findCurrentHostFiberImpl(node) { + var tag = node.tag; + if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node; + for (node = node.child; null !== node; ) { + tag = findCurrentHostFiberImpl(node); + if (null !== tag) return tag; + node = node.sibling; + } + return null; +} +function isFiberSuspenseAndTimedOut(fiber) { + var memoizedState = fiber.memoizedState; + return ( + 13 === fiber.tag && + null !== memoizedState && + null === memoizedState.dehydrated + ); +} +function doesFiberContain(parentFiber, childFiber) { + for ( + var parentFiberAlternate = parentFiber.alternate; + null !== childFiber; + + ) { + if (childFiber === parentFiber || childFiber === parentFiberAlternate) + return !0; + childFiber = childFiber.return; + } + return !1; +} +var isArrayImpl = Array.isArray, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + sharedNotPendingObject = { + pending: !1, + data: null, + method: null, + action: null + }, + valueStack = [], + index = -1; +function createCursor(defaultValue) { + return { current: defaultValue }; +} +function pop(cursor) { + 0 > index || + ((cursor.current = valueStack[index]), (valueStack[index] = null), index--); +} +function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; +} +var contextStackCursor = createCursor(null), + contextFiberStackCursor = createCursor(null), + rootInstanceStackCursor = createCursor(null), + hostTransitionProviderCursor = createCursor(null), + HostTransitionContext = { + $$typeof: REACT_CONTEXT_TYPE, + Provider: null, + Consumer: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor, null); + fiber = nextRootInstance.nodeType; + switch (fiber) { + case 9: + case 11: + nextRootInstance = (nextRootInstance = nextRootInstance.documentElement) + ? (nextRootInstance = nextRootInstance.namespaceURI) + ? getOwnHostContext(nextRootInstance) + : 0 + : 0; + break; + default: + if ( + ((fiber = 8 === fiber ? nextRootInstance.parentNode : nextRootInstance), + (nextRootInstance = fiber.tagName), + (fiber = fiber.namespaceURI)) + ) + (fiber = getOwnHostContext(fiber)), + (nextRootInstance = getChildHostContextProd(fiber, nextRootInstance)); + else + switch (nextRootInstance) { + case "svg": + nextRootInstance = 1; + break; + case "math": + nextRootInstance = 2; + break; + default: + nextRootInstance = 0; + } + } + pop(contextStackCursor); + push(contextStackCursor, nextRootInstance); +} +function popHostContainer() { + pop(contextStackCursor); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); +} +function pushHostContext(fiber) { + null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber); + var context = contextStackCursor.current; + var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type); + context !== JSCompiler_inline_result && + (push(contextFiberStackCursor, fiber), + push(contextStackCursor, JSCompiler_inline_result)); +} +function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && + (pop(contextStackCursor), pop(contextFiberStackCursor)); + hostTransitionProviderCursor.current === fiber && + (pop(hostTransitionProviderCursor), + (HostTransitionContext._currentValue = null)); +} +var hasOwnProperty = Object.prototype.hasOwnProperty; +function runWithPriority(priority, fn) { + var previousPriority = Internals.up; + try { + return (Internals.up = priority), fn(); + } finally { + Internals.up = previousPriority; + } +} +var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, @@ -2218,14 +2218,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$296; if (canUseDOM) { - var isSupported$jscomp$inline_424 = "oninput" in document; - if (!isSupported$jscomp$inline_424) { - var element$jscomp$inline_425 = document.createElement("div"); - element$jscomp$inline_425.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_424 = - "function" === typeof element$jscomp$inline_425.oninput; + var isSupported$jscomp$inline_429 = "oninput" in document; + if (!isSupported$jscomp$inline_429) { + var element$jscomp$inline_430 = document.createElement("div"); + element$jscomp$inline_430.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_429 = + "function" === typeof element$jscomp$inline_430.oninput; } - JSCompiler_inline_result$jscomp$296 = isSupported$jscomp$inline_424; + JSCompiler_inline_result$jscomp$296 = isSupported$jscomp$inline_429; } else JSCompiler_inline_result$jscomp$296 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$296 && @@ -2655,19 +2655,19 @@ for ( } console.error(error); }, - i$jscomp$inline_465 = 0; - i$jscomp$inline_465 < simpleEventPluginEvents.length; - i$jscomp$inline_465++ + i$jscomp$inline_470 = 0; + i$jscomp$inline_470 < simpleEventPluginEvents.length; + i$jscomp$inline_470++ ) { - var eventName$jscomp$inline_466 = - simpleEventPluginEvents[i$jscomp$inline_465], - domEventName$jscomp$inline_467 = eventName$jscomp$inline_466.toLowerCase(), - capitalizedEvent$jscomp$inline_468 = - eventName$jscomp$inline_466[0].toUpperCase() + - eventName$jscomp$inline_466.slice(1); + var eventName$jscomp$inline_471 = + simpleEventPluginEvents[i$jscomp$inline_470], + domEventName$jscomp$inline_472 = eventName$jscomp$inline_471.toLowerCase(), + capitalizedEvent$jscomp$inline_473 = + eventName$jscomp$inline_471[0].toUpperCase() + + eventName$jscomp$inline_471.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_467, - "on" + capitalizedEvent$jscomp$inline_468 + domEventName$jscomp$inline_472, + "on" + capitalizedEvent$jscomp$inline_473 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -5835,12 +5835,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < pendingLanes; ) { - var index$3 = 31 - clz32(pendingLanes), - lane = 1 << index$3, - expirationTime = expirationTimes[index$3]; + var index$1 = 31 - clz32(pendingLanes), + lane = 1 << index$1, + expirationTime = expirationTimes[index$1]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$3] = computeExpirationTime(lane, currentTime); + expirationTimes[index$1] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); pendingLanes &= ~lane; } @@ -7905,8 +7905,8 @@ function startTransition( callback, options ) { - var previousPriority = currentUpdatePriority; - currentUpdatePriority = + var previousPriority = Internals.up; + Internals.up = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; var prevTransition = ReactCurrentBatchConfig$3.transition, currentTransition = { _callbacks: new Set() }; @@ -7938,7 +7938,7 @@ function startTransition( reason: error }); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$3.transition = prevTransition); } } @@ -14488,11 +14488,13 @@ function requestUpdateLane() { var actionScopeLane = currentEntangledLane; return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane(); } - actionScopeLane = currentUpdatePriority; - if (0 !== actionScopeLane) return actionScopeLane; - actionScopeLane = window.event; - actionScopeLane = - void 0 === actionScopeLane ? 32 : getEventPriority(actionScopeLane.type); + actionScopeLane = Internals.up; + 0 === actionScopeLane && + ((actionScopeLane = window.event), + (actionScopeLane = + void 0 === actionScopeLane + ? 32 + : getEventPriority(actionScopeLane.type))); return actionScopeLane; } function requestDeferredLane() { @@ -14527,11 +14529,11 @@ function scheduleUpdateOnFiber(root, fiber, lane) { enableTransitionTracing)) ) { var transitionLanesMap = root.transitionLanes, - index$8 = 31 - clz32(lane), - transitions = transitionLanesMap[index$8]; + index$6 = 31 - clz32(lane), + transitions = transitionLanesMap[index$6]; null === transitions && (transitions = new Set()); transitions.add(fiber); - transitionLanesMap[index$8] = transitions; + transitionLanesMap[index$6] = transitions; } root === workInProgressRoot && (0 === (executionContext & 2) && @@ -14790,9 +14792,9 @@ function markRootSuspended(root, suspendedLanes, spawnedLane) { 0 < lanes; ) { - var index$4 = 31 - clz32(lanes), - lane = 1 << index$4; - expirationTimes[index$4] = -1; + var index$2 = 31 - clz32(lanes), + lane = 1 << index$2; + expirationTimes[index$2] = -1; lanes &= ~lane; } 0 !== spawnedLane && @@ -14845,16 +14847,12 @@ function flushSync$1(fn) { var prevExecutionContext = executionContext; executionContext |= 1; var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + previousPriority = Internals.up; try { - if ( - ((ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), - fn) - ) + if (((Internals.up = 2), (ReactCurrentBatchConfig$1.transition = null), fn)) return fn(); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), (executionContext = prevExecutionContext), 0 === (executionContext & 6) && flushSyncWorkAcrossRoots_impl(!1); @@ -14910,9 +14908,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$2 = 31 - clz32(allEntangledLanes), - lane = 1 << index$2; - lanes |= root[index$2]; + var index$0 = 31 - clz32(allEntangledLanes), + lane = 1 << index$0; + lanes |= root[index$0]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -15285,11 +15283,11 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane ) { - var previousUpdateLanePriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig$1.transition; + var prevTransition = ReactCurrentBatchConfig$1.transition, + previousUpdateLanePriority = Internals.up; try { - (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = 2), + (Internals.up = 2), + (ReactCurrentBatchConfig$1.transition = null), commitRootImpl( root, recoverableErrors, @@ -15300,7 +15298,7 @@ function commitRoot( ); } finally { (ReactCurrentBatchConfig$1.transition = prevTransition), - (currentUpdatePriority = previousUpdateLanePriority); + (Internals.up = previousUpdateLanePriority); } return null; } @@ -15345,8 +15343,8 @@ function commitRootImpl( if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { transitions = ReactCurrentBatchConfig$1.transition; ReactCurrentBatchConfig$1.transition = null; - spawnedLane = currentUpdatePriority; - currentUpdatePriority = 2; + spawnedLane = Internals.up; + Internals.up = 2; var prevExecutionContext = executionContext; executionContext |= 4; ReactCurrentOwner.current = null; @@ -15366,7 +15364,7 @@ function commitRootImpl( commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); requestPaint(); executionContext = prevExecutionContext; - currentUpdatePriority = spawnedLane; + Internals.up = spawnedLane; ReactCurrentBatchConfig$1.transition = transitions; } else root.current = finishedWork; rootDoesHavePassiveEffects @@ -15428,18 +15426,17 @@ function flushPassiveEffects() { var root$277 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; - var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); - renderPriority = 32 > renderPriority ? 32 : renderPriority; - var prevTransition = ReactCurrentBatchConfig$1.transition, - previousPriority = currentUpdatePriority; + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$1.transition, + previousPriority = Internals.up; try { return ( + (Internals.up = 32 > renderPriority ? 32 : renderPriority), (ReactCurrentBatchConfig$1.transition = null), - (currentUpdatePriority = renderPriority), flushPassiveEffectsImpl() ); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig$1.transition = prevTransition), releaseRootPooledCache(root$277, remainingLanes); } @@ -16112,14 +16109,14 @@ function dispatchDiscreteEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 2), + (Internals.up = 2), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16129,14 +16126,14 @@ function dispatchContinuousEvent( container, nativeEvent ) { - var previousPriority = currentUpdatePriority, - prevTransition = ReactCurrentBatchConfig.transition; + var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; + var previousPriority = Internals.up; try { - (currentUpdatePriority = 8), + (Internals.up = 8), dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { - (currentUpdatePriority = previousPriority), + (Internals.up = previousPriority), (ReactCurrentBatchConfig.transition = prevTransition); } } @@ -16663,7 +16660,7 @@ function ReactDOMHydrationRoot(internalRoot) { } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { if (target) { - var updatePriority = currentUpdatePriority; + var updatePriority = Internals.up; target = { blockedOn: null, target: target, priority: updatePriority }; for ( var i = 0; @@ -16737,17 +16734,17 @@ Internals.Events = [ restoreStateIfNeeded, unstable_batchedUpdates ]; -var devToolsConfig$jscomp$inline_1712 = { +var devToolsConfig$jscomp$inline_1726 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "19.0.0-www-modern-f36792c7", + version: "19.0.0-www-modern-dc5747cc", rendererPackageName: "react-dom" }; -var internals$jscomp$inline_2116 = { - bundleType: devToolsConfig$jscomp$inline_1712.bundleType, - version: devToolsConfig$jscomp$inline_1712.version, - rendererPackageName: devToolsConfig$jscomp$inline_1712.rendererPackageName, - rendererConfig: devToolsConfig$jscomp$inline_1712.rendererConfig, +var internals$jscomp$inline_2136 = { + bundleType: devToolsConfig$jscomp$inline_1726.bundleType, + version: devToolsConfig$jscomp$inline_1726.version, + rendererPackageName: devToolsConfig$jscomp$inline_1726.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_1726.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, @@ -16763,26 +16760,26 @@ var internals$jscomp$inline_2116 = { return null === fiber ? null : fiber.stateNode; }, findFiberByHostInstance: - devToolsConfig$jscomp$inline_1712.findFiberByHostInstance || + devToolsConfig$jscomp$inline_1726.findFiberByHostInstance || emptyFindFiberByHostInstance, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-www-modern-f36792c7" + reconcilerVersion: "19.0.0-www-modern-dc5747cc" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2117 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2137 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2117.isDisabled && - hook$jscomp$inline_2117.supportsFiber + !hook$jscomp$inline_2137.isDisabled && + hook$jscomp$inline_2137.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2117.inject( - internals$jscomp$inline_2116 + (rendererID = hook$jscomp$inline_2137.inject( + internals$jscomp$inline_2136 )), - (injectedHook = hook$jscomp$inline_2117); + (injectedHook = hook$jscomp$inline_2137); } catch (err) {} } if ("function" !== typeof require("ReactFiberErrorDialog").showErrorDialog) @@ -17196,4 +17193,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactCurrentDispatcher$2.current.useHostTransitionStatus(); }; -exports.version = "19.0.0-www-modern-f36792c7"; +exports.version = "19.0.0-www-modern-dc5747cc"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 9c9a1db0a6..08bacaac4c 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -1984,17 +1984,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2004,6 +1998,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2161,7 +2158,18 @@ if (__DEV__) { tag: "TEXT" }; } - function getCurrentEventPriority() { + var currentUpdatePriority = NoEventPriority; + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function resolveUpdatePriority() { + if (currentUpdatePriority !== NoEventPriority) { + return currentUpdatePriority; + } + return DefaultEventPriority; } function shouldAttemptEagerTransition() { @@ -22683,26 +22691,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -23408,8 +23399,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; if (fn) { return fn(); @@ -24464,12 +24455,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; commitRootImpl( root, recoverableErrors, @@ -24814,8 +24805,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -26680,7 +26671,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-classic-6d44fc36"; + var ReactVersion = "19.0.0-www-classic-9f4b2142"; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index cb5b2abe3d..2aad238d91 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -1984,17 +1984,11 @@ if (__DEV__) { } } + var NoEventPriority = NoLane; var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; - var currentUpdatePriority = NoLane; - function getCurrentUpdatePriority() { - return currentUpdatePriority; - } - function setCurrentUpdatePriority(newPriority) { - currentUpdatePriority = newPriority; - } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } @@ -2004,6 +1998,9 @@ if (__DEV__) { function isHigherEventPriority(a, b) { return a !== 0 && a < b; } + function eventPriorityToLane(updatePriority) { + return updatePriority; + } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); @@ -2161,7 +2158,18 @@ if (__DEV__) { tag: "TEXT" }; } - function getCurrentEventPriority() { + var currentUpdatePriority = NoEventPriority; + function setCurrentUpdatePriority(newPriority) { + currentUpdatePriority = newPriority; + } + function getCurrentUpdatePriority() { + return currentUpdatePriority; + } + function resolveUpdatePriority() { + if (currentUpdatePriority !== NoEventPriority) { + return currentUpdatePriority; + } + return DefaultEventPriority; } function shouldAttemptEagerTransition() { @@ -22683,26 +22691,9 @@ if (__DEV__) { : // is the first update in that scope. Either way, we need to get a // fresh transition lane. requestTransitionLane(); - } // Updates originating inside certain React methods, like flushSync, have - // their priority set by tracking it with a context variable. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. + } - var updateLane = getCurrentUpdatePriority(); - - if (updateLane !== NoLane) { - return updateLane; - } // This update originated outside React. Ask the host environment for an - // appropriate priority, based on the type of event. - // - // The opaque type returned by the host config is internally a lane, so we can - // use that directly. - // TODO: Move this type conversion to the event priority module. - - var eventLane = getCurrentEventPriority(); - return eventLane; + return eventPriorityToLane(resolveUpdatePriority()); } function requestRetryLane(fiber) { @@ -23408,8 +23399,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; if (fn) { return fn(); @@ -24464,12 +24455,12 @@ if (__DEV__) { ) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. - var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; + var previousUpdateLanePriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); + ReactCurrentBatchConfig.transition = null; commitRootImpl( root, recoverableErrors, @@ -24814,8 +24805,8 @@ if (__DEV__) { var previousPriority = getCurrentUpdatePriority(); try { - ReactCurrentBatchConfig.transition = null; setCurrentUpdatePriority(priority); + ReactCurrentBatchConfig.transition = null; return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); @@ -26680,7 +26671,7 @@ if (__DEV__) { return root; } - var ReactVersion = "19.0.0-www-modern-6d44fc36"; + var ReactVersion = "19.0.0-www-modern-9f4b2142"; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol