react 19.0.0-rc.0 → 19.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,2801 +8,1514 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
- if (
17
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
18
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
19
- 'function'
20
- ) {
21
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
22
- }
23
- var ReactVersion = '19.0.0';
24
-
25
- // -----------------------------------------------------------------------------
26
-
27
- var enableScopeAPI = false; // Experimental Create Event Handle API.
28
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
29
-
30
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
31
- // as a normal prop instead of stripping it from the props object.
32
- // Passes `ref` as a normal prop instead of stripping it from the props object
33
- // during element creation.
34
-
35
- var enableRefAsProp = true;
36
- // This allows us to land breaking changes to remove legacy mode APIs in experimental builds
37
- // before removing them in stable in the next Major
38
-
39
- var disableLegacyMode = true; // Make <Context> equivalent to <Context.Provider> instead of <Context.Consumer>
40
-
41
- var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
42
- // stuff. Intended to enable React core members to more easily debug scheduling
43
- // issues in DEV builds.
44
-
45
- var enableDebugTracing = false;
46
-
47
- var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
48
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
49
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
50
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
51
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
52
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
53
-
54
- var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
55
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
56
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
57
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
58
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
59
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
60
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
61
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
62
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
63
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
64
- function getIteratorFn(maybeIterable) {
65
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
66
- return null;
67
- }
68
-
69
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
70
-
71
- if (typeof maybeIterator === 'function') {
72
- return maybeIterator;
73
- }
74
-
75
- return null;
76
- }
77
-
78
- var ReactSharedInternals = {
79
- H: null,
80
- A: null,
81
- T: null,
82
- S: null
83
- };
84
-
85
- {
86
- ReactSharedInternals.actQueue = null;
87
- ReactSharedInternals.isBatchingLegacy = false;
88
- ReactSharedInternals.didScheduleLegacyUpdate = false;
89
- ReactSharedInternals.didUsePromise = false;
90
- ReactSharedInternals.thrownErrors = []; // Stack implementation injected by the current renderer.
91
-
92
- ReactSharedInternals.getCurrentStack = null;
93
- }
94
-
95
- // by calls to these methods by a Babel plugin.
96
- //
97
- // In PROD (or in packages without access to React internals),
98
- // they are left as they are instead.
99
-
100
- function warn(format) {
101
- {
102
- {
103
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
104
- args[_key - 1] = arguments[_key];
105
- }
106
-
107
- printWarning('warn', format, args);
108
- }
109
- }
110
- }
111
- function error(format) {
112
- {
113
- {
114
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
115
- args[_key2 - 1] = arguments[_key2];
116
- }
117
-
118
- printWarning('error', format, args);
119
- }
120
- }
121
- } // eslint-disable-next-line react-internal/no-production-logging
122
-
123
- function printWarning(level, format, args) {
124
- // When changing this logic, you might want to also
125
- // update consoleWithStackDev.www.js as well.
126
- {
127
- var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
128
-
129
- if (ReactSharedInternals.getCurrentStack) {
130
- // We only add the current stack to the console when createTask is not supported.
131
- // Since createTask requires DevTools to be open to work, this means that stacks
132
- // can be lost while DevTools isn't open but we can't detect this.
133
- var stack = ReactSharedInternals.getCurrentStack();
134
-
135
- if (stack !== '') {
136
- format += '%s';
137
- args = args.concat([stack]);
138
- }
139
- }
140
-
141
- if (isErrorLogger) {
142
- // Don't prefix our default logging formatting in ReactFiberErrorLoggger.
143
- // Don't toString the arguments.
144
- args.unshift(format);
145
- } else {
146
- // TODO: Remove this prefix and stop toStringing in the wrapper and
147
- // instead do it at each callsite as needed.
148
- // Careful: RN currently depends on this prefix
149
- // eslint-disable-next-line react-internal/safe-string-coercion
150
- args = args.map(function (item) {
151
- return String(item);
152
- });
153
- args.unshift('Warning: ' + format);
154
- } // We intentionally don't use spread (or .apply) directly because it
155
- // breaks IE9: https://github.com/facebook/react/issues/13610
156
- // eslint-disable-next-line react-internal/no-production-logging
157
-
158
-
159
- Function.prototype.apply.call(console[level], console, args);
160
- }
161
- }
162
-
163
- var didWarnStateUpdateForUnmountedComponent = {};
164
-
165
- function warnNoop(publicInstance, callerName) {
166
- {
167
- var _constructor = publicInstance.constructor;
168
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
169
- var warningKey = componentName + "." + callerName;
170
-
171
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
172
- return;
173
- }
174
-
175
- error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
176
-
177
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
178
- }
179
- }
180
- /**
181
- * This is the abstract API for an update queue.
182
- */
183
-
184
-
185
- var ReactNoopUpdateQueue = {
186
- /**
187
- * Checks whether or not this composite component is mounted.
188
- * @param {ReactClass} publicInstance The instance we want to test.
189
- * @return {boolean} True if mounted, false otherwise.
190
- * @protected
191
- * @final
192
- */
193
- isMounted: function (publicInstance) {
194
- return false;
195
- },
196
-
197
- /**
198
- * Forces an update. This should only be invoked when it is known with
199
- * certainty that we are **not** in a DOM transaction.
200
- *
201
- * You may want to call this when you know that some deeper aspect of the
202
- * component's state has changed but `setState` was not called.
203
- *
204
- * This will not invoke `shouldComponentUpdate`, but it will invoke
205
- * `componentWillUpdate` and `componentDidUpdate`.
206
- *
207
- * @param {ReactClass} publicInstance The instance that should rerender.
208
- * @param {?function} callback Called after component is updated.
209
- * @param {?string} callerName name of the calling function in the public API.
210
- * @internal
211
- */
212
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
213
- warnNoop(publicInstance, 'forceUpdate');
214
- },
215
-
216
- /**
217
- * Replaces all of the state. Always use this or `setState` to mutate state.
218
- * You should treat `this.state` as immutable.
219
- *
220
- * There is no guarantee that `this.state` will be immediately updated, so
221
- * accessing `this.state` after calling this method may return the old value.
222
- *
223
- * @param {ReactClass} publicInstance The instance that should rerender.
224
- * @param {object} completeState Next state.
225
- * @param {?function} callback Called after component is updated.
226
- * @param {?string} callerName name of the calling function in the public API.
227
- * @internal
228
- */
229
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
230
- warnNoop(publicInstance, 'replaceState');
231
- },
232
-
233
- /**
234
- * Sets a subset of the state. This only exists because _pendingState is
235
- * internal. This provides a merging strategy that is not available to deep
236
- * properties which is confusing. TODO: Expose pendingState or don't use it
237
- * during the merge.
238
- *
239
- * @param {ReactClass} publicInstance The instance that should rerender.
240
- * @param {object} partialState Next partial state to be merged with state.
241
- * @param {?function} callback Called after component is updated.
242
- * @param {?string} Name of the calling function in the public API.
243
- * @internal
244
- */
245
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
246
- warnNoop(publicInstance, 'setState');
247
- }
248
- };
249
-
250
- var assign = Object.assign;
251
-
252
- var emptyObject = {};
253
-
254
- {
255
- Object.freeze(emptyObject);
256
- }
257
- /**
258
- * Base class helpers for the updating state of a component.
259
- */
260
-
261
-
262
- function Component(props, context, updater) {
263
- this.props = props;
264
- this.context = context; // If a component has string refs, we will assign a different object later.
265
-
266
- this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
267
- // renderer.
268
-
269
- this.updater = updater || ReactNoopUpdateQueue;
270
- }
271
-
272
- Component.prototype.isReactComponent = {};
273
- /**
274
- * Sets a subset of the state. Always use this to mutate
275
- * state. You should treat `this.state` as immutable.
276
- *
277
- * There is no guarantee that `this.state` will be immediately updated, so
278
- * accessing `this.state` after calling this method may return the old value.
279
- *
280
- * There is no guarantee that calls to `setState` will run synchronously,
281
- * as they may eventually be batched together. You can provide an optional
282
- * callback that will be executed when the call to setState is actually
283
- * completed.
284
- *
285
- * When a function is provided to setState, it will be called at some point in
286
- * the future (not synchronously). It will be called with the up to date
287
- * component arguments (state, props, context). These values can be different
288
- * from this.* because your function may be called after receiveProps but before
289
- * shouldComponentUpdate, and this new state, props, and context will not yet be
290
- * assigned to this.
291
- *
292
- * @param {object|function} partialState Next partial state or function to
293
- * produce next partial state to be merged with current state.
294
- * @param {?function} callback Called after state is updated.
295
- * @final
296
- * @protected
297
- */
298
-
299
- Component.prototype.setState = function (partialState, callback) {
300
- if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
301
- throw new Error('takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
302
- }
303
-
304
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
305
- };
306
- /**
307
- * Forces an update. This should only be invoked when it is known with
308
- * certainty that we are **not** in a DOM transaction.
309
- *
310
- * You may want to call this when you know that some deeper aspect of the
311
- * component's state has changed but `setState` was not called.
312
- *
313
- * This will not invoke `shouldComponentUpdate`, but it will invoke
314
- * `componentWillUpdate` and `componentDidUpdate`.
315
- *
316
- * @param {?function} callback Called after update is complete.
317
- * @final
318
- * @protected
319
- */
320
-
321
-
322
- Component.prototype.forceUpdate = function (callback) {
323
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
324
- };
325
- /**
326
- * Deprecated APIs. These APIs used to exist on classic React classes but since
327
- * we would like to deprecate them, we're not going to move them over to this
328
- * modern base class. Instead, we define a getter that warns if it's accessed.
329
- */
330
-
331
-
332
- {
333
- var deprecatedAPIs = {
334
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
335
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
336
- };
337
-
338
- var defineDeprecationWarning = function (methodName, info) {
339
- Object.defineProperty(Component.prototype, methodName, {
340
- get: function () {
341
- warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
342
-
343
- return undefined;
344
- }
345
- });
346
- };
347
-
348
- for (var fnName in deprecatedAPIs) {
349
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
350
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
351
- }
352
- }
353
- }
354
-
355
- function ComponentDummy() {}
356
-
357
- ComponentDummy.prototype = Component.prototype;
358
- /**
359
- * Convenience component with default shallow equality check for sCU.
360
- */
361
-
362
- function PureComponent(props, context, updater) {
363
- this.props = props;
364
- this.context = context; // If a component has string refs, we will assign a different object later.
365
-
366
- this.refs = emptyObject;
367
- this.updater = updater || ReactNoopUpdateQueue;
368
- }
369
-
370
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
371
- pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
372
-
373
- assign(pureComponentPrototype, Component.prototype);
374
- pureComponentPrototype.isPureReactComponent = true;
375
-
376
- // an immutable object with a single mutable value
377
- function createRef() {
378
- var refObject = {
379
- current: null
380
- };
381
-
382
- {
383
- Object.seal(refObject);
384
- }
385
-
386
- return refObject;
387
- }
388
-
389
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
390
-
391
- function isArray(a) {
392
- return isArrayImpl(a);
393
- }
394
-
395
- /*
396
- * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
397
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
398
- *
399
- * The functions in this module will throw an easier-to-understand,
400
- * easier-to-debug exception with a clear errors message message explaining the
401
- * problem. (Instead of a confusing exception thrown inside the implementation
402
- * of the `value` object).
403
- */
404
- // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
405
- function typeName(value) {
406
- {
407
- // toStringTag is needed for namespaced types like Temporal.Instant
408
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
409
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
410
-
411
- return type;
412
- }
413
- } // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
414
-
415
-
416
- function willCoercionThrow(value) {
417
- {
418
- try {
419
- testStringCoercion(value);
420
- return false;
421
- } catch (e) {
422
- return true;
423
- }
424
- }
425
- }
426
-
427
- function testStringCoercion(value) {
428
- // If you ended up here by following an exception call stack, here's what's
429
- // happened: you supplied an object or symbol value to React (as a prop, key,
430
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
431
- // coerce it to a string using `'' + value`, an exception was thrown.
432
- //
433
- // The most common types that will cause this exception are `Symbol` instances
434
- // and Temporal objects like `Temporal.Instant`. But any object that has a
435
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
436
- // exception. (Library authors do this to prevent users from using built-in
437
- // numeric operators like `+` or comparison operators like `>=` because custom
438
- // methods are needed to perform accurate arithmetic or comparison.)
439
- //
440
- // To fix the problem, coerce this object or symbol value to a string before
441
- // passing it to React. The most reliable way is usually `String(value)`.
442
- //
443
- // To find which value is throwing, check the browser or debugger console.
444
- // Before this exception was thrown, there should be `console.error` output
445
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
446
- // problem and how that type was used: key, atrribute, input value prop, etc.
447
- // In most cases, this console output also shows the component and its
448
- // ancestor components where the exception happened.
449
- //
450
- // eslint-disable-next-line react-internal/safe-string-coercion
451
- return '' + value;
452
- }
453
- function checkKeyStringCoercion(value) {
454
- {
455
- if (willCoercionThrow(value)) {
456
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
457
-
458
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
459
- }
460
- }
461
- }
462
-
463
- function getWrappedName(outerType, innerType, wrapperName) {
464
- var displayName = outerType.displayName;
465
-
466
- if (displayName) {
467
- return displayName;
468
- }
469
-
470
- var functionName = innerType.displayName || innerType.name || '';
471
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
472
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
473
-
474
-
475
- function getContextName(type) {
476
- return type.displayName || 'Context';
477
- }
478
-
479
- var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
480
-
481
- function getComponentNameFromType(type) {
482
- if (type == null) {
483
- // Host root, text node or just invalid type.
484
- return null;
485
- }
486
-
487
- if (typeof type === 'function') {
488
- if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
489
- // TODO: Create a convention for naming client references with debug info.
490
- return null;
491
- }
492
-
493
- return type.displayName || type.name || null;
494
- }
495
-
496
- if (typeof type === 'string') {
497
- return type;
498
- }
499
-
500
- switch (type) {
501
- case REACT_FRAGMENT_TYPE:
502
- return 'Fragment';
503
-
504
- case REACT_PORTAL_TYPE:
505
- return 'Portal';
506
-
507
- case REACT_PROFILER_TYPE:
508
- return 'Profiler';
509
-
510
- case REACT_STRICT_MODE_TYPE:
511
- return 'StrictMode';
512
-
513
- case REACT_SUSPENSE_TYPE:
514
- return 'Suspense';
515
-
516
- case REACT_SUSPENSE_LIST_TYPE:
517
- return 'SuspenseList';
518
-
519
- }
520
-
521
- if (typeof type === 'object') {
522
- {
523
- if (typeof type.tag === 'number') {
524
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
525
- }
526
- }
527
-
528
- switch (type.$$typeof) {
529
- case REACT_PROVIDER_TYPE:
530
- {
531
- return null;
532
- }
533
-
534
- case REACT_CONTEXT_TYPE:
535
- var context = type;
536
-
537
- {
538
- return getContextName(context) + '.Provider';
539
- }
540
-
541
- case REACT_CONSUMER_TYPE:
542
- {
543
- var consumer = type;
544
- return getContextName(consumer._context) + '.Consumer';
545
- }
546
-
547
- case REACT_FORWARD_REF_TYPE:
548
- return getWrappedName(type, type.render, 'ForwardRef');
549
-
550
- case REACT_MEMO_TYPE:
551
- var outerName = type.displayName || null;
552
-
553
- if (outerName !== null) {
554
- return outerName;
555
- }
556
-
557
- return getComponentNameFromType(type.type) || 'Memo';
558
-
559
- case REACT_LAZY_TYPE:
560
- {
561
- var lazyComponent = type;
562
- var payload = lazyComponent._payload;
563
- var init = lazyComponent._init;
564
-
565
- try {
566
- return getComponentNameFromType(init(payload));
567
- } catch (x) {
568
- return null;
569
- }
570
- }
571
- }
572
- }
573
-
574
- return null;
575
- }
576
-
577
- // $FlowFixMe[method-unbinding]
578
- var hasOwnProperty = Object.prototype.hasOwnProperty;
579
-
580
- var REACT_CLIENT_REFERENCE$1 = Symbol.for('react.client.reference'); // This function is deprecated. Don't use. Only the renderer knows what a valid type is.
581
- // TODO: Delete this when enableOwnerStacks ships.
582
-
583
- function isValidElementType(type) {
584
- if (typeof type === 'string' || typeof type === 'function') {
585
- return true;
586
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
587
-
588
-
589
- if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
590
- return true;
591
- }
592
-
593
- if (typeof type === 'object' && type !== null) {
594
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
595
- // types supported by any Flight configuration anywhere since
596
- // we don't know which Flight build this will end up being used
597
- // with.
598
- type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
599
- return true;
600
- }
601
- }
602
-
603
- return false;
604
- }
605
-
606
- // Helpers to patch console.logs to avoid logging during side-effect free
607
- // replaying on render function. This currently only patches the object
608
- // lazily which won't cover if the log function was extracted eagerly.
609
- // We could also eagerly patch the method.
610
- var disabledDepth = 0;
611
- var prevLog;
612
- var prevInfo;
613
- var prevWarn;
614
- var prevError;
615
- var prevGroup;
616
- var prevGroupCollapsed;
617
- var prevGroupEnd;
618
-
619
- function disabledLog() {}
620
-
621
- disabledLog.__reactDisabledLog = true;
622
- function disableLogs() {
623
- {
624
- if (disabledDepth === 0) {
625
- /* eslint-disable react-internal/no-production-logging */
626
- prevLog = console.log;
627
- prevInfo = console.info;
628
- prevWarn = console.warn;
629
- prevError = console.error;
630
- prevGroup = console.group;
631
- prevGroupCollapsed = console.groupCollapsed;
632
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
633
-
634
- var props = {
635
- configurable: true,
636
- enumerable: true,
637
- value: disabledLog,
638
- writable: true
639
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
640
-
641
- Object.defineProperties(console, {
642
- info: props,
643
- log: props,
644
- warn: props,
645
- error: props,
646
- group: props,
647
- groupCollapsed: props,
648
- groupEnd: props
649
- });
650
- /* eslint-enable react-internal/no-production-logging */
651
- }
652
-
653
- disabledDepth++;
654
- }
655
- }
656
- function reenableLogs() {
657
- {
658
- disabledDepth--;
659
-
660
- if (disabledDepth === 0) {
661
- /* eslint-disable react-internal/no-production-logging */
662
- var props = {
663
- configurable: true,
664
- enumerable: true,
665
- writable: true
666
- }; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
667
-
668
- Object.defineProperties(console, {
669
- log: assign({}, props, {
670
- value: prevLog
671
- }),
672
- info: assign({}, props, {
673
- value: prevInfo
674
- }),
675
- warn: assign({}, props, {
676
- value: prevWarn
677
- }),
678
- error: assign({}, props, {
679
- value: prevError
680
- }),
681
- group: assign({}, props, {
682
- value: prevGroup
683
- }),
684
- groupCollapsed: assign({}, props, {
685
- value: prevGroupCollapsed
686
- }),
687
- groupEnd: assign({}, props, {
688
- value: prevGroupEnd
689
- })
690
- });
691
- /* eslint-enable react-internal/no-production-logging */
692
- }
693
-
694
- if (disabledDepth < 0) {
695
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
696
- }
697
- }
698
- }
699
-
700
- var prefix;
701
- function describeBuiltInComponentFrame(name) {
702
- {
703
- if (prefix === undefined) {
704
- // Extract the VM specific prefix used by each line.
705
- try {
706
- throw Error();
707
- } catch (x) {
708
- var match = x.stack.trim().match(/\n( *(at )?)/);
709
- prefix = match && match[1] || '';
710
- }
711
- } // We use the prefix to ensure our stacks line up with native stack frames.
712
-
713
-
714
- return '\n' + prefix + name;
715
- }
716
- }
717
- var reentry = false;
718
- var componentFrameCache;
719
-
720
- {
721
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
722
- componentFrameCache = new PossiblyWeakMap();
723
- }
724
- /**
725
- * Leverages native browser/VM stack frames to get proper details (e.g.
726
- * filename, line + col number) for a single component in a component stack. We
727
- * do this by:
728
- * (1) throwing and catching an error in the function - this will be our
729
- * control error.
730
- * (2) calling the component which will eventually throw an error that we'll
731
- * catch - this will be our sample error.
732
- * (3) diffing the control and sample error stacks to find the stack frame
733
- * which represents our component.
734
- */
735
-
736
-
737
- function describeNativeComponentFrame(fn, construct) {
738
- // If something asked for a stack inside a fake render, it should get ignored.
739
- if (!fn || reentry) {
740
- return '';
741
- }
742
-
743
- {
744
- var frame = componentFrameCache.get(fn);
745
-
746
- if (frame !== undefined) {
747
- return frame;
748
- }
749
- }
750
-
751
- reentry = true;
752
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
753
-
754
- Error.prepareStackTrace = undefined;
755
- var previousDispatcher = null;
756
-
757
- {
758
- previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
759
- // for warnings.
760
-
761
- ReactSharedInternals.H = null;
762
- disableLogs();
763
- }
764
- /**
765
- * Finding a common stack frame between sample and control errors can be
766
- * tricky given the different types and levels of stack trace truncation from
767
- * different JS VMs. So instead we'll attempt to control what that common
768
- * frame should be through this object method:
769
- * Having both the sample and control errors be in the function under the
770
- * `DescribeNativeComponentFrameRoot` property, + setting the `name` and
771
- * `displayName` properties of the function ensures that a stack
772
- * frame exists that has the method name `DescribeNativeComponentFrameRoot` in
773
- * it for both control and sample stacks.
774
- */
775
-
776
-
777
- var RunInRootFrame = {
778
- DetermineComponentFrameRoot: function () {
779
- var control;
780
-
781
- try {
782
- // This should throw.
783
- if (construct) {
784
- // Something should be setting the props in the constructor.
785
- var Fake = function () {
786
- throw Error();
787
- }; // $FlowFixMe[prop-missing]
788
-
789
-
790
- Object.defineProperty(Fake.prototype, 'props', {
791
- set: function () {
792
- // We use a throwing setter instead of frozen or non-writable props
793
- // because that won't throw in a non-strict mode function.
794
- throw Error();
795
- }
796
- });
797
-
798
- if (typeof Reflect === 'object' && Reflect.construct) {
799
- // We construct a different control for this case to include any extra
800
- // frames added by the construct call.
801
- try {
802
- Reflect.construct(Fake, []);
803
- } catch (x) {
804
- control = x;
805
- }
806
-
807
- Reflect.construct(fn, [], Fake);
808
- } else {
809
- try {
810
- Fake.call();
811
- } catch (x) {
812
- control = x;
813
- } // $FlowFixMe[prop-missing] found when upgrading Flow
814
-
815
-
816
- fn.call(Fake.prototype);
817
- }
818
- } else {
819
- try {
820
- throw Error();
821
- } catch (x) {
822
- control = x;
823
- } // TODO(luna): This will currently only throw if the function component
824
- // tries to access React/ReactDOM/props. We should probably make this throw
825
- // in simple components too
826
-
827
-
828
- var maybePromise = fn(); // If the function component returns a promise, it's likely an async
829
- // component, which we don't yet support. Attach a noop catch handler to
830
- // silence the error.
831
- // TODO: Implement component stacks for async client components?
832
-
833
- if (maybePromise && typeof maybePromise.catch === 'function') {
834
- maybePromise.catch(function () {});
835
- }
836
- }
837
- } catch (sample) {
838
- // This is inlined manually because closure doesn't do it for us.
839
- if (sample && control && typeof sample.stack === 'string') {
840
- return [sample.stack, control.stack];
841
- }
842
- }
843
-
844
- return [null, null];
845
- }
846
- }; // $FlowFixMe[prop-missing]
847
-
848
- RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';
849
- var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.
850
-
851
- if (namePropDescriptor && namePropDescriptor.configurable) {
852
- // V8 utilizes a function's `name` property when generating a stack trace.
853
- Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor
854
- // is set to `false`.
855
- // $FlowFixMe[cannot-write]
856
- 'name', {
857
- value: 'DetermineComponentFrameRoot'
858
- });
859
- }
860
-
861
- try {
862
- var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
863
- sampleStack = _RunInRootFrame$Deter[0],
864
- controlStack = _RunInRootFrame$Deter[1];
865
-
866
- if (sampleStack && controlStack) {
867
- // This extracts the first frame from the sample that isn't also in the control.
868
- // Skipping one frame that we assume is the frame that calls the two.
869
- var sampleLines = sampleStack.split('\n');
870
- var controlLines = controlStack.split('\n');
871
- var s = 0;
872
- var c = 0;
873
-
874
- while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
875
- s++;
876
- }
877
-
878
- while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
879
- c++;
880
- } // We couldn't find our intentionally injected common root frame, attempt
881
- // to find another common root frame by search from the bottom of the
882
- // control stack...
883
-
884
-
885
- if (s === sampleLines.length || c === controlLines.length) {
886
- s = sampleLines.length - 1;
887
- c = controlLines.length - 1;
888
-
889
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
890
- // We expect at least one stack frame to be shared.
891
- // Typically this will be the root most one. However, stack frames may be
892
- // cut off due to maximum stack limits. In this case, one maybe cut off
893
- // earlier than the other. We assume that the sample is longer or the same
894
- // and there for cut off earlier. So we should find the root most frame in
895
- // the sample somewhere in the control.
896
- c--;
897
- }
898
- }
899
-
900
- for (; s >= 1 && c >= 0; s--, c--) {
901
- // Next we find the first one that isn't the same which should be the
902
- // frame that called our sample function and the control.
903
- if (sampleLines[s] !== controlLines[c]) {
904
- // In V8, the first line is describing the message but other VMs don't.
905
- // If we're about to return the first line, and the control is also on the same
906
- // line, that's a pretty good indicator that our sample threw at same line as
907
- // the control. I.e. before we entered the sample frame. So we ignore this result.
908
- // This can happen if you passed a class to function component, or non-function.
909
- if (s !== 1 || c !== 1) {
910
- do {
911
- s--;
912
- c--; // We may still have similar intermediate frames from the construct call.
913
- // The next one that isn't the same should be our match though.
914
-
915
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
916
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
917
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
918
- // but we have a user-provided "displayName"
919
- // splice it in to make the stack more readable.
920
-
921
-
922
- if (fn.displayName && _frame.includes('<anonymous>')) {
923
- _frame = _frame.replace('<anonymous>', fn.displayName);
924
- }
925
-
926
- if (true) {
927
- if (typeof fn === 'function') {
928
- componentFrameCache.set(fn, _frame);
929
- }
930
- } // Return the line we found.
931
-
932
-
933
- return _frame;
934
- }
935
- } while (s >= 1 && c >= 0);
936
- }
937
-
938
- break;
939
- }
940
- }
941
- }
942
- } finally {
943
- reentry = false;
944
-
945
- {
946
- ReactSharedInternals.H = previousDispatcher;
947
- reenableLogs();
948
- }
949
-
950
- Error.prepareStackTrace = previousPrepareStackTrace;
951
- } // Fallback to just using the name if we couldn't make it throw.
952
-
953
-
954
- var name = fn ? fn.displayName || fn.name : '';
955
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
956
-
957
- {
958
- if (typeof fn === 'function') {
959
- componentFrameCache.set(fn, syntheticFrame);
960
- }
961
- }
962
-
963
- return syntheticFrame;
964
- }
965
- function describeFunctionComponentFrame(fn) {
966
- {
967
- return describeNativeComponentFrame(fn, false);
968
- }
969
- }
970
-
971
- function shouldConstruct(Component) {
972
- var prototype = Component.prototype;
973
- return !!(prototype && prototype.isReactComponent);
974
- } // TODO: Delete this once the key warning no longer uses it. I.e. when enableOwnerStacks ship.
975
-
976
-
977
- function describeUnknownElementTypeFrameInDEV(type) {
978
-
979
- if (type == null) {
980
- return '';
981
- }
982
-
983
- if (typeof type === 'function') {
984
- {
985
- return describeNativeComponentFrame(type, shouldConstruct(type));
986
- }
987
- }
988
-
989
- if (typeof type === 'string') {
990
- return describeBuiltInComponentFrame(type);
991
- }
992
-
993
- switch (type) {
994
- case REACT_SUSPENSE_TYPE:
995
- return describeBuiltInComponentFrame('Suspense');
996
-
997
- case REACT_SUSPENSE_LIST_TYPE:
998
- return describeBuiltInComponentFrame('SuspenseList');
999
- }
1000
-
1001
- if (typeof type === 'object') {
1002
- switch (type.$$typeof) {
1003
- case REACT_FORWARD_REF_TYPE:
1004
- return describeFunctionComponentFrame(type.render);
1005
-
1006
- case REACT_MEMO_TYPE:
1007
- // Memo may contain any component type so we recursively resolve it.
1008
- return describeUnknownElementTypeFrameInDEV(type.type);
1009
-
1010
- case REACT_LAZY_TYPE:
1011
- {
1012
- var lazyComponent = type;
1013
- var payload = lazyComponent._payload;
1014
- var init = lazyComponent._init;
1015
-
1016
- try {
1017
- // Lazy may contain any component type so we recursively resolve it.
1018
- return describeUnknownElementTypeFrameInDEV(init(payload));
1019
- } catch (x) {}
1020
- }
1021
- }
1022
- }
1023
-
1024
- return '';
1025
- }
1026
-
1027
- var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
1028
-
1029
- function getOwner() {
1030
- {
1031
- var dispatcher = ReactSharedInternals.A;
1032
-
1033
- if (dispatcher === null) {
1034
- return null;
1035
- }
1036
-
1037
- return dispatcher.getOwner();
1038
- }
1039
- }
1040
-
1041
- var specialPropKeyWarningShown;
1042
- var didWarnAboutElementRef;
1043
- var didWarnAboutOldJSXRuntime;
1044
-
1045
- {
1046
- didWarnAboutElementRef = {};
1047
- }
1048
-
1049
- function hasValidRef(config) {
1050
- {
1051
- if (hasOwnProperty.call(config, 'ref')) {
1052
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1053
-
1054
- if (getter && getter.isReactWarning) {
1055
- return false;
1056
- }
1057
- }
1058
- }
1059
-
1060
- return config.ref !== undefined;
1061
- }
1062
-
1063
- function hasValidKey(config) {
1064
- {
1065
- if (hasOwnProperty.call(config, 'key')) {
1066
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1067
-
1068
- if (getter && getter.isReactWarning) {
1069
- return false;
1070
- }
1071
- }
1072
- }
1073
-
1074
- return config.key !== undefined;
1075
- }
1076
-
1077
- function defineKeyPropWarningGetter(props, displayName) {
1078
- {
1079
- var warnAboutAccessingKey = function () {
1080
- if (!specialPropKeyWarningShown) {
1081
- specialPropKeyWarningShown = true;
1082
-
1083
- error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://react.dev/link/special-props)', displayName);
1084
- }
1085
- };
1086
-
1087
- warnAboutAccessingKey.isReactWarning = true;
1088
- Object.defineProperty(props, 'key', {
1089
- get: warnAboutAccessingKey,
1090
- configurable: true
1091
- });
1092
- }
1093
- }
1094
-
1095
- function elementRefGetterWithDeprecationWarning() {
1096
- {
1097
- var componentName = getComponentNameFromType(this.type);
1098
-
1099
- if (!didWarnAboutElementRef[componentName]) {
1100
- didWarnAboutElementRef[componentName] = true;
1101
-
1102
- error('Accessing element.ref was removed in React 19. ref is now a ' + 'regular prop. It will be removed from the JSX Element ' + 'type in a future release.');
1103
- } // An undefined `element.ref` is coerced to `null` for
1104
- // backwards compatibility.
1105
-
1106
-
1107
- var refProp = this.props.ref;
1108
- return refProp !== undefined ? refProp : null;
1109
- }
1110
- }
1111
- /**
1112
- * Factory method to create a new React element. This no longer adheres to
1113
- * the class pattern, so do not use new to call it. Also, instanceof check
1114
- * will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
1115
- * if something is a React Element.
1116
- *
1117
- * @param {*} type
1118
- * @param {*} props
1119
- * @param {*} key
1120
- * @param {string|object} ref
1121
- * @param {*} owner
1122
- * @param {*} self A *temporary* helper to detect places where `this` is
1123
- * different from the `owner` when React.createElement is called, so that we
1124
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1125
- * functions, and as long as `this` and owner are the same, there will be no
1126
- * change in behavior.
1127
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1128
- * indicating filename, line number, and/or other information.
1129
- * @internal
1130
- */
1131
-
1132
-
1133
- function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
1134
- var ref;
1135
-
1136
- {
1137
- // When enableRefAsProp is on, ignore whatever was passed as the ref
1138
- // argument and treat `props.ref` as the source of truth. The only thing we
1139
- // use this for is `element.ref`, which will log a deprecation warning on
1140
- // access. In the next release, we can remove `element.ref` as well as the
1141
- // `ref` argument.
1142
- var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
1143
- // backwards compatibility.
1144
-
1145
- ref = refProp !== undefined ? refProp : null;
1146
- }
1147
-
1148
- var element;
1149
-
1150
- {
1151
- // In dev, make `ref` a non-enumerable property with a warning. It's non-
1152
- // enumerable so that test matchers and serializers don't access it and
1153
- // trigger the warning.
1154
- //
1155
- // `ref` will be removed from the element completely in a future release.
1156
- element = {
1157
- // This tag allows us to uniquely identify this as a React Element
1158
- $$typeof: REACT_ELEMENT_TYPE,
1159
- // Built-in properties that belong on the element
1160
- type: type,
1161
- key: key,
1162
- props: props,
1163
- // Record the component responsible for creating this element.
1164
- _owner: owner
1165
- };
1166
-
1167
- if (ref !== null) {
1168
- Object.defineProperty(element, 'ref', {
1169
- enumerable: false,
1170
- get: elementRefGetterWithDeprecationWarning
1171
- });
1172
- } else {
1173
- // Don't warn on access if a ref is not given. This reduces false
1174
- // positives in cases where a test serializer uses
1175
- // getOwnPropertyDescriptors to compare objects, like Jest does, which is
1176
- // a problem because it bypasses non-enumerability.
1177
- //
1178
- // So unfortunately this will trigger a false positive warning in Jest
1179
- // when the diff is printed:
1180
- //
1181
- // expect(<div ref={ref} />).toEqual(<span ref={ref} />);
1182
- //
1183
- // A bit sketchy, but this is what we've done for the `props.key` and
1184
- // `props.ref` accessors for years, which implies it will be good enough
1185
- // for `element.ref`, too. Let's see if anyone complains.
1186
- Object.defineProperty(element, 'ref', {
1187
- enumerable: false,
1188
- value: null
1189
- });
1190
- }
1191
- }
1192
-
1193
- {
1194
- // The validation flag is currently mutative. We put it on
1195
- // an external backing store so that we can freeze the whole object.
1196
- // This can be replaced with a WeakMap once they are implemented in
1197
- // commonly used development environments.
1198
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1199
- // the validation flag non-enumerable (where possible, which should
1200
- // include every environment we run tests in), so the test framework
1201
- // ignores it.
1202
-
1203
- Object.defineProperty(element._store, 'validated', {
1204
- configurable: false,
1205
- enumerable: false,
1206
- writable: true,
1207
- value: 0
1208
- }); // debugInfo contains Server Component debug information.
1209
-
1210
- Object.defineProperty(element, '_debugInfo', {
1211
- configurable: false,
1212
- enumerable: false,
1213
- writable: true,
1214
- value: null
1215
- });
1216
-
1217
- if (Object.freeze) {
1218
- Object.freeze(element.props);
1219
- Object.freeze(element);
1220
- }
1221
- }
1222
-
1223
- return element;
1224
- }
1225
- /**
1226
- * Create and return a new ReactElement of the given type.
1227
- * See https://reactjs.org/docs/react-api.html#createelement
1228
- */
1229
-
1230
-
1231
- function createElement(type, config, children) {
1232
- {
1233
- if (!isValidElementType(type)) {
1234
- // This is just an optimistic check that provides a better stack trace before
1235
- // owner stacks. It's really up to the renderer if it's a valid element type.
1236
- // When owner stacks are enabled, we instead warn in the renderer and it'll
1237
- // have the stack trace of the JSX element anyway.
1238
- //
1239
- // This is an invalid element type.
1240
- //
1241
- // We warn in this case but don't throw. We expect the element creation to
1242
- // succeed and there will likely be errors in render.
1243
- var info = '';
1244
-
1245
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1246
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
1247
- }
1248
-
1249
- var typeString;
1250
-
1251
- if (type === null) {
1252
- typeString = 'null';
1253
- } else if (isArray(type)) {
1254
- typeString = 'array';
1255
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1256
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1257
- info = ' Did you accidentally export a JSX literal instead of a component?';
1258
- } else {
1259
- typeString = typeof type;
1260
- }
1261
-
1262
- error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1263
- } else {
1264
- // This is a valid element type.
1265
- // Skip key warning if the type isn't valid since our key validation logic
1266
- // doesn't expect a non-string/function type and can throw confusing
1267
- // errors. We don't want exception behavior to differ between dev and
1268
- // prod. (Rendering will throw with a helpful message and as soon as the
1269
- // type is fixed, the key warnings will appear.)
1270
- for (var i = 2; i < arguments.length; i++) {
1271
- validateChildKeys(arguments[i], type);
1272
- }
1273
- } // Unlike the jsx() runtime, createElement() doesn't warn about key spread.
1274
-
1275
- }
1276
-
1277
- var propName; // Reserved names are extracted
1278
-
1279
- var props = {};
1280
- var key = null;
1281
- var ref = null;
1282
-
1283
- if (config != null) {
1284
- {
1285
- if (!didWarnAboutOldJSXRuntime && '__self' in config && // Do not assume this is the result of an oudated JSX transform if key
1286
- // is present, because the modern JSX transform sometimes outputs
1287
- // createElement to preserve precedence between a static key and a
1288
- // spread key. To avoid false positive warnings, we never warn if
1289
- // there's a key.
1290
- !('key' in config)) {
1291
- didWarnAboutOldJSXRuntime = true;
1292
-
1293
- warn('Your app (or one of its dependencies) is using an outdated JSX ' + 'transform. Update to the modern JSX transform for ' + 'faster performance: https://react.dev/link/new-jsx-transform');
1294
- }
1295
- }
1296
-
1297
- if (hasValidRef(config)) ;
1298
-
1299
- if (hasValidKey(config)) {
1300
- {
1301
- checkKeyStringCoercion(config.key);
1302
- }
1303
-
1304
- key = '' + config.key;
1305
- } // Remaining properties are added to a new props object
1306
-
1307
-
1308
- for (propName in config) {
1309
- if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1310
- propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
1311
- // them to appear as props, so in createElement we filter them out.
1312
- // We don't have to do this in the jsx() runtime because the jsx()
1313
- // transform never passed these as props; it used separate arguments.
1314
- propName !== '__self' && propName !== '__source') {
1315
- {
1316
- props[propName] = config[propName];
1317
- }
1318
- }
1319
- }
1320
- } // Children can be more than one argument, and those are transferred onto
1321
- // the newly allocated props object.
1322
-
1323
-
1324
- var childrenLength = arguments.length - 2;
1325
-
1326
- if (childrenLength === 1) {
1327
- props.children = children;
1328
- } else if (childrenLength > 1) {
1329
- var childArray = Array(childrenLength);
1330
-
1331
- for (var _i = 0; _i < childrenLength; _i++) {
1332
- childArray[_i] = arguments[_i + 2];
1333
- }
1334
-
1335
- {
1336
- if (Object.freeze) {
1337
- Object.freeze(childArray);
1338
- }
1339
- }
1340
-
1341
- props.children = childArray;
1342
- } // Resolve default props
1343
-
1344
-
1345
- if (type && type.defaultProps) {
1346
- var defaultProps = type.defaultProps;
1347
-
1348
- for (propName in defaultProps) {
1349
- if (props[propName] === undefined) {
1350
- props[propName] = defaultProps[propName];
1351
- }
1352
- }
1353
- }
1354
-
1355
- {
1356
- if (key || !enableRefAsProp ) {
1357
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1358
-
1359
- if (key) {
1360
- defineKeyPropWarningGetter(props, displayName);
1361
- }
1362
- }
1363
- }
1364
-
1365
- return ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
1366
- }
1367
- function cloneAndReplaceKey(oldElement, newKey) {
1368
- var clonedElement = ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
1369
- // exists to avoid the `ref` access warning.
1370
- null , undefined, undefined, oldElement._owner, oldElement.props);
1371
-
1372
- {
1373
- // The cloned element should inherit the original element's key validation.
1374
- clonedElement._store.validated = oldElement._store.validated;
1375
- }
1376
-
1377
- return clonedElement;
1378
- }
1379
- /**
1380
- * Clone and return a new ReactElement using element as the starting point.
1381
- * See https://reactjs.org/docs/react-api.html#cloneelement
1382
- */
1383
-
1384
- function cloneElement(element, config, children) {
1385
- if (element === null || element === undefined) {
1386
- throw new Error("The argument must be a React element, but you passed " + element + ".");
1387
- }
1388
-
1389
- var propName; // Original props are copied
1390
-
1391
- var props = assign({}, element.props); // Reserved names are extracted
1392
-
1393
- var key = element.key;
1394
- var ref = null ; // Owner will be preserved, unless ref is overridden
1395
-
1396
- var owner = element._owner;
1397
-
1398
- if (config != null) {
1399
- if (hasValidRef(config)) {
1400
- owner = getOwner() ;
1401
- }
1402
-
1403
- if (hasValidKey(config)) {
1404
- {
1405
- checkKeyStringCoercion(config.key);
1406
- }
1407
-
1408
- key = '' + config.key;
1409
- } // Remaining properties override existing props
1410
-
1411
- for (propName in config) {
1412
- if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
1413
- propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
1414
- // warnings and debug information in dev. Need to decide if we're OK
1415
- // with dropping them. In the jsx() runtime it's not an issue because
1416
- // the data gets passed as separate arguments instead of props, but
1417
- // it would be nice to stop relying on them entirely so we can drop
1418
- // them from the internal Fiber field.
1419
- propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
1420
- // if the property were missing. This is mostly for
1421
- // backwards compatibility.
1422
- !(propName === 'ref' && config.ref === undefined)) {
1423
- {
1424
- {
1425
- props[propName] = config[propName];
1426
- }
1427
- }
1428
- }
1429
- }
1430
- } // Children can be more than one argument, and those are transferred onto
1431
- // the newly allocated props object.
1432
-
1433
-
1434
- var childrenLength = arguments.length - 2;
1435
-
1436
- if (childrenLength === 1) {
1437
- props.children = children;
1438
- } else if (childrenLength > 1) {
1439
- var childArray = Array(childrenLength);
1440
-
1441
- for (var i = 0; i < childrenLength; i++) {
1442
- childArray[i] = arguments[i + 2];
1443
- }
1444
-
1445
- props.children = childArray;
1446
- }
1447
-
1448
- var clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
1449
-
1450
- for (var _i2 = 2; _i2 < arguments.length; _i2++) {
1451
- validateChildKeys(arguments[_i2], clonedElement.type);
1452
- }
1453
-
1454
- return clonedElement;
1455
- }
1456
- /**
1457
- * Ensure that every element either is passed in a static location, in an
1458
- * array with an explicit keys property defined, or in an object literal
1459
- * with valid key property.
1460
- *
1461
- * @internal
1462
- * @param {ReactNode} node Statically passed child of any type.
1463
- * @param {*} parentType node's parent's type.
1464
- */
1465
-
1466
- function validateChildKeys(node, parentType) {
1467
- {
1468
- if (typeof node !== 'object' || !node) {
1469
- return;
1470
- }
1471
-
1472
- if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
1473
- for (var i = 0; i < node.length; i++) {
1474
- var child = node[i];
1475
-
1476
- if (isValidElement(child)) {
1477
- validateExplicitKey(child, parentType);
1478
- }
1479
- }
1480
- } else if (isValidElement(node)) {
1481
- // This element was passed in a valid location.
1482
- if (node._store) {
1483
- node._store.validated = 1;
1484
- }
1485
- } else {
1486
- var iteratorFn = getIteratorFn(node);
1487
-
1488
- if (typeof iteratorFn === 'function') {
1489
- // Entry iterators used to provide implicit keys,
1490
- // but now we print a separate warning for them later.
1491
- if (iteratorFn !== node.entries) {
1492
- var iterator = iteratorFn.call(node);
1493
-
1494
- if (iterator !== node) {
1495
- var step;
1496
-
1497
- while (!(step = iterator.next()).done) {
1498
- if (isValidElement(step.value)) {
1499
- validateExplicitKey(step.value, parentType);
1500
- }
1501
- }
1502
- }
1503
- }
1504
- }
1505
- }
1506
- }
1507
- }
1508
- /**
1509
- * Verifies the object is a ReactElement.
1510
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1511
- * @param {?object} object
1512
- * @return {boolean} True if `object` is a ReactElement.
1513
- * @final
1514
- */
1515
-
1516
-
1517
- function isValidElement(object) {
1518
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1519
- }
1520
- var ownerHasKeyUseWarning = {};
1521
- /**
1522
- * Warn if the element doesn't have an explicit key assigned to it.
1523
- * This element is in an array. The array could grow and shrink or be
1524
- * reordered. All children that haven't already been validated are required to
1525
- * have a "key" property assigned to it. Error statuses are cached so a warning
1526
- * will only be shown once.
1527
- *
1528
- * @internal
1529
- * @param {ReactElement} element Element that requires a key.
1530
- * @param {*} parentType element's parent's type.
1531
- */
1532
-
1533
- function validateExplicitKey(element, parentType) {
1534
-
1535
- {
1536
- if (!element._store || element._store.validated || element.key != null) {
1537
- return;
1538
- }
1539
-
1540
- element._store.validated = 1;
1541
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1542
-
1543
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1544
- return;
1545
- }
1546
-
1547
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1548
- // property, it may be the creator of the child that's responsible for
1549
- // assigning it a key.
1550
-
1551
- var childOwner = '';
1552
-
1553
- if (element && element._owner != null && element._owner !== getOwner()) {
1554
- var ownerName = null;
1555
-
1556
- if (typeof element._owner.tag === 'number') {
1557
- ownerName = getComponentNameFromType(element._owner.type);
1558
- } else if (typeof element._owner.name === 'string') {
1559
- ownerName = element._owner.name;
1560
- } // Give the component that originally created this child.
1561
-
1562
-
1563
- childOwner = " It was passed a child from " + ownerName + ".";
1564
- }
1565
-
1566
- var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
1567
-
1568
- ReactSharedInternals.getCurrentStack = function () {
1569
-
1570
- var stack = describeUnknownElementTypeFrameInDEV(element.type); // Delegate to the injected renderer-specific implementation
1571
-
1572
- if (prevGetCurrentStack) {
1573
- stack += prevGetCurrentStack() || '';
1574
- }
1575
-
1576
- return stack;
1577
- };
1578
-
1579
- error('Each child in a list should have a unique "key" prop.' + '%s%s See https://react.dev/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
1580
-
1581
- ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
1582
- }
1583
- }
1584
-
1585
- function getCurrentComponentErrorInfo(parentType) {
1586
- {
1587
- var info = '';
1588
- var owner = getOwner();
1589
-
1590
- if (owner) {
1591
- var name = getComponentNameFromType(owner.type);
1592
-
1593
- if (name) {
1594
- info = '\n\nCheck the render method of `' + name + '`.';
1595
- }
1596
- }
1597
-
1598
- if (!info) {
1599
- var parentName = getComponentNameFromType(parentType);
1600
-
1601
- if (parentName) {
1602
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1603
- }
1604
- }
1605
-
1606
- return info;
1607
- }
1608
- }
1609
-
1610
- var SEPARATOR = '.';
1611
- var SUBSEPARATOR = ':';
1612
- /**
1613
- * Escape and wrap key so it is safe to use as a reactid
1614
- *
1615
- * @param {string} key to be escaped.
1616
- * @return {string} the escaped key.
1617
- */
1618
-
1619
- function escape(key) {
1620
- var escapeRegex = /[=:]/g;
1621
- var escaperLookup = {
1622
- '=': '=0',
1623
- ':': '=2'
1624
- };
1625
- var escapedString = key.replace(escapeRegex, function (match) {
1626
- return escaperLookup[match];
1627
- });
1628
- return '$' + escapedString;
1629
- }
1630
- /**
1631
- * TODO: Test that a single child and an array with one item have the same key
1632
- * pattern.
1633
- */
1634
-
1635
-
1636
- var didWarnAboutMaps = false;
1637
- var userProvidedKeyEscapeRegex = /\/+/g;
1638
-
1639
- function escapeUserProvidedKey(text) {
1640
- return text.replace(userProvidedKeyEscapeRegex, '$&/');
1641
- }
1642
- /**
1643
- * Generate a key string that identifies a element within a set.
1644
- *
1645
- * @param {*} element A element that could contain a manual key.
1646
- * @param {number} index Index that is used if a manual key is not provided.
1647
- * @return {string}
1648
- */
1649
-
1650
-
1651
- function getElementKey(element, index) {
1652
- // Do some typechecking here since we call this blindly. We want to ensure
1653
- // that we don't block potential future ES APIs.
1654
- if (typeof element === 'object' && element !== null && element.key != null) {
1655
- // Explicit key
1656
- {
1657
- checkKeyStringCoercion(element.key);
1658
- }
1659
-
1660
- return escape('' + element.key);
1661
- } // Implicit key determined by the index in the set
1662
-
1663
-
1664
- return index.toString(36);
1665
- }
1666
-
1667
- function noop$1() {}
1668
-
1669
- function resolveThenable(thenable) {
1670
- switch (thenable.status) {
1671
- case 'fulfilled':
1672
- {
1673
- var fulfilledValue = thenable.value;
1674
- return fulfilledValue;
1675
- }
1676
-
1677
- case 'rejected':
1678
- {
1679
- var rejectedError = thenable.reason;
1680
- throw rejectedError;
1681
- }
1682
-
1683
- default:
1684
- {
1685
- if (typeof thenable.status === 'string') {
1686
- // Only instrument the thenable if the status if not defined. If
1687
- // it's defined, but an unknown value, assume it's been instrumented by
1688
- // some custom userspace implementation. We treat it as "pending".
1689
- // Attach a dummy listener, to ensure that any lazy initialization can
1690
- // happen. Flight lazily parses JSON when the value is actually awaited.
1691
- thenable.then(noop$1, noop$1);
1692
- } else {
1693
- // This is an uncached thenable that we haven't seen before.
1694
- // TODO: Detect infinite ping loops caused by uncached promises.
1695
- var pendingThenable = thenable;
1696
- pendingThenable.status = 'pending';
1697
- pendingThenable.then(function (fulfilledValue) {
1698
- if (thenable.status === 'pending') {
1699
- var fulfilledThenable = thenable;
1700
- fulfilledThenable.status = 'fulfilled';
1701
- fulfilledThenable.value = fulfilledValue;
1702
- }
1703
- }, function (error) {
1704
- if (thenable.status === 'pending') {
1705
- var rejectedThenable = thenable;
1706
- rejectedThenable.status = 'rejected';
1707
- rejectedThenable.reason = error;
1708
- }
1709
- });
1710
- } // Check one more time in case the thenable resolved synchronously.
1711
-
1712
-
1713
- switch (thenable.status) {
1714
- case 'fulfilled':
1715
- {
1716
- var fulfilledThenable = thenable;
1717
- return fulfilledThenable.value;
1718
- }
1719
-
1720
- case 'rejected':
1721
- {
1722
- var rejectedThenable = thenable;
1723
- var _rejectedError = rejectedThenable.reason;
1724
- throw _rejectedError;
1725
- }
1726
- }
1727
- }
1728
- }
1729
-
1730
- throw thenable;
1731
- }
1732
-
1733
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1734
- var type = typeof children;
1735
-
1736
- if (type === 'undefined' || type === 'boolean') {
1737
- // All of the above are perceived as null.
1738
- children = null;
1739
- }
1740
-
1741
- var invokeCallback = false;
1742
-
1743
- if (children === null) {
1744
- invokeCallback = true;
1745
- } else {
1746
- switch (type) {
1747
- case 'bigint':
1748
- case 'string':
1749
- case 'number':
1750
- invokeCallback = true;
1751
- break;
1752
-
1753
- case 'object':
1754
- switch (children.$$typeof) {
1755
- case REACT_ELEMENT_TYPE:
1756
- case REACT_PORTAL_TYPE:
1757
- invokeCallback = true;
1758
- break;
1759
-
1760
- case REACT_LAZY_TYPE:
1761
- var payload = children._payload;
1762
- var init = children._init;
1763
- return mapIntoArray(init(payload), array, escapedPrefix, nameSoFar, callback);
1764
- }
1765
-
1766
- }
1767
- }
1768
-
1769
- if (invokeCallback) {
1770
- var _child = children;
1771
- var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1772
- // so that it's consistent if the number of children grows:
1773
-
1774
- var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1775
-
1776
- if (isArray(mappedChild)) {
1777
- var escapedChildKey = '';
1778
-
1779
- if (childKey != null) {
1780
- escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1781
- }
1782
-
1783
- mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1784
- return c;
1785
- });
1786
- } else if (mappedChild != null) {
1787
- if (isValidElement(mappedChild)) {
1788
- {
1789
- // The `if` statement here prevents auto-disabling of the safe
1790
- // coercion ESLint rule, so we must manually disable it below.
1791
- // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1792
- if (mappedChild.key != null) {
1793
- if (!_child || _child.key !== mappedChild.key) {
1794
- checkKeyStringCoercion(mappedChild.key);
1795
- }
1796
- }
1797
- }
1798
-
1799
- var newChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1800
- // traverseAllChildren used to do for objects as children
1801
- escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1802
- mappedChild.key != null && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
1803
- '' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
1804
- ) + '/' : '') + childKey);
1805
-
1806
- {
1807
- // If `child` was an element without a `key`, we need to validate if
1808
- // it should have had a `key`, before assigning one to `mappedChild`.
1809
- // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
1810
- if (nameSoFar !== '' && _child != null && isValidElement(_child) && _child.key == null) {
1811
- // We check truthiness of `child._store.validated` instead of being
1812
- // inequal to `1` to provide a bit of backward compatibility for any
1813
- // libraries (like `fbt`) which may be hacking this property.
1814
- if (_child._store && !_child._store.validated) {
1815
- // Mark this child as having failed validation, but let the actual
1816
- // renderer print the warning later.
1817
- newChild._store.validated = 2;
1818
- }
1819
- }
1820
- }
1821
-
1822
- mappedChild = newChild;
1823
- }
1824
-
1825
- array.push(mappedChild);
1826
- }
1827
-
1828
- return 1;
1829
- }
1830
-
1831
- var child;
1832
- var nextName;
1833
- var subtreeCount = 0; // Count of children found in the current subtree.
1834
-
1835
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1836
-
1837
- if (isArray(children)) {
1838
- for (var i = 0; i < children.length; i++) {
1839
- child = children[i];
1840
- nextName = nextNamePrefix + getElementKey(child, i);
1841
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1842
- }
1843
- } else {
1844
- var iteratorFn = getIteratorFn(children);
1845
-
1846
- if (typeof iteratorFn === 'function') {
1847
- var iterableChildren = children;
1848
-
1849
- {
1850
- // Warn about using Maps as children
1851
- if (iteratorFn === iterableChildren.entries) {
1852
- if (!didWarnAboutMaps) {
1853
- warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1854
- }
1855
-
1856
- didWarnAboutMaps = true;
1857
- }
1858
- }
1859
-
1860
- var iterator = iteratorFn.call(iterableChildren);
1861
- var step;
1862
- var ii = 0; // $FlowFixMe[incompatible-use] `iteratorFn` might return null according to typing.
1863
-
1864
- while (!(step = iterator.next()).done) {
1865
- child = step.value;
1866
- nextName = nextNamePrefix + getElementKey(child, ii++);
1867
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1868
- }
1869
- } else if (type === 'object') {
1870
- if (typeof children.then === 'function') {
1871
- return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
1872
- } // eslint-disable-next-line react-internal/safe-string-coercion
1873
-
1874
-
1875
- var childrenString = String(children);
1876
- throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
1877
- }
1878
- }
1879
-
1880
- return subtreeCount;
1881
- }
1882
- /**
1883
- * Maps children that are typically specified as `props.children`.
1884
- *
1885
- * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1886
- *
1887
- * The provided mapFunction(child, index) will be called for each
1888
- * leaf child.
1889
- *
1890
- * @param {?*} children Children tree container.
1891
- * @param {function(*, int)} func The map function.
1892
- * @param {*} context Context for mapFunction.
1893
- * @return {object} Object containing the ordered map of results.
1894
- */
1895
-
1896
-
1897
- function mapChildren(children, func, context) {
1898
- if (children == null) {
1899
- // $FlowFixMe limitation refining abstract types in Flow
1900
- return children;
1901
- }
1902
-
1903
- var result = [];
1904
- var count = 0;
1905
- mapIntoArray(children, result, '', '', function (child) {
1906
- return func.call(context, child, count++);
1907
- });
1908
- return result;
1909
- }
1910
- /**
1911
- * Count the number of children that are typically specified as
1912
- * `props.children`.
1913
- *
1914
- * See https://reactjs.org/docs/react-api.html#reactchildrencount
1915
- *
1916
- * @param {?*} children Children tree container.
1917
- * @return {number} The number of children.
1918
- */
1919
-
1920
-
1921
- function countChildren(children) {
1922
- var n = 0;
1923
- mapChildren(children, function () {
1924
- n++; // Don't return anything
1925
- });
1926
- return n;
1927
- }
1928
- /**
1929
- * Iterates through children that are typically specified as `props.children`.
1930
- *
1931
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1932
- *
1933
- * The provided forEachFunc(child, index) will be called for each
1934
- * leaf child.
1935
- *
1936
- * @param {?*} children Children tree container.
1937
- * @param {function(*, int)} forEachFunc
1938
- * @param {*} forEachContext Context for forEachContext.
1939
- */
1940
-
1941
-
1942
- function forEachChildren(children, forEachFunc, forEachContext) {
1943
- mapChildren(children, // $FlowFixMe[missing-this-annot]
1944
- function () {
1945
- forEachFunc.apply(this, arguments); // Don't return anything.
1946
- }, forEachContext);
1947
- }
1948
- /**
1949
- * Flatten a children object (typically specified as `props.children`) and
1950
- * return an array with appropriately re-keyed children.
1951
- *
1952
- * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1953
- */
1954
-
1955
-
1956
- function toArray(children) {
1957
- return mapChildren(children, function (child) {
1958
- return child;
1959
- }) || [];
1960
- }
1961
- /**
1962
- * Returns the first child in a collection of children and verifies that there
1963
- * is only one child in the collection.
1964
- *
1965
- * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1966
- *
1967
- * The current implementation of this function assumes that a single child gets
1968
- * passed without a wrapper, but the purpose of this helper function is to
1969
- * abstract away the particular structure of children.
1970
- *
1971
- * @param {?object} children Child collection structure.
1972
- * @return {ReactElement} The first and only `ReactElement` contained in the
1973
- * structure.
1974
- */
1975
-
1976
-
1977
- function onlyChild(children) {
1978
- if (!isValidElement(children)) {
1979
- throw new Error('React.Children.only expected to receive a single React element child.');
1980
- }
1981
-
1982
- return children;
1983
- }
1984
-
1985
- function createContext(defaultValue) {
1986
- // TODO: Second argument used to be an optional `calculateChangedBits`
1987
- // function. Warn to reserve for future use?
1988
- var context = {
1989
- $$typeof: REACT_CONTEXT_TYPE,
1990
- // As a workaround to support multiple concurrent renderers, we categorize
1991
- // some renderers as primary and others as secondary. We only expect
1992
- // there to be two concurrent renderers at most: React Native (primary) and
1993
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
1994
- // Secondary renderers store their context values on separate fields.
1995
- _currentValue: defaultValue,
1996
- _currentValue2: defaultValue,
1997
- // Used to track how many concurrent renderers this context currently
1998
- // supports within in a single renderer. Such as parallel server rendering.
1999
- _threadCount: 0,
2000
- // These are circular
2001
- Provider: null,
2002
- Consumer: null
2003
- };
2004
-
2005
- {
2006
- context.Provider = context;
2007
- context.Consumer = {
2008
- $$typeof: REACT_CONSUMER_TYPE,
2009
- _context: context
2010
- };
2011
- }
2012
-
2013
- {
2014
- context._currentRenderer = null;
2015
- context._currentRenderer2 = null;
2016
- }
2017
-
2018
- return context;
2019
- }
2020
-
2021
- var Uninitialized = -1;
2022
- var Pending = 0;
2023
- var Resolved = 1;
2024
- var Rejected = 2;
2025
-
2026
- function lazyInitializer(payload) {
2027
- if (payload._status === Uninitialized) {
2028
- var ctor = payload._result;
2029
- var thenable = ctor(); // Transition to the next state.
2030
- // This might throw either because it's missing or throws. If so, we treat it
2031
- // as still uninitialized and try again next time. Which is the same as what
2032
- // happens if the ctor or any wrappers processing the ctor throws. This might
2033
- // end up fixing it if the resolution was a concurrency bug.
2034
-
2035
- thenable.then(function (moduleObject) {
2036
- if (payload._status === Pending || payload._status === Uninitialized) {
2037
- // Transition to the next state.
2038
- var resolved = payload;
2039
- resolved._status = Resolved;
2040
- resolved._result = moduleObject;
2041
- }
2042
- }, function (error) {
2043
- if (payload._status === Pending || payload._status === Uninitialized) {
2044
- // Transition to the next state.
2045
- var rejected = payload;
2046
- rejected._status = Rejected;
2047
- rejected._result = error;
2048
- }
2049
- });
2050
-
2051
- if (payload._status === Uninitialized) {
2052
- // In case, we're still uninitialized, then we're waiting for the thenable
2053
- // to resolve. Set it as pending in the meantime.
2054
- var pending = payload;
2055
- pending._status = Pending;
2056
- pending._result = thenable;
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ function defineDeprecationWarning(methodName, info) {
15
+ Object.defineProperty(Component.prototype, methodName, {
16
+ get: function () {
17
+ console.warn(
18
+ "%s(...) is deprecated in plain JavaScript React classes. %s",
19
+ info[0],
20
+ info[1]
21
+ );
22
+ }
23
+ });
2057
24
  }
2058
- }
2059
-
2060
- if (payload._status === Resolved) {
2061
- var moduleObject = payload._result;
2062
-
2063
- {
2064
- if (moduleObject === undefined) {
2065
- error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2066
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
25
+ function getIteratorFn(maybeIterable) {
26
+ if (null === maybeIterable || "object" !== typeof maybeIterable)
27
+ return null;
28
+ maybeIterable =
29
+ (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
30
+ maybeIterable["@@iterator"];
31
+ return "function" === typeof maybeIterable ? maybeIterable : null;
32
+ }
33
+ function warnNoop(publicInstance, callerName) {
34
+ publicInstance =
35
+ ((publicInstance = publicInstance.constructor) &&
36
+ (publicInstance.displayName || publicInstance.name)) ||
37
+ "ReactClass";
38
+ var warningKey = publicInstance + "." + callerName;
39
+ didWarnStateUpdateForUnmountedComponent[warningKey] ||
40
+ (console.error(
41
+ "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
42
+ callerName,
43
+ publicInstance
44
+ ),
45
+ (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));
46
+ }
47
+ function Component(props, context, updater) {
48
+ this.props = props;
49
+ this.context = context;
50
+ this.refs = emptyObject;
51
+ this.updater = updater || ReactNoopUpdateQueue;
52
+ }
53
+ function ComponentDummy() {}
54
+ function PureComponent(props, context, updater) {
55
+ this.props = props;
56
+ this.context = context;
57
+ this.refs = emptyObject;
58
+ this.updater = updater || ReactNoopUpdateQueue;
59
+ }
60
+ function testStringCoercion(value) {
61
+ return "" + value;
62
+ }
63
+ function checkKeyStringCoercion(value) {
64
+ try {
65
+ testStringCoercion(value);
66
+ var JSCompiler_inline_result = !1;
67
+ } catch (e) {
68
+ JSCompiler_inline_result = !0;
2067
69
  }
2068
- }
2069
-
2070
- {
2071
- if (!('default' in moduleObject)) {
2072
- error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2073
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
70
+ if (JSCompiler_inline_result) {
71
+ JSCompiler_inline_result = console;
72
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
73
+ var JSCompiler_inline_result$jscomp$0 =
74
+ ("function" === typeof Symbol &&
75
+ Symbol.toStringTag &&
76
+ value[Symbol.toStringTag]) ||
77
+ value.constructor.name ||
78
+ "Object";
79
+ JSCompiler_temp_const.call(
80
+ JSCompiler_inline_result,
81
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
82
+ JSCompiler_inline_result$jscomp$0
83
+ );
84
+ return testStringCoercion(value);
2074
85
  }
2075
86
  }
2076
-
2077
- return moduleObject.default;
2078
- } else {
2079
- throw payload._result;
2080
- }
2081
- }
2082
-
2083
- function lazy(ctor) {
2084
- var payload = {
2085
- // We use these fields to store the result.
2086
- _status: Uninitialized,
2087
- _result: ctor
2088
- };
2089
- var lazyType = {
2090
- $$typeof: REACT_LAZY_TYPE,
2091
- _payload: payload,
2092
- _init: lazyInitializer
2093
- };
2094
-
2095
- return lazyType;
2096
- }
2097
-
2098
- function forwardRef(render) {
2099
- {
2100
- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
2101
- error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
2102
- } else if (typeof render !== 'function') {
2103
- error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
2104
- } else {
2105
- if (render.length !== 0 && render.length !== 2) {
2106
- error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
87
+ function getComponentNameFromType(type) {
88
+ if (null == type) return null;
89
+ if ("function" === typeof type)
90
+ return type.$$typeof === REACT_CLIENT_REFERENCE$2
91
+ ? null
92
+ : type.displayName || type.name || null;
93
+ if ("string" === typeof type) return type;
94
+ switch (type) {
95
+ case REACT_FRAGMENT_TYPE:
96
+ return "Fragment";
97
+ case REACT_PORTAL_TYPE:
98
+ return "Portal";
99
+ case REACT_PROFILER_TYPE:
100
+ return "Profiler";
101
+ case REACT_STRICT_MODE_TYPE:
102
+ return "StrictMode";
103
+ case REACT_SUSPENSE_TYPE:
104
+ return "Suspense";
105
+ case REACT_SUSPENSE_LIST_TYPE:
106
+ return "SuspenseList";
2107
107
  }
108
+ if ("object" === typeof type)
109
+ switch (
110
+ ("number" === typeof type.tag &&
111
+ console.error(
112
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
113
+ ),
114
+ type.$$typeof)
115
+ ) {
116
+ case REACT_CONTEXT_TYPE:
117
+ return (type.displayName || "Context") + ".Provider";
118
+ case REACT_CONSUMER_TYPE:
119
+ return (type._context.displayName || "Context") + ".Consumer";
120
+ case REACT_FORWARD_REF_TYPE:
121
+ var innerType = type.render;
122
+ type = type.displayName;
123
+ type ||
124
+ ((type = innerType.displayName || innerType.name || ""),
125
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
126
+ return type;
127
+ case REACT_MEMO_TYPE:
128
+ return (
129
+ (innerType = type.displayName || null),
130
+ null !== innerType
131
+ ? innerType
132
+ : getComponentNameFromType(type.type) || "Memo"
133
+ );
134
+ case REACT_LAZY_TYPE:
135
+ innerType = type._payload;
136
+ type = type._init;
137
+ try {
138
+ return getComponentNameFromType(type(innerType));
139
+ } catch (x) {}
140
+ }
141
+ return null;
2108
142
  }
2109
-
2110
- if (render != null) {
2111
- if (render.defaultProps != null) {
2112
- error('forwardRef render functions do not support defaultProps. ' + 'Did you accidentally pass a React component?');
143
+ function isValidElementType(type) {
144
+ return "string" === typeof type ||
145
+ "function" === typeof type ||
146
+ type === REACT_FRAGMENT_TYPE ||
147
+ type === REACT_PROFILER_TYPE ||
148
+ type === REACT_STRICT_MODE_TYPE ||
149
+ type === REACT_SUSPENSE_TYPE ||
150
+ type === REACT_SUSPENSE_LIST_TYPE ||
151
+ type === REACT_OFFSCREEN_TYPE ||
152
+ ("object" === typeof type &&
153
+ null !== type &&
154
+ (type.$$typeof === REACT_LAZY_TYPE ||
155
+ type.$$typeof === REACT_MEMO_TYPE ||
156
+ type.$$typeof === REACT_CONTEXT_TYPE ||
157
+ type.$$typeof === REACT_CONSUMER_TYPE ||
158
+ type.$$typeof === REACT_FORWARD_REF_TYPE ||
159
+ type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
160
+ void 0 !== type.getModuleId))
161
+ ? !0
162
+ : !1;
163
+ }
164
+ function disabledLog() {}
165
+ function disableLogs() {
166
+ if (0 === disabledDepth) {
167
+ prevLog = console.log;
168
+ prevInfo = console.info;
169
+ prevWarn = console.warn;
170
+ prevError = console.error;
171
+ prevGroup = console.group;
172
+ prevGroupCollapsed = console.groupCollapsed;
173
+ prevGroupEnd = console.groupEnd;
174
+ var props = {
175
+ configurable: !0,
176
+ enumerable: !0,
177
+ value: disabledLog,
178
+ writable: !0
179
+ };
180
+ Object.defineProperties(console, {
181
+ info: props,
182
+ log: props,
183
+ warn: props,
184
+ error: props,
185
+ group: props,
186
+ groupCollapsed: props,
187
+ groupEnd: props
188
+ });
2113
189
  }
2114
- }
2115
- }
2116
-
2117
- var elementType = {
2118
- $$typeof: REACT_FORWARD_REF_TYPE,
2119
- render: render
2120
- };
2121
-
2122
- {
2123
- var ownName;
2124
- Object.defineProperty(elementType, 'displayName', {
2125
- enumerable: false,
2126
- configurable: true,
2127
- get: function () {
2128
- return ownName;
2129
- },
2130
- set: function (name) {
2131
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2132
- // because the component may be used elsewhere.
2133
- // But it's nice for anonymous functions to inherit the name,
2134
- // so that our component-stack generation logic will display their frames.
2135
- // An anonymous function generally suggests a pattern like:
2136
- // React.forwardRef((props, ref) => {...});
2137
- // This kind of inner function is not used elsewhere so the side effect is okay.
2138
-
2139
- if (!render.name && !render.displayName) {
2140
- Object.defineProperty(render, 'name', {
2141
- value: name
2142
- });
2143
- render.displayName = name;
2144
- }
190
+ disabledDepth++;
191
+ }
192
+ function reenableLogs() {
193
+ disabledDepth--;
194
+ if (0 === disabledDepth) {
195
+ var props = { configurable: !0, enumerable: !0, writable: !0 };
196
+ Object.defineProperties(console, {
197
+ log: assign({}, props, { value: prevLog }),
198
+ info: assign({}, props, { value: prevInfo }),
199
+ warn: assign({}, props, { value: prevWarn }),
200
+ error: assign({}, props, { value: prevError }),
201
+ group: assign({}, props, { value: prevGroup }),
202
+ groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
203
+ groupEnd: assign({}, props, { value: prevGroupEnd })
204
+ });
2145
205
  }
2146
- });
2147
- }
2148
-
2149
- return elementType;
2150
- }
2151
-
2152
- function memo(type, compare) {
2153
- {
2154
- if (!isValidElementType(type)) {
2155
- error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
206
+ 0 > disabledDepth &&
207
+ console.error(
208
+ "disabledDepth fell below zero. This is a bug in React. Please file an issue."
209
+ );
2156
210
  }
2157
- }
2158
-
2159
- var elementType = {
2160
- $$typeof: REACT_MEMO_TYPE,
2161
- type: type,
2162
- compare: compare === undefined ? null : compare
2163
- };
2164
-
2165
- {
2166
- var ownName;
2167
- Object.defineProperty(elementType, 'displayName', {
2168
- enumerable: false,
2169
- configurable: true,
2170
- get: function () {
2171
- return ownName;
2172
- },
2173
- set: function (name) {
2174
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2175
- // because the component may be used elsewhere.
2176
- // But it's nice for anonymous functions to inherit the name,
2177
- // so that our component-stack generation logic will display their frames.
2178
- // An anonymous function generally suggests a pattern like:
2179
- // React.memo((props) => {...});
2180
- // This kind of inner function is not used elsewhere so the side effect is okay.
2181
-
2182
- if (!type.name && !type.displayName) {
2183
- Object.defineProperty(type, 'name', {
2184
- value: name
2185
- });
2186
- type.displayName = name;
211
+ function describeBuiltInComponentFrame(name) {
212
+ if (void 0 === prefix)
213
+ try {
214
+ throw Error();
215
+ } catch (x) {
216
+ var match = x.stack.trim().match(/\n( *(at )?)/);
217
+ prefix = (match && match[1]) || "";
218
+ suffix =
219
+ -1 < x.stack.indexOf("\n at")
220
+ ? " (<anonymous>)"
221
+ : -1 < x.stack.indexOf("@")
222
+ ? "@unknown:0:0"
223
+ : "";
2187
224
  }
225
+ return "\n" + prefix + name + suffix;
226
+ }
227
+ function describeNativeComponentFrame(fn, construct) {
228
+ if (!fn || reentry) return "";
229
+ var frame = componentFrameCache.get(fn);
230
+ if (void 0 !== frame) return frame;
231
+ reentry = !0;
232
+ frame = Error.prepareStackTrace;
233
+ Error.prepareStackTrace = void 0;
234
+ var previousDispatcher = null;
235
+ previousDispatcher = ReactSharedInternals.H;
236
+ ReactSharedInternals.H = null;
237
+ disableLogs();
238
+ try {
239
+ var RunInRootFrame = {
240
+ DetermineComponentFrameRoot: function () {
241
+ try {
242
+ if (construct) {
243
+ var Fake = function () {
244
+ throw Error();
245
+ };
246
+ Object.defineProperty(Fake.prototype, "props", {
247
+ set: function () {
248
+ throw Error();
249
+ }
250
+ });
251
+ if ("object" === typeof Reflect && Reflect.construct) {
252
+ try {
253
+ Reflect.construct(Fake, []);
254
+ } catch (x) {
255
+ var control = x;
256
+ }
257
+ Reflect.construct(fn, [], Fake);
258
+ } else {
259
+ try {
260
+ Fake.call();
261
+ } catch (x$0) {
262
+ control = x$0;
263
+ }
264
+ fn.call(Fake.prototype);
265
+ }
266
+ } else {
267
+ try {
268
+ throw Error();
269
+ } catch (x$1) {
270
+ control = x$1;
271
+ }
272
+ (Fake = fn()) &&
273
+ "function" === typeof Fake.catch &&
274
+ Fake.catch(function () {});
275
+ }
276
+ } catch (sample) {
277
+ if (sample && control && "string" === typeof sample.stack)
278
+ return [sample.stack, control.stack];
279
+ }
280
+ return [null, null];
281
+ }
282
+ };
283
+ RunInRootFrame.DetermineComponentFrameRoot.displayName =
284
+ "DetermineComponentFrameRoot";
285
+ var namePropDescriptor = Object.getOwnPropertyDescriptor(
286
+ RunInRootFrame.DetermineComponentFrameRoot,
287
+ "name"
288
+ );
289
+ namePropDescriptor &&
290
+ namePropDescriptor.configurable &&
291
+ Object.defineProperty(
292
+ RunInRootFrame.DetermineComponentFrameRoot,
293
+ "name",
294
+ { value: "DetermineComponentFrameRoot" }
295
+ );
296
+ var _RunInRootFrame$Deter =
297
+ RunInRootFrame.DetermineComponentFrameRoot(),
298
+ sampleStack = _RunInRootFrame$Deter[0],
299
+ controlStack = _RunInRootFrame$Deter[1];
300
+ if (sampleStack && controlStack) {
301
+ var sampleLines = sampleStack.split("\n"),
302
+ controlLines = controlStack.split("\n");
303
+ for (
304
+ _RunInRootFrame$Deter = namePropDescriptor = 0;
305
+ namePropDescriptor < sampleLines.length &&
306
+ !sampleLines[namePropDescriptor].includes(
307
+ "DetermineComponentFrameRoot"
308
+ );
309
+
310
+ )
311
+ namePropDescriptor++;
312
+ for (
313
+ ;
314
+ _RunInRootFrame$Deter < controlLines.length &&
315
+ !controlLines[_RunInRootFrame$Deter].includes(
316
+ "DetermineComponentFrameRoot"
317
+ );
318
+
319
+ )
320
+ _RunInRootFrame$Deter++;
321
+ if (
322
+ namePropDescriptor === sampleLines.length ||
323
+ _RunInRootFrame$Deter === controlLines.length
324
+ )
325
+ for (
326
+ namePropDescriptor = sampleLines.length - 1,
327
+ _RunInRootFrame$Deter = controlLines.length - 1;
328
+ 1 <= namePropDescriptor &&
329
+ 0 <= _RunInRootFrame$Deter &&
330
+ sampleLines[namePropDescriptor] !==
331
+ controlLines[_RunInRootFrame$Deter];
332
+
333
+ )
334
+ _RunInRootFrame$Deter--;
335
+ for (
336
+ ;
337
+ 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
338
+ namePropDescriptor--, _RunInRootFrame$Deter--
339
+ )
340
+ if (
341
+ sampleLines[namePropDescriptor] !==
342
+ controlLines[_RunInRootFrame$Deter]
343
+ ) {
344
+ if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
345
+ do
346
+ if (
347
+ (namePropDescriptor--,
348
+ _RunInRootFrame$Deter--,
349
+ 0 > _RunInRootFrame$Deter ||
350
+ sampleLines[namePropDescriptor] !==
351
+ controlLines[_RunInRootFrame$Deter])
352
+ ) {
353
+ var _frame =
354
+ "\n" +
355
+ sampleLines[namePropDescriptor].replace(
356
+ " at new ",
357
+ " at "
358
+ );
359
+ fn.displayName &&
360
+ _frame.includes("<anonymous>") &&
361
+ (_frame = _frame.replace("<anonymous>", fn.displayName));
362
+ "function" === typeof fn &&
363
+ componentFrameCache.set(fn, _frame);
364
+ return _frame;
365
+ }
366
+ while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
367
+ }
368
+ break;
369
+ }
370
+ }
371
+ } finally {
372
+ (reentry = !1),
373
+ (ReactSharedInternals.H = previousDispatcher),
374
+ reenableLogs(),
375
+ (Error.prepareStackTrace = frame);
2188
376
  }
2189
- });
2190
- }
2191
-
2192
- return elementType;
2193
- }
2194
-
2195
- function noopCache(fn) {
2196
- // On the client (i.e. not a Server Components environment) `cache` has
2197
- // no caching behavior. We just return the function as-is.
2198
- //
2199
- // We intend to implement client caching in a future major release. In the
2200
- // meantime, it's only exposed as an API so that Shared Components can use
2201
- // per-request caching on the server without breaking on the client. But it
2202
- // does mean they need to be aware of the behavioral difference.
2203
- //
2204
- // The rest of the behavior is the same as the server implementation — it
2205
- // returns a new reference, extra properties like `displayName` are not
2206
- // preserved, the length of the new function is 0, etc. That way apps can't
2207
- // accidentally depend on those details.
2208
- return function () {
2209
- // $FlowFixMe[incompatible-call]: We don't want to use rest arguments since we transpile the code.
2210
- return fn.apply(null, arguments);
2211
- };
2212
- }
2213
- var cache = noopCache ;
2214
-
2215
- function resolveDispatcher() {
2216
- var dispatcher = ReactSharedInternals.H;
2217
-
2218
- {
2219
- if (dispatcher === null) {
2220
- 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.');
2221
- }
2222
- } // Will result in a null access error if accessed outside render phase. We
2223
- // intentionally don't throw our own error because this is in a hot path.
2224
- // Also helps ensure this is inlined.
2225
-
2226
-
2227
- return dispatcher;
2228
- }
2229
- function useContext(Context) {
2230
- var dispatcher = resolveDispatcher();
2231
-
2232
- {
2233
- if (Context.$$typeof === REACT_CONSUMER_TYPE) {
2234
- error('Calling useContext(Context.Consumer) is not supported and will cause bugs. ' + 'Did you mean to call useContext(Context) instead?');
377
+ sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
378
+ ? describeBuiltInComponentFrame(sampleLines)
379
+ : "";
380
+ "function" === typeof fn && componentFrameCache.set(fn, sampleLines);
381
+ return sampleLines;
382
+ }
383
+ function describeUnknownElementTypeFrameInDEV(type) {
384
+ if (null == type) return "";
385
+ if ("function" === typeof type) {
386
+ var prototype = type.prototype;
387
+ return describeNativeComponentFrame(
388
+ type,
389
+ !(!prototype || !prototype.isReactComponent)
390
+ );
391
+ }
392
+ if ("string" === typeof type) return describeBuiltInComponentFrame(type);
393
+ switch (type) {
394
+ case REACT_SUSPENSE_TYPE:
395
+ return describeBuiltInComponentFrame("Suspense");
396
+ case REACT_SUSPENSE_LIST_TYPE:
397
+ return describeBuiltInComponentFrame("SuspenseList");
398
+ }
399
+ if ("object" === typeof type)
400
+ switch (type.$$typeof) {
401
+ case REACT_FORWARD_REF_TYPE:
402
+ return (type = describeNativeComponentFrame(type.render, !1)), type;
403
+ case REACT_MEMO_TYPE:
404
+ return describeUnknownElementTypeFrameInDEV(type.type);
405
+ case REACT_LAZY_TYPE:
406
+ prototype = type._payload;
407
+ type = type._init;
408
+ try {
409
+ return describeUnknownElementTypeFrameInDEV(type(prototype));
410
+ } catch (x) {}
411
+ }
412
+ return "";
2235
413
  }
2236
- }
2237
-
2238
- return dispatcher.useContext(Context);
2239
- }
2240
- function useState(initialState) {
2241
- var dispatcher = resolveDispatcher();
2242
- return dispatcher.useState(initialState);
2243
- }
2244
- function useReducer(reducer, initialArg, init) {
2245
- var dispatcher = resolveDispatcher();
2246
- return dispatcher.useReducer(reducer, initialArg, init);
2247
- }
2248
- function useRef(initialValue) {
2249
- var dispatcher = resolveDispatcher();
2250
- return dispatcher.useRef(initialValue);
2251
- }
2252
- function useEffect(create, deps) {
2253
- var dispatcher = resolveDispatcher();
2254
- return dispatcher.useEffect(create, deps);
2255
- }
2256
- function useInsertionEffect(create, deps) {
2257
- var dispatcher = resolveDispatcher();
2258
- return dispatcher.useInsertionEffect(create, deps);
2259
- }
2260
- function useLayoutEffect(create, deps) {
2261
- var dispatcher = resolveDispatcher();
2262
- return dispatcher.useLayoutEffect(create, deps);
2263
- }
2264
- function useCallback(callback, deps) {
2265
- var dispatcher = resolveDispatcher();
2266
- return dispatcher.useCallback(callback, deps);
2267
- }
2268
- function useMemo(create, deps) {
2269
- var dispatcher = resolveDispatcher();
2270
- return dispatcher.useMemo(create, deps);
2271
- }
2272
- function useImperativeHandle(ref, create, deps) {
2273
- var dispatcher = resolveDispatcher();
2274
- return dispatcher.useImperativeHandle(ref, create, deps);
2275
- }
2276
- function useDebugValue(value, formatterFn) {
2277
- {
2278
- var dispatcher = resolveDispatcher();
2279
- return dispatcher.useDebugValue(value, formatterFn);
2280
- }
2281
- }
2282
- function useTransition() {
2283
- var dispatcher = resolveDispatcher();
2284
- return dispatcher.useTransition();
2285
- }
2286
- function useDeferredValue(value, initialValue) {
2287
- var dispatcher = resolveDispatcher();
2288
- return dispatcher.useDeferredValue(value, initialValue);
2289
- }
2290
- function useId() {
2291
- var dispatcher = resolveDispatcher();
2292
- return dispatcher.useId();
2293
- }
2294
- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
2295
- var dispatcher = resolveDispatcher();
2296
- return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
2297
- }
2298
- function useCacheRefresh() {
2299
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2300
-
2301
- return dispatcher.useCacheRefresh();
2302
- }
2303
- function use(usable) {
2304
- var dispatcher = resolveDispatcher();
2305
- return dispatcher.use(usable);
2306
- }
2307
- function useOptimistic(passthrough, reducer) {
2308
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2309
-
2310
- return dispatcher.useOptimistic(passthrough, reducer);
2311
- }
2312
- function useActionState(action, initialState, permalink) {
2313
- {
2314
- var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
2315
-
2316
- return dispatcher.useActionState(action, initialState, permalink);
2317
- }
2318
- }
2319
-
2320
- var reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
2321
- // emulating an uncaught JavaScript error.
2322
- reportError : function (error) {
2323
- if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
2324
- // Browser Polyfill
2325
- var message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
2326
- String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
2327
- String(error);
2328
- var event = new window.ErrorEvent('error', {
2329
- bubbles: true,
2330
- cancelable: true,
2331
- message: message,
2332
- error: error
2333
- });
2334
- var shouldLog = window.dispatchEvent(event);
2335
-
2336
- if (!shouldLog) {
2337
- return;
414
+ function getOwner() {
415
+ var dispatcher = ReactSharedInternals.A;
416
+ return null === dispatcher ? null : dispatcher.getOwner();
2338
417
  }
2339
- } else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
2340
- typeof process.emit === 'function') {
2341
- // Node Polyfill
2342
- process.emit('uncaughtException', error);
2343
- return;
2344
- } // eslint-disable-next-line react-internal/no-production-logging
2345
-
2346
-
2347
- console['error'](error);
2348
- };
2349
-
2350
- function startTransition(scope, options) {
2351
- var prevTransition = ReactSharedInternals.T;
2352
- var transition = {};
2353
- ReactSharedInternals.T = transition;
2354
- var currentTransition = ReactSharedInternals.T;
2355
-
2356
- {
2357
- ReactSharedInternals.T._updatedFibers = new Set();
2358
- }
2359
-
2360
- {
2361
- try {
2362
- var returnValue = scope();
2363
- var onStartTransitionFinish = ReactSharedInternals.S;
2364
-
2365
- if (onStartTransitionFinish !== null) {
2366
- onStartTransitionFinish(transition, returnValue);
418
+ function hasValidKey(config) {
419
+ if (hasOwnProperty.call(config, "key")) {
420
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
421
+ if (getter && getter.isReactWarning) return !1;
2367
422
  }
2368
-
2369
- if (typeof returnValue === 'object' && returnValue !== null && typeof returnValue.then === 'function') {
2370
- returnValue.then(noop, reportGlobalError);
423
+ return void 0 !== config.key;
424
+ }
425
+ function defineKeyPropWarningGetter(props, displayName) {
426
+ function warnAboutAccessingKey() {
427
+ specialPropKeyWarningShown ||
428
+ ((specialPropKeyWarningShown = !0),
429
+ console.error(
430
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
431
+ displayName
432
+ ));
2371
433
  }
2372
- } catch (error) {
2373
- reportGlobalError(error);
2374
- } finally {
2375
- warnAboutTransitionSubscriptions(prevTransition, currentTransition);
2376
- ReactSharedInternals.T = prevTransition;
434
+ warnAboutAccessingKey.isReactWarning = !0;
435
+ Object.defineProperty(props, "key", {
436
+ get: warnAboutAccessingKey,
437
+ configurable: !0
438
+ });
2377
439
  }
2378
- }
2379
- }
2380
-
2381
- function warnAboutTransitionSubscriptions(prevTransition, currentTransition) {
2382
- {
2383
- if (prevTransition === null && currentTransition._updatedFibers) {
2384
- var updatedFibersCount = currentTransition._updatedFibers.size;
2385
-
2386
- currentTransition._updatedFibers.clear();
2387
-
2388
- if (updatedFibersCount > 10) {
2389
- warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
440
+ function elementRefGetterWithDeprecationWarning() {
441
+ var componentName = getComponentNameFromType(this.type);
442
+ didWarnAboutElementRef[componentName] ||
443
+ ((didWarnAboutElementRef[componentName] = !0),
444
+ console.error(
445
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
446
+ ));
447
+ componentName = this.props.ref;
448
+ return void 0 !== componentName ? componentName : null;
449
+ }
450
+ function ReactElement(type, key, self, source, owner, props) {
451
+ self = props.ref;
452
+ type = {
453
+ $$typeof: REACT_ELEMENT_TYPE,
454
+ type: type,
455
+ key: key,
456
+ props: props,
457
+ _owner: owner
458
+ };
459
+ null !== (void 0 !== self ? self : null)
460
+ ? Object.defineProperty(type, "ref", {
461
+ enumerable: !1,
462
+ get: elementRefGetterWithDeprecationWarning
463
+ })
464
+ : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
465
+ type._store = {};
466
+ Object.defineProperty(type._store, "validated", {
467
+ configurable: !1,
468
+ enumerable: !1,
469
+ writable: !0,
470
+ value: 0
471
+ });
472
+ Object.defineProperty(type, "_debugInfo", {
473
+ configurable: !1,
474
+ enumerable: !1,
475
+ writable: !0,
476
+ value: null
477
+ });
478
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
479
+ return type;
480
+ }
481
+ function cloneAndReplaceKey(oldElement, newKey) {
482
+ newKey = ReactElement(
483
+ oldElement.type,
484
+ newKey,
485
+ void 0,
486
+ void 0,
487
+ oldElement._owner,
488
+ oldElement.props
489
+ );
490
+ newKey._store.validated = oldElement._store.validated;
491
+ return newKey;
492
+ }
493
+ function validateChildKeys(node, parentType) {
494
+ if (
495
+ "object" === typeof node &&
496
+ node &&
497
+ node.$$typeof !== REACT_CLIENT_REFERENCE
498
+ )
499
+ if (isArrayImpl(node))
500
+ for (var i = 0; i < node.length; i++) {
501
+ var child = node[i];
502
+ isValidElement(child) && validateExplicitKey(child, parentType);
503
+ }
504
+ else if (isValidElement(node))
505
+ node._store && (node._store.validated = 1);
506
+ else if (
507
+ ((i = getIteratorFn(node)),
508
+ "function" === typeof i &&
509
+ i !== node.entries &&
510
+ ((i = i.call(node)), i !== node))
511
+ )
512
+ for (; !(node = i.next()).done; )
513
+ isValidElement(node.value) &&
514
+ validateExplicitKey(node.value, parentType);
515
+ }
516
+ function isValidElement(object) {
517
+ return (
518
+ "object" === typeof object &&
519
+ null !== object &&
520
+ object.$$typeof === REACT_ELEMENT_TYPE
521
+ );
522
+ }
523
+ function validateExplicitKey(element, parentType) {
524
+ if (
525
+ element._store &&
526
+ !element._store.validated &&
527
+ null == element.key &&
528
+ ((element._store.validated = 1),
529
+ (parentType = getCurrentComponentErrorInfo(parentType)),
530
+ !ownerHasKeyUseWarning[parentType])
531
+ ) {
532
+ ownerHasKeyUseWarning[parentType] = !0;
533
+ var childOwner = "";
534
+ element &&
535
+ null != element._owner &&
536
+ element._owner !== getOwner() &&
537
+ ((childOwner = null),
538
+ "number" === typeof element._owner.tag
539
+ ? (childOwner = getComponentNameFromType(element._owner.type))
540
+ : "string" === typeof element._owner.name &&
541
+ (childOwner = element._owner.name),
542
+ (childOwner = " It was passed a child from " + childOwner + "."));
543
+ var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
544
+ ReactSharedInternals.getCurrentStack = function () {
545
+ var stack = describeUnknownElementTypeFrameInDEV(element.type);
546
+ prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
547
+ return stack;
548
+ };
549
+ console.error(
550
+ 'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
551
+ parentType,
552
+ childOwner
553
+ );
554
+ ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
2390
555
  }
2391
556
  }
2392
- }
2393
- }
2394
-
2395
- function noop() {}
2396
-
2397
- var didWarnAboutMessageChannel = false;
2398
- var enqueueTaskImpl = null;
2399
- function enqueueTask(task) {
2400
- if (enqueueTaskImpl === null) {
2401
- try {
2402
- // read require off the module object to get around the bundlers.
2403
- // we don't want them to detect a require and bundle a Node polyfill.
2404
- var requireString = ('require' + Math.random()).slice(0, 7);
2405
- var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
2406
- // version of setImmediate, bypassing fake timers if any.
2407
-
2408
- enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
2409
- } catch (_err) {
2410
- // we're in a browser
2411
- // we can't use regular timers because they may still be faked
2412
- // so we try MessageChannel+postMessage instead
2413
- enqueueTaskImpl = function (callback) {
2414
- {
2415
- if (didWarnAboutMessageChannel === false) {
2416
- didWarnAboutMessageChannel = true;
2417
-
2418
- if (typeof MessageChannel === 'undefined') {
2419
- error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
2420
- }
557
+ function getCurrentComponentErrorInfo(parentType) {
558
+ var info = "",
559
+ owner = getOwner();
560
+ owner &&
561
+ (owner = getComponentNameFromType(owner.type)) &&
562
+ (info = "\n\nCheck the render method of `" + owner + "`.");
563
+ info ||
564
+ ((parentType = getComponentNameFromType(parentType)) &&
565
+ (info =
566
+ "\n\nCheck the top-level render call using <" + parentType + ">."));
567
+ return info;
568
+ }
569
+ function escape(key) {
570
+ var escaperLookup = { "=": "=0", ":": "=2" };
571
+ return (
572
+ "$" +
573
+ key.replace(/[=:]/g, function (match) {
574
+ return escaperLookup[match];
575
+ })
576
+ );
577
+ }
578
+ function getElementKey(element, index) {
579
+ return "object" === typeof element &&
580
+ null !== element &&
581
+ null != element.key
582
+ ? (checkKeyStringCoercion(element.key), escape("" + element.key))
583
+ : index.toString(36);
584
+ }
585
+ function noop$1() {}
586
+ function resolveThenable(thenable) {
587
+ switch (thenable.status) {
588
+ case "fulfilled":
589
+ return thenable.value;
590
+ case "rejected":
591
+ throw thenable.reason;
592
+ default:
593
+ switch (
594
+ ("string" === typeof thenable.status
595
+ ? thenable.then(noop$1, noop$1)
596
+ : ((thenable.status = "pending"),
597
+ thenable.then(
598
+ function (fulfilledValue) {
599
+ "pending" === thenable.status &&
600
+ ((thenable.status = "fulfilled"),
601
+ (thenable.value = fulfilledValue));
602
+ },
603
+ function (error) {
604
+ "pending" === thenable.status &&
605
+ ((thenable.status = "rejected"),
606
+ (thenable.reason = error));
607
+ }
608
+ )),
609
+ thenable.status)
610
+ ) {
611
+ case "fulfilled":
612
+ return thenable.value;
613
+ case "rejected":
614
+ throw thenable.reason;
2421
615
  }
2422
- }
2423
-
2424
- var channel = new MessageChannel();
2425
- channel.port1.onmessage = callback;
2426
- channel.port2.postMessage(undefined);
2427
- };
2428
- }
2429
- }
2430
-
2431
- return enqueueTaskImpl(task);
2432
- }
2433
-
2434
- // number of `act` scopes on the stack.
2435
-
2436
- var actScopeDepth = 0; // We only warn the first time you neglect to await an async `act` scope.
2437
-
2438
- var didWarnNoAwaitAct = false;
2439
-
2440
- function aggregateErrors(errors) {
2441
- if (errors.length > 1 && typeof AggregateError === 'function') {
2442
- // eslint-disable-next-line no-undef
2443
- return new AggregateError(errors);
2444
- }
2445
-
2446
- return errors[0];
2447
- }
2448
-
2449
- function act(callback) {
2450
- {
2451
- // When ReactSharedInternals.actQueue is not null, it signals to React that
2452
- // we're currently inside an `act` scope. React will push all its tasks to
2453
- // this queue instead of scheduling them with platform APIs.
2454
- //
2455
- // We set this to an empty array when we first enter an `act` scope, and
2456
- // only unset it once we've left the outermost `act` scope — remember that
2457
- // `act` calls can be nested.
2458
- //
2459
- // If we're already inside an `act` scope, reuse the existing queue.
2460
- var prevIsBatchingLegacy = false;
2461
- var prevActQueue = ReactSharedInternals.actQueue;
2462
- var prevActScopeDepth = actScopeDepth;
2463
- actScopeDepth++;
2464
- var queue = ReactSharedInternals.actQueue = prevActQueue !== null ? prevActQueue : []; // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
2465
-
2466
- var result; // This tracks whether the `act` call is awaited. In certain cases, not
2467
- // awaiting it is a mistake, so we will detect that and warn.
2468
-
2469
- var didAwaitActCall = false;
2470
-
2471
- try {
2472
- // Reset this to `false` right before entering the React work loop. The
2473
- // only place we ever read this fields is just below, right after running
2474
- // the callback. So we don't need to reset after the callback runs.
2475
- if (!disableLegacyMode) ;
2476
-
2477
- result = callback();
2478
- var didScheduleLegacyUpdate = !disableLegacyMode ? ReactSharedInternals.didScheduleLegacyUpdate : false; // Replicate behavior of original `act` implementation in legacy mode,
2479
- // which flushed updates immediately after the scope function exits, even
2480
- // if it's an async function.
2481
-
2482
- if (!prevIsBatchingLegacy && didScheduleLegacyUpdate) {
2483
- flushActQueue(queue);
2484
- } // `isBatchingLegacy` gets reset using the regular stack, not the async
2485
- // one used to track `act` scopes. Why, you may be wondering? Because
2486
- // that's how it worked before version 18. Yes, it's confusing! We should
2487
- // delete legacy mode!!
2488
-
2489
-
2490
- if (!disableLegacyMode) ;
2491
- } catch (error) {
2492
- // `isBatchingLegacy` gets reset using the regular stack, not the async
2493
- // one used to track `act` scopes. Why, you may be wondering? Because
2494
- // that's how it worked before version 18. Yes, it's confusing! We should
2495
- // delete legacy mode!!
2496
- ReactSharedInternals.thrownErrors.push(error);
2497
- }
2498
-
2499
- if (ReactSharedInternals.thrownErrors.length > 0) {
2500
-
2501
- popActScope(prevActQueue, prevActScopeDepth);
2502
- var thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2503
- ReactSharedInternals.thrownErrors.length = 0;
2504
- throw thrownError;
2505
- }
2506
-
2507
- if (result !== null && typeof result === 'object' && // $FlowFixMe[method-unbinding]
2508
- typeof result.then === 'function') {
2509
- // A promise/thenable was returned from the callback. Wait for it to
2510
- // resolve before flushing the queue.
2511
- //
2512
- // If `act` were implemented as an async function, this whole block could
2513
- // be a single `await` call. That's really the only difference between
2514
- // this branch and the next one.
2515
- var thenable = result; // Warn if the an `act` call with an async scope is not awaited. In a
2516
- // future release, consider making this an error.
2517
-
2518
- queueSeveralMicrotasks(function () {
2519
- if (!didAwaitActCall && !didWarnNoAwaitAct) {
2520
- didWarnNoAwaitAct = true;
2521
-
2522
- error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
2523
- }
2524
- });
2525
- return {
2526
- then: function (resolve, reject) {
2527
- didAwaitActCall = true;
2528
- thenable.then(function (returnValue) {
2529
- popActScope(prevActQueue, prevActScopeDepth);
2530
-
2531
- if (prevActScopeDepth === 0) {
2532
- // We're exiting the outermost `act` scope. Flush the queue.
2533
- try {
2534
- flushActQueue(queue);
2535
- enqueueTask(function () {
2536
- return (// Recursively flush tasks scheduled by a microtask.
2537
- recursivelyFlushAsyncActWork(returnValue, resolve, reject)
2538
- );
2539
- });
2540
- } catch (error) {
2541
- // `thenable` might not be a real promise, and `flushActQueue`
2542
- // might throw, so we need to wrap `flushActQueue` in a
2543
- // try/catch.
2544
- ReactSharedInternals.thrownErrors.push(error);
2545
- }
2546
-
2547
- if (ReactSharedInternals.thrownErrors.length > 0) {
2548
- var _thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2549
-
2550
- ReactSharedInternals.thrownErrors.length = 0;
2551
- reject(_thrownError);
2552
- }
2553
- } else {
2554
- resolve(returnValue);
2555
- }
2556
- }, function (error) {
2557
- popActScope(prevActQueue, prevActScopeDepth);
2558
-
2559
- if (ReactSharedInternals.thrownErrors.length > 0) {
2560
- var _thrownError2 = aggregateErrors(ReactSharedInternals.thrownErrors);
2561
-
2562
- ReactSharedInternals.thrownErrors.length = 0;
2563
- reject(_thrownError2);
2564
- } else {
2565
- reject(error);
616
+ }
617
+ throw thenable;
618
+ }
619
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
620
+ var type = typeof children;
621
+ if ("undefined" === type || "boolean" === type) children = null;
622
+ var invokeCallback = !1;
623
+ if (null === children) invokeCallback = !0;
624
+ else
625
+ switch (type) {
626
+ case "bigint":
627
+ case "string":
628
+ case "number":
629
+ invokeCallback = !0;
630
+ break;
631
+ case "object":
632
+ switch (children.$$typeof) {
633
+ case REACT_ELEMENT_TYPE:
634
+ case REACT_PORTAL_TYPE:
635
+ invokeCallback = !0;
636
+ break;
637
+ case REACT_LAZY_TYPE:
638
+ return (
639
+ (invokeCallback = children._init),
640
+ mapIntoArray(
641
+ invokeCallback(children._payload),
642
+ array,
643
+ escapedPrefix,
644
+ nameSoFar,
645
+ callback
646
+ )
647
+ );
2566
648
  }
2567
- });
2568
649
  }
2569
- };
2570
- } else {
2571
- var returnValue = result; // The callback is not an async function. Exit the current
2572
- // scope immediately.
2573
-
2574
- popActScope(prevActQueue, prevActScopeDepth);
2575
-
2576
- if (prevActScopeDepth === 0) {
2577
- // We're exiting the outermost `act` scope. Flush the queue.
2578
- flushActQueue(queue); // If the queue is not empty, it implies that we intentionally yielded
2579
- // to the main thread, because something suspended. We will continue
2580
- // in an asynchronous task.
2581
- //
2582
- // Warn if something suspends but the `act` call is not awaited.
2583
- // In a future release, consider making this an error.
2584
-
2585
- if (queue.length !== 0) {
2586
- queueSeveralMicrotasks(function () {
2587
- if (!didAwaitActCall && !didWarnNoAwaitAct) {
2588
- didWarnNoAwaitAct = true;
2589
-
2590
- error('A component suspended inside an `act` scope, but the ' + '`act` call was not awaited. When testing React ' + 'components that depend on asynchronous data, you must ' + 'await the result:\n\n' + 'await act(() => ...)');
2591
- }
2592
- });
2593
- } // Like many things in this module, this is next part is confusing.
2594
- //
2595
- // We do not currently require every `act` call that is passed a
2596
- // callback to be awaited, through arguably we should. Since this
2597
- // callback was synchronous, we need to exit the current scope before
2598
- // returning.
2599
- //
2600
- // However, if thenable we're about to return *is* awaited, we'll
2601
- // immediately restore the current scope. So it shouldn't observable.
2602
- //
2603
- // This doesn't affect the case where the scope callback is async,
2604
- // because we always require those calls to be awaited.
2605
- //
2606
- // TODO: In a future version, consider always requiring all `act` calls
2607
- // to be awaited, regardless of whether the callback is sync or async.
2608
-
2609
-
2610
- ReactSharedInternals.actQueue = null;
650
+ if (invokeCallback) {
651
+ invokeCallback = children;
652
+ callback = callback(invokeCallback);
653
+ var childKey =
654
+ "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
655
+ isArrayImpl(callback)
656
+ ? ((escapedPrefix = ""),
657
+ null != childKey &&
658
+ (escapedPrefix =
659
+ childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
660
+ mapIntoArray(callback, array, escapedPrefix, "", function (c) {
661
+ return c;
662
+ }))
663
+ : null != callback &&
664
+ (isValidElement(callback) &&
665
+ (null != callback.key &&
666
+ ((invokeCallback && invokeCallback.key === callback.key) ||
667
+ checkKeyStringCoercion(callback.key)),
668
+ (escapedPrefix = cloneAndReplaceKey(
669
+ callback,
670
+ escapedPrefix +
671
+ (null == callback.key ||
672
+ (invokeCallback && invokeCallback.key === callback.key)
673
+ ? ""
674
+ : ("" + callback.key).replace(
675
+ userProvidedKeyEscapeRegex,
676
+ "$&/"
677
+ ) + "/") +
678
+ childKey
679
+ )),
680
+ "" !== nameSoFar &&
681
+ null != invokeCallback &&
682
+ isValidElement(invokeCallback) &&
683
+ null == invokeCallback.key &&
684
+ invokeCallback._store &&
685
+ !invokeCallback._store.validated &&
686
+ (escapedPrefix._store.validated = 2),
687
+ (callback = escapedPrefix)),
688
+ array.push(callback));
689
+ return 1;
2611
690
  }
2612
-
2613
- if (ReactSharedInternals.thrownErrors.length > 0) {
2614
- var _thrownError3 = aggregateErrors(ReactSharedInternals.thrownErrors);
2615
-
2616
- ReactSharedInternals.thrownErrors.length = 0;
2617
- throw _thrownError3;
691
+ invokeCallback = 0;
692
+ childKey = "" === nameSoFar ? "." : nameSoFar + ":";
693
+ if (isArrayImpl(children))
694
+ for (var i = 0; i < children.length; i++)
695
+ (nameSoFar = children[i]),
696
+ (type = childKey + getElementKey(nameSoFar, i)),
697
+ (invokeCallback += mapIntoArray(
698
+ nameSoFar,
699
+ array,
700
+ escapedPrefix,
701
+ type,
702
+ callback
703
+ ));
704
+ else if (((i = getIteratorFn(children)), "function" === typeof i))
705
+ for (
706
+ i === children.entries &&
707
+ (didWarnAboutMaps ||
708
+ console.warn(
709
+ "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
710
+ ),
711
+ (didWarnAboutMaps = !0)),
712
+ children = i.call(children),
713
+ i = 0;
714
+ !(nameSoFar = children.next()).done;
715
+
716
+ )
717
+ (nameSoFar = nameSoFar.value),
718
+ (type = childKey + getElementKey(nameSoFar, i++)),
719
+ (invokeCallback += mapIntoArray(
720
+ nameSoFar,
721
+ array,
722
+ escapedPrefix,
723
+ type,
724
+ callback
725
+ ));
726
+ else if ("object" === type) {
727
+ if ("function" === typeof children.then)
728
+ return mapIntoArray(
729
+ resolveThenable(children),
730
+ array,
731
+ escapedPrefix,
732
+ nameSoFar,
733
+ callback
734
+ );
735
+ array = String(children);
736
+ throw Error(
737
+ "Objects are not valid as a React child (found: " +
738
+ ("[object Object]" === array
739
+ ? "object with keys {" + Object.keys(children).join(", ") + "}"
740
+ : array) +
741
+ "). If you meant to render a collection of children, use an array instead."
742
+ );
2618
743
  }
2619
-
2620
- return {
2621
- then: function (resolve, reject) {
2622
- didAwaitActCall = true;
2623
-
2624
- if (prevActScopeDepth === 0) {
2625
- // If the `act` call is awaited, restore the queue we were
2626
- // using before (see long comment above) so we can flush it.
2627
- ReactSharedInternals.actQueue = queue;
744
+ return invokeCallback;
745
+ }
746
+ function mapChildren(children, func, context) {
747
+ if (null == children) return children;
748
+ var result = [],
749
+ count = 0;
750
+ mapIntoArray(children, result, "", "", function (child) {
751
+ return func.call(context, child, count++);
752
+ });
753
+ return result;
754
+ }
755
+ function lazyInitializer(payload) {
756
+ if (-1 === payload._status) {
757
+ var ctor = payload._result;
758
+ ctor = ctor();
759
+ ctor.then(
760
+ function (moduleObject) {
761
+ if (0 === payload._status || -1 === payload._status)
762
+ (payload._status = 1), (payload._result = moduleObject);
763
+ },
764
+ function (error) {
765
+ if (0 === payload._status || -1 === payload._status)
766
+ (payload._status = 2), (payload._result = error);
767
+ }
768
+ );
769
+ -1 === payload._status &&
770
+ ((payload._status = 0), (payload._result = ctor));
771
+ }
772
+ if (1 === payload._status)
773
+ return (
774
+ (ctor = payload._result),
775
+ void 0 === ctor &&
776
+ console.error(
777
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
778
+ ctor
779
+ ),
780
+ "default" in ctor ||
781
+ console.error(
782
+ "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
783
+ ctor
784
+ ),
785
+ ctor.default
786
+ );
787
+ throw payload._result;
788
+ }
789
+ function resolveDispatcher() {
790
+ var dispatcher = ReactSharedInternals.H;
791
+ null === dispatcher &&
792
+ console.error(
793
+ "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:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
794
+ );
795
+ return dispatcher;
796
+ }
797
+ function noop() {}
798
+ function enqueueTask(task) {
799
+ if (null === enqueueTaskImpl)
800
+ try {
801
+ var requireString = ("require" + Math.random()).slice(0, 7);
802
+ enqueueTaskImpl = (module && module[requireString]).call(
803
+ module,
804
+ "timers"
805
+ ).setImmediate;
806
+ } catch (_err) {
807
+ enqueueTaskImpl = function (callback) {
808
+ !1 === didWarnAboutMessageChannel &&
809
+ ((didWarnAboutMessageChannel = !0),
810
+ "undefined" === typeof MessageChannel &&
811
+ console.error(
812
+ "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
813
+ ));
814
+ var channel = new MessageChannel();
815
+ channel.port1.onmessage = callback;
816
+ channel.port2.postMessage(void 0);
817
+ };
818
+ }
819
+ return enqueueTaskImpl(task);
820
+ }
821
+ function aggregateErrors(errors) {
822
+ return 1 < errors.length && "function" === typeof AggregateError
823
+ ? new AggregateError(errors)
824
+ : errors[0];
825
+ }
826
+ function popActScope(prevActQueue, prevActScopeDepth) {
827
+ prevActScopeDepth !== actScopeDepth - 1 &&
828
+ console.error(
829
+ "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
830
+ );
831
+ actScopeDepth = prevActScopeDepth;
832
+ }
833
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
834
+ var queue = ReactSharedInternals.actQueue;
835
+ if (null !== queue)
836
+ if (0 !== queue.length)
837
+ try {
838
+ flushActQueue(queue);
2628
839
  enqueueTask(function () {
2629
- return (// Recursively flush tasks scheduled by a microtask.
2630
- recursivelyFlushAsyncActWork(returnValue, resolve, reject)
2631
- );
840
+ return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2632
841
  });
2633
- } else {
2634
- resolve(returnValue);
842
+ return;
843
+ } catch (error) {
844
+ ReactSharedInternals.thrownErrors.push(error);
2635
845
  }
2636
- }
2637
- };
2638
- }
2639
- }
2640
- }
2641
-
2642
- function popActScope(prevActQueue, prevActScopeDepth) {
2643
- {
2644
- if (prevActScopeDepth !== actScopeDepth - 1) {
2645
- error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
2646
- }
2647
-
2648
- actScopeDepth = prevActScopeDepth;
2649
- }
2650
- }
2651
-
2652
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
2653
- {
2654
- // Check if any tasks were scheduled asynchronously.
2655
- var queue = ReactSharedInternals.actQueue;
2656
-
2657
- if (queue !== null) {
2658
- if (queue.length !== 0) {
2659
- // Async tasks were scheduled, mostly likely in a microtask.
2660
- // Keep flushing until there are no more.
846
+ else ReactSharedInternals.actQueue = null;
847
+ 0 < ReactSharedInternals.thrownErrors.length
848
+ ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),
849
+ (ReactSharedInternals.thrownErrors.length = 0),
850
+ reject(queue))
851
+ : resolve(returnValue);
852
+ }
853
+ function flushActQueue(queue) {
854
+ if (!isFlushing) {
855
+ isFlushing = !0;
856
+ var i = 0;
2661
857
  try {
2662
- flushActQueue(queue); // The work we just performed may have schedule additional async
2663
- // tasks. Wait a macrotask and check again.
2664
-
2665
- enqueueTask(function () {
2666
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2667
- });
2668
- return;
858
+ for (; i < queue.length; i++) {
859
+ var callback = queue[i];
860
+ do {
861
+ ReactSharedInternals.didUsePromise = !1;
862
+ var continuation = callback(!1);
863
+ if (null !== continuation) {
864
+ if (ReactSharedInternals.didUsePromise) {
865
+ queue[i] = callback;
866
+ queue.splice(0, i);
867
+ return;
868
+ }
869
+ callback = continuation;
870
+ } else break;
871
+ } while (1);
872
+ }
873
+ queue.length = 0;
2669
874
  } catch (error) {
2670
- // Leave remaining tasks on the queue if something throws.
2671
- ReactSharedInternals.thrownErrors.push(error);
875
+ queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
876
+ } finally {
877
+ isFlushing = !1;
2672
878
  }
2673
- } else {
2674
- // The queue is empty. We can finish.
2675
- ReactSharedInternals.actQueue = null;
2676
879
  }
2677
880
  }
2678
-
2679
- if (ReactSharedInternals.thrownErrors.length > 0) {
2680
- var thrownError = aggregateErrors(ReactSharedInternals.thrownErrors);
2681
- ReactSharedInternals.thrownErrors.length = 0;
2682
- reject(thrownError);
2683
- } else {
2684
- resolve(returnValue);
2685
- }
2686
- }
2687
- }
2688
-
2689
- var isFlushing = false;
2690
-
2691
- function flushActQueue(queue) {
2692
- {
2693
- if (!isFlushing) {
2694
- // Prevent re-entrance.
2695
- isFlushing = true;
2696
- var i = 0;
2697
-
2698
- try {
2699
- for (; i < queue.length; i++) {
2700
- var callback = queue[i];
2701
-
2702
- do {
2703
- ReactSharedInternals.didUsePromise = false;
2704
- var continuation = callback(false);
2705
-
2706
- if (continuation !== null) {
2707
- if (ReactSharedInternals.didUsePromise) {
2708
- // The component just suspended. Yield to the main thread in
2709
- // case the promise is already resolved. If so, it will ping in
2710
- // a microtask and we can resume without unwinding the stack.
2711
- queue[i] = callback;
2712
- queue.splice(0, i);
881
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
882
+ "function" ===
883
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
884
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
885
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
886
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
887
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
888
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
889
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler");
890
+ Symbol.for("react.provider");
891
+ var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
892
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
893
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
894
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
895
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
896
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
897
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
898
+ REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
899
+ MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
900
+ didWarnStateUpdateForUnmountedComponent = {},
901
+ ReactNoopUpdateQueue = {
902
+ isMounted: function () {
903
+ return !1;
904
+ },
905
+ enqueueForceUpdate: function (publicInstance) {
906
+ warnNoop(publicInstance, "forceUpdate");
907
+ },
908
+ enqueueReplaceState: function (publicInstance) {
909
+ warnNoop(publicInstance, "replaceState");
910
+ },
911
+ enqueueSetState: function (publicInstance) {
912
+ warnNoop(publicInstance, "setState");
913
+ }
914
+ },
915
+ assign = Object.assign,
916
+ emptyObject = {};
917
+ Object.freeze(emptyObject);
918
+ Component.prototype.isReactComponent = {};
919
+ Component.prototype.setState = function (partialState, callback) {
920
+ if (
921
+ "object" !== typeof partialState &&
922
+ "function" !== typeof partialState &&
923
+ null != partialState
924
+ )
925
+ throw Error(
926
+ "takes an object of state variables to update or a function which returns an object of state variables."
927
+ );
928
+ this.updater.enqueueSetState(this, partialState, callback, "setState");
929
+ };
930
+ Component.prototype.forceUpdate = function (callback) {
931
+ this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
932
+ };
933
+ var deprecatedAPIs = {
934
+ isMounted: [
935
+ "isMounted",
936
+ "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
937
+ ],
938
+ replaceState: [
939
+ "replaceState",
940
+ "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
941
+ ]
942
+ },
943
+ fnName;
944
+ for (fnName in deprecatedAPIs)
945
+ deprecatedAPIs.hasOwnProperty(fnName) &&
946
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
947
+ ComponentDummy.prototype = Component.prototype;
948
+ deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
949
+ deprecatedAPIs.constructor = PureComponent;
950
+ assign(deprecatedAPIs, Component.prototype);
951
+ deprecatedAPIs.isPureReactComponent = !0;
952
+ var isArrayImpl = Array.isArray,
953
+ REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
954
+ ReactSharedInternals = {
955
+ H: null,
956
+ A: null,
957
+ T: null,
958
+ S: null,
959
+ actQueue: null,
960
+ isBatchingLegacy: !1,
961
+ didScheduleLegacyUpdate: !1,
962
+ didUsePromise: !1,
963
+ thrownErrors: [],
964
+ getCurrentStack: null
965
+ },
966
+ hasOwnProperty = Object.prototype.hasOwnProperty,
967
+ REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
968
+ disabledDepth = 0,
969
+ prevLog,
970
+ prevInfo,
971
+ prevWarn,
972
+ prevError,
973
+ prevGroup,
974
+ prevGroupCollapsed,
975
+ prevGroupEnd;
976
+ disabledLog.__reactDisabledLog = !0;
977
+ var prefix,
978
+ suffix,
979
+ reentry = !1;
980
+ var componentFrameCache = new (
981
+ "function" === typeof WeakMap ? WeakMap : Map
982
+ )();
983
+ var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
984
+ specialPropKeyWarningShown,
985
+ didWarnAboutOldJSXRuntime;
986
+ var didWarnAboutElementRef = {};
987
+ var ownerHasKeyUseWarning = {},
988
+ didWarnAboutMaps = !1,
989
+ userProvidedKeyEscapeRegex = /\/+/g,
990
+ reportGlobalError =
991
+ "function" === typeof reportError
992
+ ? reportError
993
+ : function (error) {
994
+ if (
995
+ "object" === typeof window &&
996
+ "function" === typeof window.ErrorEvent
997
+ ) {
998
+ var event = new window.ErrorEvent("error", {
999
+ bubbles: !0,
1000
+ cancelable: !0,
1001
+ message:
1002
+ "object" === typeof error &&
1003
+ null !== error &&
1004
+ "string" === typeof error.message
1005
+ ? String(error.message)
1006
+ : String(error),
1007
+ error: error
1008
+ });
1009
+ if (!window.dispatchEvent(event)) return;
1010
+ } else if (
1011
+ "object" === typeof process &&
1012
+ "function" === typeof process.emit
1013
+ ) {
1014
+ process.emit("uncaughtException", error);
2713
1015
  return;
2714
1016
  }
2715
-
2716
- callback = continuation;
2717
- } else {
2718
- break;
1017
+ console.error(error);
1018
+ },
1019
+ didWarnAboutMessageChannel = !1,
1020
+ enqueueTaskImpl = null,
1021
+ actScopeDepth = 0,
1022
+ didWarnNoAwaitAct = !1,
1023
+ isFlushing = !1,
1024
+ queueSeveralMicrotasks =
1025
+ "function" === typeof queueMicrotask
1026
+ ? function (callback) {
1027
+ queueMicrotask(function () {
1028
+ return queueMicrotask(callback);
1029
+ });
2719
1030
  }
2720
- } while (true);
2721
- } // We flushed the entire queue.
2722
-
2723
-
2724
- queue.length = 0;
1031
+ : enqueueTask;
1032
+ exports.Children = {
1033
+ map: mapChildren,
1034
+ forEach: function (children, forEachFunc, forEachContext) {
1035
+ mapChildren(
1036
+ children,
1037
+ function () {
1038
+ forEachFunc.apply(this, arguments);
1039
+ },
1040
+ forEachContext
1041
+ );
1042
+ },
1043
+ count: function (children) {
1044
+ var n = 0;
1045
+ mapChildren(children, function () {
1046
+ n++;
1047
+ });
1048
+ return n;
1049
+ },
1050
+ toArray: function (children) {
1051
+ return (
1052
+ mapChildren(children, function (child) {
1053
+ return child;
1054
+ }) || []
1055
+ );
1056
+ },
1057
+ only: function (children) {
1058
+ if (!isValidElement(children))
1059
+ throw Error(
1060
+ "React.Children.only expected to receive a single React element child."
1061
+ );
1062
+ return children;
1063
+ }
1064
+ };
1065
+ exports.Component = Component;
1066
+ exports.Fragment = REACT_FRAGMENT_TYPE;
1067
+ exports.Profiler = REACT_PROFILER_TYPE;
1068
+ exports.PureComponent = PureComponent;
1069
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
1070
+ exports.Suspense = REACT_SUSPENSE_TYPE;
1071
+ exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
1072
+ ReactSharedInternals;
1073
+ exports.act = function (callback) {
1074
+ var prevActQueue = ReactSharedInternals.actQueue,
1075
+ prevActScopeDepth = actScopeDepth;
1076
+ actScopeDepth++;
1077
+ var queue = (ReactSharedInternals.actQueue =
1078
+ null !== prevActQueue ? prevActQueue : []),
1079
+ didAwaitActCall = !1;
1080
+ try {
1081
+ var result = callback();
2725
1082
  } catch (error) {
2726
- // If something throws, leave the remaining callbacks on the queue.
2727
- queue.splice(0, i + 1);
2728
1083
  ReactSharedInternals.thrownErrors.push(error);
1084
+ }
1085
+ if (0 < ReactSharedInternals.thrownErrors.length)
1086
+ throw (
1087
+ (popActScope(prevActQueue, prevActScopeDepth),
1088
+ (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1089
+ (ReactSharedInternals.thrownErrors.length = 0),
1090
+ callback)
1091
+ );
1092
+ if (
1093
+ null !== result &&
1094
+ "object" === typeof result &&
1095
+ "function" === typeof result.then
1096
+ ) {
1097
+ var thenable = result;
1098
+ queueSeveralMicrotasks(function () {
1099
+ didAwaitActCall ||
1100
+ didWarnNoAwaitAct ||
1101
+ ((didWarnNoAwaitAct = !0),
1102
+ console.error(
1103
+ "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
1104
+ ));
1105
+ });
1106
+ return {
1107
+ then: function (resolve, reject) {
1108
+ didAwaitActCall = !0;
1109
+ thenable.then(
1110
+ function (returnValue) {
1111
+ popActScope(prevActQueue, prevActScopeDepth);
1112
+ if (0 === prevActScopeDepth) {
1113
+ try {
1114
+ flushActQueue(queue),
1115
+ enqueueTask(function () {
1116
+ return recursivelyFlushAsyncActWork(
1117
+ returnValue,
1118
+ resolve,
1119
+ reject
1120
+ );
1121
+ });
1122
+ } catch (error$2) {
1123
+ ReactSharedInternals.thrownErrors.push(error$2);
1124
+ }
1125
+ if (0 < ReactSharedInternals.thrownErrors.length) {
1126
+ var _thrownError = aggregateErrors(
1127
+ ReactSharedInternals.thrownErrors
1128
+ );
1129
+ ReactSharedInternals.thrownErrors.length = 0;
1130
+ reject(_thrownError);
1131
+ }
1132
+ } else resolve(returnValue);
1133
+ },
1134
+ function (error) {
1135
+ popActScope(prevActQueue, prevActScopeDepth);
1136
+ 0 < ReactSharedInternals.thrownErrors.length
1137
+ ? ((error = aggregateErrors(
1138
+ ReactSharedInternals.thrownErrors
1139
+ )),
1140
+ (ReactSharedInternals.thrownErrors.length = 0),
1141
+ reject(error))
1142
+ : reject(error);
1143
+ }
1144
+ );
1145
+ }
1146
+ };
1147
+ }
1148
+ var returnValue$jscomp$0 = result;
1149
+ popActScope(prevActQueue, prevActScopeDepth);
1150
+ 0 === prevActScopeDepth &&
1151
+ (flushActQueue(queue),
1152
+ 0 !== queue.length &&
1153
+ queueSeveralMicrotasks(function () {
1154
+ didAwaitActCall ||
1155
+ didWarnNoAwaitAct ||
1156
+ ((didWarnNoAwaitAct = !0),
1157
+ console.error(
1158
+ "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
1159
+ ));
1160
+ }),
1161
+ (ReactSharedInternals.actQueue = null));
1162
+ if (0 < ReactSharedInternals.thrownErrors.length)
1163
+ throw (
1164
+ ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),
1165
+ (ReactSharedInternals.thrownErrors.length = 0),
1166
+ callback)
1167
+ );
1168
+ return {
1169
+ then: function (resolve, reject) {
1170
+ didAwaitActCall = !0;
1171
+ 0 === prevActScopeDepth
1172
+ ? ((ReactSharedInternals.actQueue = queue),
1173
+ enqueueTask(function () {
1174
+ return recursivelyFlushAsyncActWork(
1175
+ returnValue$jscomp$0,
1176
+ resolve,
1177
+ reject
1178
+ );
1179
+ }))
1180
+ : resolve(returnValue$jscomp$0);
1181
+ }
1182
+ };
1183
+ };
1184
+ exports.cache = function (fn) {
1185
+ return function () {
1186
+ return fn.apply(null, arguments);
1187
+ };
1188
+ };
1189
+ exports.cloneElement = function (element, config, children) {
1190
+ if (null === element || void 0 === element)
1191
+ throw Error(
1192
+ "The argument must be a React element, but you passed " +
1193
+ element +
1194
+ "."
1195
+ );
1196
+ var props = assign({}, element.props),
1197
+ key = element.key,
1198
+ owner = element._owner;
1199
+ if (null != config) {
1200
+ var JSCompiler_inline_result;
1201
+ a: {
1202
+ if (
1203
+ hasOwnProperty.call(config, "ref") &&
1204
+ (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
1205
+ config,
1206
+ "ref"
1207
+ ).get) &&
1208
+ JSCompiler_inline_result.isReactWarning
1209
+ ) {
1210
+ JSCompiler_inline_result = !1;
1211
+ break a;
1212
+ }
1213
+ JSCompiler_inline_result = void 0 !== config.ref;
1214
+ }
1215
+ JSCompiler_inline_result && (owner = getOwner());
1216
+ hasValidKey(config) &&
1217
+ (checkKeyStringCoercion(config.key), (key = "" + config.key));
1218
+ for (propName in config)
1219
+ !hasOwnProperty.call(config, propName) ||
1220
+ "key" === propName ||
1221
+ "__self" === propName ||
1222
+ "__source" === propName ||
1223
+ ("ref" === propName && void 0 === config.ref) ||
1224
+ (props[propName] = config[propName]);
1225
+ }
1226
+ var propName = arguments.length - 2;
1227
+ if (1 === propName) props.children = children;
1228
+ else if (1 < propName) {
1229
+ JSCompiler_inline_result = Array(propName);
1230
+ for (var i = 0; i < propName; i++)
1231
+ JSCompiler_inline_result[i] = arguments[i + 2];
1232
+ props.children = JSCompiler_inline_result;
1233
+ }
1234
+ props = ReactElement(element.type, key, void 0, void 0, owner, props);
1235
+ for (key = 2; key < arguments.length; key++)
1236
+ validateChildKeys(arguments[key], props.type);
1237
+ return props;
1238
+ };
1239
+ exports.createContext = function (defaultValue) {
1240
+ defaultValue = {
1241
+ $$typeof: REACT_CONTEXT_TYPE,
1242
+ _currentValue: defaultValue,
1243
+ _currentValue2: defaultValue,
1244
+ _threadCount: 0,
1245
+ Provider: null,
1246
+ Consumer: null
1247
+ };
1248
+ defaultValue.Provider = defaultValue;
1249
+ defaultValue.Consumer = {
1250
+ $$typeof: REACT_CONSUMER_TYPE,
1251
+ _context: defaultValue
1252
+ };
1253
+ defaultValue._currentRenderer = null;
1254
+ defaultValue._currentRenderer2 = null;
1255
+ return defaultValue;
1256
+ };
1257
+ exports.createElement = function (type, config, children) {
1258
+ if (isValidElementType(type))
1259
+ for (var i = 2; i < arguments.length; i++)
1260
+ validateChildKeys(arguments[i], type);
1261
+ else {
1262
+ i = "";
1263
+ if (
1264
+ void 0 === type ||
1265
+ ("object" === typeof type &&
1266
+ null !== type &&
1267
+ 0 === Object.keys(type).length)
1268
+ )
1269
+ i +=
1270
+ " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
1271
+ if (null === type) var typeString = "null";
1272
+ else
1273
+ isArrayImpl(type)
1274
+ ? (typeString = "array")
1275
+ : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
1276
+ ? ((typeString =
1277
+ "<" +
1278
+ (getComponentNameFromType(type.type) || "Unknown") +
1279
+ " />"),
1280
+ (i =
1281
+ " Did you accidentally export a JSX literal instead of a component?"))
1282
+ : (typeString = typeof type);
1283
+ console.error(
1284
+ "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
1285
+ typeString,
1286
+ i
1287
+ );
1288
+ }
1289
+ var propName;
1290
+ i = {};
1291
+ typeString = null;
1292
+ if (null != config)
1293
+ for (propName in (didWarnAboutOldJSXRuntime ||
1294
+ !("__self" in config) ||
1295
+ "key" in config ||
1296
+ ((didWarnAboutOldJSXRuntime = !0),
1297
+ console.warn(
1298
+ "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
1299
+ )),
1300
+ hasValidKey(config) &&
1301
+ (checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
1302
+ config))
1303
+ hasOwnProperty.call(config, propName) &&
1304
+ "key" !== propName &&
1305
+ "__self" !== propName &&
1306
+ "__source" !== propName &&
1307
+ (i[propName] = config[propName]);
1308
+ var childrenLength = arguments.length - 2;
1309
+ if (1 === childrenLength) i.children = children;
1310
+ else if (1 < childrenLength) {
1311
+ for (
1312
+ var childArray = Array(childrenLength), _i = 0;
1313
+ _i < childrenLength;
1314
+ _i++
1315
+ )
1316
+ childArray[_i] = arguments[_i + 2];
1317
+ Object.freeze && Object.freeze(childArray);
1318
+ i.children = childArray;
1319
+ }
1320
+ if (type && type.defaultProps)
1321
+ for (propName in ((childrenLength = type.defaultProps), childrenLength))
1322
+ void 0 === i[propName] && (i[propName] = childrenLength[propName]);
1323
+ typeString &&
1324
+ defineKeyPropWarningGetter(
1325
+ i,
1326
+ "function" === typeof type
1327
+ ? type.displayName || type.name || "Unknown"
1328
+ : type
1329
+ );
1330
+ return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
1331
+ };
1332
+ exports.createRef = function () {
1333
+ var refObject = { current: null };
1334
+ Object.seal(refObject);
1335
+ return refObject;
1336
+ };
1337
+ exports.forwardRef = function (render) {
1338
+ null != render && render.$$typeof === REACT_MEMO_TYPE
1339
+ ? console.error(
1340
+ "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
1341
+ )
1342
+ : "function" !== typeof render
1343
+ ? console.error(
1344
+ "forwardRef requires a render function but was given %s.",
1345
+ null === render ? "null" : typeof render
1346
+ )
1347
+ : 0 !== render.length &&
1348
+ 2 !== render.length &&
1349
+ console.error(
1350
+ "forwardRef render functions accept exactly two parameters: props and ref. %s",
1351
+ 1 === render.length
1352
+ ? "Did you forget to use the ref parameter?"
1353
+ : "Any additional parameter will be undefined."
1354
+ );
1355
+ null != render &&
1356
+ null != render.defaultProps &&
1357
+ console.error(
1358
+ "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
1359
+ );
1360
+ var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
1361
+ ownName;
1362
+ Object.defineProperty(elementType, "displayName", {
1363
+ enumerable: !1,
1364
+ configurable: !0,
1365
+ get: function () {
1366
+ return ownName;
1367
+ },
1368
+ set: function (name) {
1369
+ ownName = name;
1370
+ render.name ||
1371
+ render.displayName ||
1372
+ (Object.defineProperty(render, "name", { value: name }),
1373
+ (render.displayName = name));
1374
+ }
1375
+ });
1376
+ return elementType;
1377
+ };
1378
+ exports.isValidElement = isValidElement;
1379
+ exports.lazy = function (ctor) {
1380
+ return {
1381
+ $$typeof: REACT_LAZY_TYPE,
1382
+ _payload: { _status: -1, _result: ctor },
1383
+ _init: lazyInitializer
1384
+ };
1385
+ };
1386
+ exports.memo = function (type, compare) {
1387
+ isValidElementType(type) ||
1388
+ console.error(
1389
+ "memo: The first argument must be a component. Instead received: %s",
1390
+ null === type ? "null" : typeof type
1391
+ );
1392
+ compare = {
1393
+ $$typeof: REACT_MEMO_TYPE,
1394
+ type: type,
1395
+ compare: void 0 === compare ? null : compare
1396
+ };
1397
+ var ownName;
1398
+ Object.defineProperty(compare, "displayName", {
1399
+ enumerable: !1,
1400
+ configurable: !0,
1401
+ get: function () {
1402
+ return ownName;
1403
+ },
1404
+ set: function (name) {
1405
+ ownName = name;
1406
+ type.name ||
1407
+ type.displayName ||
1408
+ (Object.defineProperty(type, "name", { value: name }),
1409
+ (type.displayName = name));
1410
+ }
1411
+ });
1412
+ return compare;
1413
+ };
1414
+ exports.startTransition = function (scope) {
1415
+ var prevTransition = ReactSharedInternals.T,
1416
+ currentTransition = {};
1417
+ ReactSharedInternals.T = currentTransition;
1418
+ currentTransition._updatedFibers = new Set();
1419
+ try {
1420
+ var returnValue = scope(),
1421
+ onStartTransitionFinish = ReactSharedInternals.S;
1422
+ null !== onStartTransitionFinish &&
1423
+ onStartTransitionFinish(currentTransition, returnValue);
1424
+ "object" === typeof returnValue &&
1425
+ null !== returnValue &&
1426
+ "function" === typeof returnValue.then &&
1427
+ returnValue.then(noop, reportGlobalError);
1428
+ } catch (error) {
1429
+ reportGlobalError(error);
2729
1430
  } finally {
2730
- isFlushing = false;
1431
+ null === prevTransition &&
1432
+ currentTransition._updatedFibers &&
1433
+ ((scope = currentTransition._updatedFibers.size),
1434
+ currentTransition._updatedFibers.clear(),
1435
+ 10 < scope &&
1436
+ console.warn(
1437
+ "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1438
+ )),
1439
+ (ReactSharedInternals.T = prevTransition);
2731
1440
  }
2732
- }
2733
- }
2734
- } // Some of our warnings attempt to detect if the `act` call is awaited by
2735
- // checking in an asynchronous task. Wait a few microtasks before checking. The
2736
- // only reason one isn't sufficient is we want to accommodate the case where an
2737
- // `act` call is returned from an async function without first being awaited,
2738
- // since that's a somewhat common pattern. If you do this too many times in a
2739
- // nested sequence, you might get a warning, but you can always fix by awaiting
2740
- // the call.
2741
- //
2742
- // A macrotask would also work (and is the fallback) but depending on the test
2743
- // environment it may cause the warning to fire too late.
2744
-
2745
-
2746
- var queueSeveralMicrotasks = typeof queueMicrotask === 'function' ? function (callback) {
2747
- queueMicrotask(function () {
2748
- return queueMicrotask(callback);
2749
- });
2750
- } : enqueueTask;
2751
-
2752
- var Children = {
2753
- map: mapChildren,
2754
- forEach: forEachChildren,
2755
- count: countChildren,
2756
- toArray: toArray,
2757
- only: onlyChild
2758
- };
2759
-
2760
- exports.Children = Children;
2761
- exports.Component = Component;
2762
- exports.Fragment = REACT_FRAGMENT_TYPE;
2763
- exports.Profiler = REACT_PROFILER_TYPE;
2764
- exports.PureComponent = PureComponent;
2765
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
2766
- exports.Suspense = REACT_SUSPENSE_TYPE;
2767
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
2768
- exports.act = act;
2769
- exports.cache = cache;
2770
- exports.cloneElement = cloneElement;
2771
- exports.createContext = createContext;
2772
- exports.createElement = createElement;
2773
- exports.createRef = createRef;
2774
- exports.forwardRef = forwardRef;
2775
- exports.isValidElement = isValidElement;
2776
- exports.lazy = lazy;
2777
- exports.memo = memo;
2778
- exports.startTransition = startTransition;
2779
- exports.unstable_useCacheRefresh = useCacheRefresh;
2780
- exports.use = use;
2781
- exports.useActionState = useActionState;
2782
- exports.useCallback = useCallback;
2783
- exports.useContext = useContext;
2784
- exports.useDebugValue = useDebugValue;
2785
- exports.useDeferredValue = useDeferredValue;
2786
- exports.useEffect = useEffect;
2787
- exports.useId = useId;
2788
- exports.useImperativeHandle = useImperativeHandle;
2789
- exports.useInsertionEffect = useInsertionEffect;
2790
- exports.useLayoutEffect = useLayoutEffect;
2791
- exports.useMemo = useMemo;
2792
- exports.useOptimistic = useOptimistic;
2793
- exports.useReducer = useReducer;
2794
- exports.useRef = useRef;
2795
- exports.useState = useState;
2796
- exports.useSyncExternalStore = useSyncExternalStore;
2797
- exports.useTransition = useTransition;
2798
- exports.version = ReactVersion;
2799
- if (
2800
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
2801
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
2802
- 'function'
2803
- ) {
2804
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2805
- }
2806
-
1441
+ };
1442
+ exports.unstable_useCacheRefresh = function () {
1443
+ return resolveDispatcher().useCacheRefresh();
1444
+ };
1445
+ exports.use = function (usable) {
1446
+ return resolveDispatcher().use(usable);
1447
+ };
1448
+ exports.useActionState = function (action, initialState, permalink) {
1449
+ return resolveDispatcher().useActionState(
1450
+ action,
1451
+ initialState,
1452
+ permalink
1453
+ );
1454
+ };
1455
+ exports.useCallback = function (callback, deps) {
1456
+ return resolveDispatcher().useCallback(callback, deps);
1457
+ };
1458
+ exports.useContext = function (Context) {
1459
+ var dispatcher = resolveDispatcher();
1460
+ Context.$$typeof === REACT_CONSUMER_TYPE &&
1461
+ console.error(
1462
+ "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1463
+ );
1464
+ return dispatcher.useContext(Context);
1465
+ };
1466
+ exports.useDebugValue = function (value, formatterFn) {
1467
+ return resolveDispatcher().useDebugValue(value, formatterFn);
1468
+ };
1469
+ exports.useDeferredValue = function (value, initialValue) {
1470
+ return resolveDispatcher().useDeferredValue(value, initialValue);
1471
+ };
1472
+ exports.useEffect = function (create, deps) {
1473
+ return resolveDispatcher().useEffect(create, deps);
1474
+ };
1475
+ exports.useId = function () {
1476
+ return resolveDispatcher().useId();
1477
+ };
1478
+ exports.useImperativeHandle = function (ref, create, deps) {
1479
+ return resolveDispatcher().useImperativeHandle(ref, create, deps);
1480
+ };
1481
+ exports.useInsertionEffect = function (create, deps) {
1482
+ return resolveDispatcher().useInsertionEffect(create, deps);
1483
+ };
1484
+ exports.useLayoutEffect = function (create, deps) {
1485
+ return resolveDispatcher().useLayoutEffect(create, deps);
1486
+ };
1487
+ exports.useMemo = function (create, deps) {
1488
+ return resolveDispatcher().useMemo(create, deps);
1489
+ };
1490
+ exports.useOptimistic = function (passthrough, reducer) {
1491
+ return resolveDispatcher().useOptimistic(passthrough, reducer);
1492
+ };
1493
+ exports.useReducer = function (reducer, initialArg, init) {
1494
+ return resolveDispatcher().useReducer(reducer, initialArg, init);
1495
+ };
1496
+ exports.useRef = function (initialValue) {
1497
+ return resolveDispatcher().useRef(initialValue);
1498
+ };
1499
+ exports.useState = function (initialState) {
1500
+ return resolveDispatcher().useState(initialState);
1501
+ };
1502
+ exports.useSyncExternalStore = function (
1503
+ subscribe,
1504
+ getSnapshot,
1505
+ getServerSnapshot
1506
+ ) {
1507
+ return resolveDispatcher().useSyncExternalStore(
1508
+ subscribe,
1509
+ getSnapshot,
1510
+ getServerSnapshot
1511
+ );
1512
+ };
1513
+ exports.useTransition = function () {
1514
+ return resolveDispatcher().useTransition();
1515
+ };
1516
+ exports.version = "19.0.0";
1517
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1518
+ "function" ===
1519
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
1520
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2807
1521
  })();
2808
- }