react 19.0.0-rc.0 → 19.0.0
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.
- package/cjs/react-compiler-runtime.development.js +13 -84
- package/cjs/react-jsx-dev-runtime.development.js +618 -1226
- package/cjs/react-jsx-dev-runtime.react-server.development.js +628 -1261
- package/cjs/react-jsx-runtime.development.js +614 -1244
- package/cjs/react-jsx-runtime.react-server.development.js +628 -1261
- package/cjs/react.development.js +1472 -2759
- package/cjs/react.production.js +8 -9
- package/cjs/react.react-server.development.js +1059 -2133
- package/cjs/react.react-server.production.js +7 -60
- package/package.json +1 -1
@@ -8,2181 +8,1107 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
23
|
-
// as a normal prop instead of stripping it from the props object.
|
24
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
25
|
-
// during element creation.
|
26
|
-
|
27
|
-
var enableRefAsProp = true;
|
28
|
-
|
29
|
-
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
|
30
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
31
|
-
// issues in DEV builds.
|
32
|
-
|
33
|
-
var enableDebugTracing = false;
|
34
|
-
|
35
|
-
var ReactSharedInternals = {
|
36
|
-
H: null,
|
37
|
-
A: null
|
38
|
-
};
|
39
|
-
|
40
|
-
{
|
41
|
-
// Stack implementation injected by the current renderer.
|
42
|
-
ReactSharedInternals.getCurrentStack = null;
|
43
|
-
}
|
44
|
-
|
45
|
-
// by calls to these methods by a Babel plugin.
|
46
|
-
//
|
47
|
-
// In PROD (or in packages without access to React internals),
|
48
|
-
// they are left as they are instead.
|
49
|
-
|
50
|
-
function warn(format) {
|
51
|
-
{
|
52
|
-
{
|
53
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
54
|
-
args[_key - 1] = arguments[_key];
|
55
|
-
}
|
56
|
-
|
57
|
-
printWarning('warn', format, args);
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
function error(format) {
|
62
|
-
{
|
63
|
-
{
|
64
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
65
|
-
args[_key2 - 1] = arguments[_key2];
|
66
|
-
}
|
67
|
-
|
68
|
-
printWarning('error', format, args);
|
69
|
-
}
|
70
|
-
}
|
71
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
72
|
-
|
73
|
-
function printWarning(level, format, args) {
|
74
|
-
// When changing this logic, you might want to also
|
75
|
-
// update consoleWithStackDev.www.js as well.
|
76
|
-
{
|
77
|
-
var isErrorLogger = format === '%s\n\n%s\n' || format === '%o\n\n%s\n\n%s\n';
|
78
|
-
|
79
|
-
if (ReactSharedInternals.getCurrentStack) {
|
80
|
-
// We only add the current stack to the console when createTask is not supported.
|
81
|
-
// Since createTask requires DevTools to be open to work, this means that stacks
|
82
|
-
// can be lost while DevTools isn't open but we can't detect this.
|
83
|
-
var stack = ReactSharedInternals.getCurrentStack();
|
84
|
-
|
85
|
-
if (stack !== '') {
|
86
|
-
format += '%s';
|
87
|
-
args = args.concat([stack]);
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
if (isErrorLogger) {
|
92
|
-
// Don't prefix our default logging formatting in ReactFiberErrorLoggger.
|
93
|
-
// Don't toString the arguments.
|
94
|
-
args.unshift(format);
|
95
|
-
} else {
|
96
|
-
// TODO: Remove this prefix and stop toStringing in the wrapper and
|
97
|
-
// instead do it at each callsite as needed.
|
98
|
-
// Careful: RN currently depends on this prefix
|
99
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
100
|
-
args = args.map(function (item) {
|
101
|
-
return String(item);
|
102
|
-
});
|
103
|
-
args.unshift('Warning: ' + format);
|
104
|
-
} // We intentionally don't use spread (or .apply) directly because it
|
105
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
106
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
107
|
-
|
108
|
-
|
109
|
-
Function.prototype.apply.call(console[level], console, args);
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
114
|
-
|
115
|
-
function isArray(a) {
|
116
|
-
return isArrayImpl(a);
|
117
|
-
}
|
118
|
-
|
119
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.transitional.element') ;
|
120
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
121
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
122
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
123
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
124
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
|
125
|
-
|
126
|
-
var REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
|
127
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
128
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
129
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
130
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
131
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
132
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
133
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
134
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
135
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
136
|
-
function getIteratorFn(maybeIterable) {
|
137
|
-
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
138
|
-
return null;
|
139
|
-
}
|
140
|
-
|
141
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
142
|
-
|
143
|
-
if (typeof maybeIterator === 'function') {
|
144
|
-
return maybeIterator;
|
145
|
-
}
|
146
|
-
|
147
|
-
return null;
|
148
|
-
}
|
149
|
-
|
150
|
-
/*
|
151
|
-
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
|
152
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
153
|
-
*
|
154
|
-
* The functions in this module will throw an easier-to-understand,
|
155
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
156
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
157
|
-
* of the `value` object).
|
158
|
-
*/
|
159
|
-
// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
160
|
-
function typeName(value) {
|
161
|
-
{
|
162
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
163
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
164
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return]
|
165
|
-
|
166
|
-
return type;
|
167
|
-
}
|
168
|
-
} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible.
|
169
|
-
|
170
|
-
|
171
|
-
function willCoercionThrow(value) {
|
172
|
-
{
|
173
|
-
try {
|
174
|
-
testStringCoercion(value);
|
175
|
-
return false;
|
176
|
-
} catch (e) {
|
177
|
-
return true;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
function testStringCoercion(value) {
|
183
|
-
// If you ended up here by following an exception call stack, here's what's
|
184
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
185
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
186
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
187
|
-
//
|
188
|
-
// The most common types that will cause this exception are `Symbol` instances
|
189
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
190
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
191
|
-
// exception. (Library authors do this to prevent users from using built-in
|
192
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
193
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
194
|
-
//
|
195
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
196
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
197
|
-
//
|
198
|
-
// To find which value is throwing, check the browser or debugger console.
|
199
|
-
// Before this exception was thrown, there should be `console.error` output
|
200
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
201
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
202
|
-
// In most cases, this console output also shows the component and its
|
203
|
-
// ancestor components where the exception happened.
|
204
|
-
//
|
205
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
206
|
-
return '' + value;
|
207
|
-
}
|
208
|
-
function checkKeyStringCoercion(value) {
|
209
|
-
{
|
210
|
-
if (willCoercionThrow(value)) {
|
211
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before using it here.', typeName(value));
|
212
|
-
|
213
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
219
|
-
var displayName = outerType.displayName;
|
220
|
-
|
221
|
-
if (displayName) {
|
222
|
-
return displayName;
|
223
|
-
}
|
224
|
-
|
225
|
-
var functionName = innerType.displayName || innerType.name || '';
|
226
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
227
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
228
|
-
|
229
|
-
|
230
|
-
function getContextName(type) {
|
231
|
-
return type.displayName || 'Context';
|
232
|
-
}
|
233
|
-
|
234
|
-
var REACT_CLIENT_REFERENCE$2 = Symbol.for('react.client.reference'); // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
235
|
-
|
236
|
-
function getComponentNameFromType(type) {
|
237
|
-
if (type == null) {
|
238
|
-
// Host root, text node or just invalid type.
|
239
|
-
return null;
|
240
|
-
}
|
241
|
-
|
242
|
-
if (typeof type === 'function') {
|
243
|
-
if (type.$$typeof === REACT_CLIENT_REFERENCE$2) {
|
244
|
-
// TODO: Create a convention for naming client references with debug info.
|
245
|
-
return null;
|
246
|
-
}
|
247
|
-
|
248
|
-
return type.displayName || type.name || null;
|
249
|
-
}
|
250
|
-
|
251
|
-
if (typeof type === 'string') {
|
252
|
-
return type;
|
253
|
-
}
|
254
|
-
|
255
|
-
switch (type) {
|
256
|
-
case REACT_FRAGMENT_TYPE:
|
257
|
-
return 'Fragment';
|
258
|
-
|
259
|
-
case REACT_PORTAL_TYPE:
|
260
|
-
return 'Portal';
|
261
|
-
|
262
|
-
case REACT_PROFILER_TYPE:
|
263
|
-
return 'Profiler';
|
264
|
-
|
265
|
-
case REACT_STRICT_MODE_TYPE:
|
266
|
-
return 'StrictMode';
|
267
|
-
|
268
|
-
case REACT_SUSPENSE_TYPE:
|
269
|
-
return 'Suspense';
|
270
|
-
|
271
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
272
|
-
return 'SuspenseList';
|
273
|
-
|
274
|
-
}
|
275
|
-
|
276
|
-
if (typeof type === 'object') {
|
277
|
-
{
|
278
|
-
if (typeof type.tag === 'number') {
|
279
|
-
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
280
|
-
}
|
281
|
-
}
|
282
|
-
|
283
|
-
switch (type.$$typeof) {
|
284
|
-
case REACT_PROVIDER_TYPE:
|
285
|
-
{
|
286
|
-
return null;
|
287
|
-
}
|
288
|
-
|
289
|
-
case REACT_CONTEXT_TYPE:
|
290
|
-
var context = type;
|
291
|
-
|
292
|
-
{
|
293
|
-
return getContextName(context) + '.Provider';
|
294
|
-
}
|
295
|
-
|
296
|
-
case REACT_CONSUMER_TYPE:
|
297
|
-
{
|
298
|
-
var consumer = type;
|
299
|
-
return getContextName(consumer._context) + '.Consumer';
|
300
|
-
}
|
301
|
-
|
302
|
-
case REACT_FORWARD_REF_TYPE:
|
303
|
-
return getWrappedName(type, type.render, 'ForwardRef');
|
304
|
-
|
305
|
-
case REACT_MEMO_TYPE:
|
306
|
-
var outerName = type.displayName || null;
|
307
|
-
|
308
|
-
if (outerName !== null) {
|
309
|
-
return outerName;
|
310
|
-
}
|
311
|
-
|
312
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
313
|
-
|
314
|
-
case REACT_LAZY_TYPE:
|
315
|
-
{
|
316
|
-
var lazyComponent = type;
|
317
|
-
var payload = lazyComponent._payload;
|
318
|
-
var init = lazyComponent._init;
|
319
|
-
|
320
|
-
try {
|
321
|
-
return getComponentNameFromType(init(payload));
|
322
|
-
} catch (x) {
|
323
|
-
return null;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
}
|
327
|
-
}
|
328
|
-
|
329
|
-
return null;
|
330
|
-
}
|
331
|
-
|
332
|
-
// $FlowFixMe[method-unbinding]
|
333
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
334
|
-
|
335
|
-
var assign = Object.assign;
|
336
|
-
|
337
|
-
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.
|
338
|
-
// TODO: Delete this when enableOwnerStacks ships.
|
339
|
-
|
340
|
-
function isValidElementType(type) {
|
341
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
342
|
-
return true;
|
343
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
344
|
-
|
345
|
-
|
346
|
-
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 ) {
|
347
|
-
return true;
|
348
|
-
}
|
349
|
-
|
350
|
-
if (typeof type === 'object' && type !== null) {
|
351
|
-
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
|
352
|
-
// types supported by any Flight configuration anywhere since
|
353
|
-
// we don't know which Flight build this will end up being used
|
354
|
-
// with.
|
355
|
-
type.$$typeof === REACT_CLIENT_REFERENCE$1 || type.getModuleId !== undefined) {
|
356
|
-
return true;
|
357
|
-
}
|
358
|
-
}
|
359
|
-
|
360
|
-
return false;
|
361
|
-
}
|
362
|
-
|
363
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
364
|
-
// replaying on render function. This currently only patches the object
|
365
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
366
|
-
// We could also eagerly patch the method.
|
367
|
-
var disabledDepth = 0;
|
368
|
-
var prevLog;
|
369
|
-
var prevInfo;
|
370
|
-
var prevWarn;
|
371
|
-
var prevError;
|
372
|
-
var prevGroup;
|
373
|
-
var prevGroupCollapsed;
|
374
|
-
var prevGroupEnd;
|
375
|
-
|
376
|
-
function disabledLog() {}
|
377
|
-
|
378
|
-
disabledLog.__reactDisabledLog = true;
|
379
|
-
function disableLogs() {
|
380
|
-
{
|
381
|
-
if (disabledDepth === 0) {
|
382
|
-
/* eslint-disable react-internal/no-production-logging */
|
383
|
-
prevLog = console.log;
|
384
|
-
prevInfo = console.info;
|
385
|
-
prevWarn = console.warn;
|
386
|
-
prevError = console.error;
|
387
|
-
prevGroup = console.group;
|
388
|
-
prevGroupCollapsed = console.groupCollapsed;
|
389
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
390
|
-
|
391
|
-
var props = {
|
392
|
-
configurable: true,
|
393
|
-
enumerable: true,
|
394
|
-
value: disabledLog,
|
395
|
-
writable: true
|
396
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
397
|
-
|
398
|
-
Object.defineProperties(console, {
|
399
|
-
info: props,
|
400
|
-
log: props,
|
401
|
-
warn: props,
|
402
|
-
error: props,
|
403
|
-
group: props,
|
404
|
-
groupCollapsed: props,
|
405
|
-
groupEnd: props
|
406
|
-
});
|
407
|
-
/* eslint-enable react-internal/no-production-logging */
|
408
|
-
}
|
409
|
-
|
410
|
-
disabledDepth++;
|
411
|
-
}
|
412
|
-
}
|
413
|
-
function reenableLogs() {
|
414
|
-
{
|
415
|
-
disabledDepth--;
|
416
|
-
|
417
|
-
if (disabledDepth === 0) {
|
418
|
-
/* eslint-disable react-internal/no-production-logging */
|
419
|
-
var props = {
|
420
|
-
configurable: true,
|
421
|
-
enumerable: true,
|
422
|
-
writable: true
|
423
|
-
}; // $FlowFixMe[cannot-write] Flow thinks console is immutable.
|
424
|
-
|
425
|
-
Object.defineProperties(console, {
|
426
|
-
log: assign({}, props, {
|
427
|
-
value: prevLog
|
428
|
-
}),
|
429
|
-
info: assign({}, props, {
|
430
|
-
value: prevInfo
|
431
|
-
}),
|
432
|
-
warn: assign({}, props, {
|
433
|
-
value: prevWarn
|
434
|
-
}),
|
435
|
-
error: assign({}, props, {
|
436
|
-
value: prevError
|
437
|
-
}),
|
438
|
-
group: assign({}, props, {
|
439
|
-
value: prevGroup
|
440
|
-
}),
|
441
|
-
groupCollapsed: assign({}, props, {
|
442
|
-
value: prevGroupCollapsed
|
443
|
-
}),
|
444
|
-
groupEnd: assign({}, props, {
|
445
|
-
value: prevGroupEnd
|
446
|
-
})
|
447
|
-
});
|
448
|
-
/* eslint-enable react-internal/no-production-logging */
|
449
|
-
}
|
450
|
-
|
451
|
-
if (disabledDepth < 0) {
|
452
|
-
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
453
|
-
}
|
454
|
-
}
|
455
|
-
}
|
456
|
-
|
457
|
-
var prefix;
|
458
|
-
function describeBuiltInComponentFrame(name) {
|
459
|
-
{
|
460
|
-
if (prefix === undefined) {
|
461
|
-
// Extract the VM specific prefix used by each line.
|
462
|
-
try {
|
463
|
-
throw Error();
|
464
|
-
} catch (x) {
|
465
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
466
|
-
prefix = match && match[1] || '';
|
467
|
-
}
|
468
|
-
} // We use the prefix to ensure our stacks line up with native stack frames.
|
469
|
-
|
470
|
-
|
471
|
-
return '\n' + prefix + name;
|
472
|
-
}
|
473
|
-
}
|
474
|
-
var reentry = false;
|
475
|
-
var componentFrameCache;
|
476
|
-
|
477
|
-
{
|
478
|
-
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
479
|
-
componentFrameCache = new PossiblyWeakMap();
|
480
|
-
}
|
481
|
-
/**
|
482
|
-
* Leverages native browser/VM stack frames to get proper details (e.g.
|
483
|
-
* filename, line + col number) for a single component in a component stack. We
|
484
|
-
* do this by:
|
485
|
-
* (1) throwing and catching an error in the function - this will be our
|
486
|
-
* control error.
|
487
|
-
* (2) calling the component which will eventually throw an error that we'll
|
488
|
-
* catch - this will be our sample error.
|
489
|
-
* (3) diffing the control and sample error stacks to find the stack frame
|
490
|
-
* which represents our component.
|
491
|
-
*/
|
492
|
-
|
493
|
-
|
494
|
-
function describeNativeComponentFrame(fn, construct) {
|
495
|
-
// If something asked for a stack inside a fake render, it should get ignored.
|
496
|
-
if (!fn || reentry) {
|
497
|
-
return '';
|
498
|
-
}
|
499
|
-
|
500
|
-
{
|
501
|
-
var frame = componentFrameCache.get(fn);
|
502
|
-
|
503
|
-
if (frame !== undefined) {
|
504
|
-
return frame;
|
505
|
-
}
|
506
|
-
}
|
507
|
-
|
508
|
-
reentry = true;
|
509
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe[incompatible-type] It does accept undefined.
|
510
|
-
|
511
|
-
Error.prepareStackTrace = undefined;
|
512
|
-
var previousDispatcher = null;
|
513
|
-
|
514
|
-
{
|
515
|
-
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
|
516
|
-
// for warnings.
|
517
|
-
|
518
|
-
ReactSharedInternals.H = null;
|
519
|
-
disableLogs();
|
520
|
-
}
|
521
|
-
/**
|
522
|
-
* Finding a common stack frame between sample and control errors can be
|
523
|
-
* tricky given the different types and levels of stack trace truncation from
|
524
|
-
* different JS VMs. So instead we'll attempt to control what that common
|
525
|
-
* frame should be through this object method:
|
526
|
-
* Having both the sample and control errors be in the function under the
|
527
|
-
* `DescribeNativeComponentFrameRoot` property, + setting the `name` and
|
528
|
-
* `displayName` properties of the function ensures that a stack
|
529
|
-
* frame exists that has the method name `DescribeNativeComponentFrameRoot` in
|
530
|
-
* it for both control and sample stacks.
|
531
|
-
*/
|
532
|
-
|
533
|
-
|
534
|
-
var RunInRootFrame = {
|
535
|
-
DetermineComponentFrameRoot: function () {
|
536
|
-
var control;
|
537
|
-
|
538
|
-
try {
|
539
|
-
// This should throw.
|
540
|
-
if (construct) {
|
541
|
-
// Something should be setting the props in the constructor.
|
542
|
-
var Fake = function () {
|
543
|
-
throw Error();
|
544
|
-
}; // $FlowFixMe[prop-missing]
|
545
|
-
|
546
|
-
|
547
|
-
Object.defineProperty(Fake.prototype, 'props', {
|
548
|
-
set: function () {
|
549
|
-
// We use a throwing setter instead of frozen or non-writable props
|
550
|
-
// because that won't throw in a non-strict mode function.
|
551
|
-
throw Error();
|
552
|
-
}
|
553
|
-
});
|
554
|
-
|
555
|
-
if (typeof Reflect === 'object' && Reflect.construct) {
|
556
|
-
// We construct a different control for this case to include any extra
|
557
|
-
// frames added by the construct call.
|
558
|
-
try {
|
559
|
-
Reflect.construct(Fake, []);
|
560
|
-
} catch (x) {
|
561
|
-
control = x;
|
562
|
-
}
|
563
|
-
|
564
|
-
Reflect.construct(fn, [], Fake);
|
565
|
-
} else {
|
566
|
-
try {
|
567
|
-
Fake.call();
|
568
|
-
} catch (x) {
|
569
|
-
control = x;
|
570
|
-
} // $FlowFixMe[prop-missing] found when upgrading Flow
|
571
|
-
|
572
|
-
|
573
|
-
fn.call(Fake.prototype);
|
574
|
-
}
|
575
|
-
} else {
|
576
|
-
try {
|
577
|
-
throw Error();
|
578
|
-
} catch (x) {
|
579
|
-
control = x;
|
580
|
-
} // TODO(luna): This will currently only throw if the function component
|
581
|
-
// tries to access React/ReactDOM/props. We should probably make this throw
|
582
|
-
// in simple components too
|
583
|
-
|
584
|
-
|
585
|
-
var maybePromise = fn(); // If the function component returns a promise, it's likely an async
|
586
|
-
// component, which we don't yet support. Attach a noop catch handler to
|
587
|
-
// silence the error.
|
588
|
-
// TODO: Implement component stacks for async client components?
|
589
|
-
|
590
|
-
if (maybePromise && typeof maybePromise.catch === 'function') {
|
591
|
-
maybePromise.catch(function () {});
|
592
|
-
}
|
593
|
-
}
|
594
|
-
} catch (sample) {
|
595
|
-
// This is inlined manually because closure doesn't do it for us.
|
596
|
-
if (sample && control && typeof sample.stack === 'string') {
|
597
|
-
return [sample.stack, control.stack];
|
598
|
-
}
|
599
|
-
}
|
600
|
-
|
601
|
-
return [null, null];
|
602
|
-
}
|
603
|
-
}; // $FlowFixMe[prop-missing]
|
604
|
-
|
605
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName = 'DetermineComponentFrameRoot';
|
606
|
-
var namePropDescriptor = Object.getOwnPropertyDescriptor(RunInRootFrame.DetermineComponentFrameRoot, 'name'); // Before ES6, the `name` property was not configurable.
|
607
|
-
|
608
|
-
if (namePropDescriptor && namePropDescriptor.configurable) {
|
609
|
-
// V8 utilizes a function's `name` property when generating a stack trace.
|
610
|
-
Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, // Configurable properties can be updated even if its writable descriptor
|
611
|
-
// is set to `false`.
|
612
|
-
// $FlowFixMe[cannot-write]
|
613
|
-
'name', {
|
614
|
-
value: 'DetermineComponentFrameRoot'
|
615
|
-
});
|
616
|
-
}
|
617
|
-
|
618
|
-
try {
|
619
|
-
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(),
|
620
|
-
sampleStack = _RunInRootFrame$Deter[0],
|
621
|
-
controlStack = _RunInRootFrame$Deter[1];
|
622
|
-
|
623
|
-
if (sampleStack && controlStack) {
|
624
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
625
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
626
|
-
var sampleLines = sampleStack.split('\n');
|
627
|
-
var controlLines = controlStack.split('\n');
|
628
|
-
var s = 0;
|
629
|
-
var c = 0;
|
630
|
-
|
631
|
-
while (s < sampleLines.length && !sampleLines[s].includes('DetermineComponentFrameRoot')) {
|
632
|
-
s++;
|
633
|
-
}
|
634
|
-
|
635
|
-
while (c < controlLines.length && !controlLines[c].includes('DetermineComponentFrameRoot')) {
|
636
|
-
c++;
|
637
|
-
} // We couldn't find our intentionally injected common root frame, attempt
|
638
|
-
// to find another common root frame by search from the bottom of the
|
639
|
-
// control stack...
|
640
|
-
|
641
|
-
|
642
|
-
if (s === sampleLines.length || c === controlLines.length) {
|
643
|
-
s = sampleLines.length - 1;
|
644
|
-
c = controlLines.length - 1;
|
645
|
-
|
646
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
647
|
-
// We expect at least one stack frame to be shared.
|
648
|
-
// Typically this will be the root most one. However, stack frames may be
|
649
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
650
|
-
// earlier than the other. We assume that the sample is longer or the same
|
651
|
-
// and there for cut off earlier. So we should find the root most frame in
|
652
|
-
// the sample somewhere in the control.
|
653
|
-
c--;
|
654
|
-
}
|
655
|
-
}
|
656
|
-
|
657
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
658
|
-
// Next we find the first one that isn't the same which should be the
|
659
|
-
// frame that called our sample function and the control.
|
660
|
-
if (sampleLines[s] !== controlLines[c]) {
|
661
|
-
// In V8, the first line is describing the message but other VMs don't.
|
662
|
-
// If we're about to return the first line, and the control is also on the same
|
663
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
664
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
665
|
-
// This can happen if you passed a class to function component, or non-function.
|
666
|
-
if (s !== 1 || c !== 1) {
|
667
|
-
do {
|
668
|
-
s--;
|
669
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
670
|
-
// The next one that isn't the same should be our match though.
|
671
|
-
|
672
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
673
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
674
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
675
|
-
// but we have a user-provided "displayName"
|
676
|
-
// splice it in to make the stack more readable.
|
677
|
-
|
678
|
-
|
679
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
680
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
681
|
-
}
|
682
|
-
|
683
|
-
if (true) {
|
684
|
-
if (typeof fn === 'function') {
|
685
|
-
componentFrameCache.set(fn, _frame);
|
686
|
-
}
|
687
|
-
} // Return the line we found.
|
688
|
-
|
689
|
-
|
690
|
-
return _frame;
|
691
|
-
}
|
692
|
-
} while (s >= 1 && c >= 0);
|
693
|
-
}
|
694
|
-
|
695
|
-
break;
|
696
|
-
}
|
697
|
-
}
|
698
|
-
}
|
699
|
-
} finally {
|
700
|
-
reentry = false;
|
701
|
-
|
702
|
-
{
|
703
|
-
ReactSharedInternals.H = previousDispatcher;
|
704
|
-
reenableLogs();
|
705
|
-
}
|
706
|
-
|
707
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
708
|
-
} // Fallback to just using the name if we couldn't make it throw.
|
709
|
-
|
710
|
-
|
711
|
-
var name = fn ? fn.displayName || fn.name : '';
|
712
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
713
|
-
|
714
|
-
{
|
715
|
-
if (typeof fn === 'function') {
|
716
|
-
componentFrameCache.set(fn, syntheticFrame);
|
717
|
-
}
|
718
|
-
}
|
719
|
-
|
720
|
-
return syntheticFrame;
|
721
|
-
}
|
722
|
-
function describeFunctionComponentFrame(fn) {
|
723
|
-
{
|
724
|
-
return describeNativeComponentFrame(fn, false);
|
725
|
-
}
|
726
|
-
}
|
727
|
-
|
728
|
-
function shouldConstruct(Component) {
|
729
|
-
var prototype = Component.prototype;
|
730
|
-
return !!(prototype && prototype.isReactComponent);
|
731
|
-
} // TODO: Delete this once the key warning no longer uses it. I.e. when enableOwnerStacks ship.
|
732
|
-
|
733
|
-
|
734
|
-
function describeUnknownElementTypeFrameInDEV(type) {
|
735
|
-
|
736
|
-
if (type == null) {
|
737
|
-
return '';
|
738
|
-
}
|
739
|
-
|
740
|
-
if (typeof type === 'function') {
|
741
|
-
{
|
742
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
743
|
-
}
|
744
|
-
}
|
745
|
-
|
746
|
-
if (typeof type === 'string') {
|
747
|
-
return describeBuiltInComponentFrame(type);
|
748
|
-
}
|
749
|
-
|
750
|
-
switch (type) {
|
751
|
-
case REACT_SUSPENSE_TYPE:
|
752
|
-
return describeBuiltInComponentFrame('Suspense');
|
753
|
-
|
754
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
755
|
-
return describeBuiltInComponentFrame('SuspenseList');
|
756
|
-
}
|
757
|
-
|
758
|
-
if (typeof type === 'object') {
|
759
|
-
switch (type.$$typeof) {
|
760
|
-
case REACT_FORWARD_REF_TYPE:
|
761
|
-
return describeFunctionComponentFrame(type.render);
|
762
|
-
|
763
|
-
case REACT_MEMO_TYPE:
|
764
|
-
// Memo may contain any component type so we recursively resolve it.
|
765
|
-
return describeUnknownElementTypeFrameInDEV(type.type);
|
766
|
-
|
767
|
-
case REACT_LAZY_TYPE:
|
768
|
-
{
|
769
|
-
var lazyComponent = type;
|
770
|
-
var payload = lazyComponent._payload;
|
771
|
-
var init = lazyComponent._init;
|
772
|
-
|
773
|
-
try {
|
774
|
-
// Lazy may contain any component type so we recursively resolve it.
|
775
|
-
return describeUnknownElementTypeFrameInDEV(init(payload));
|
776
|
-
} catch (x) {}
|
777
|
-
}
|
778
|
-
}
|
779
|
-
}
|
780
|
-
|
781
|
-
return '';
|
782
|
-
}
|
783
|
-
|
784
|
-
var REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
|
785
|
-
|
786
|
-
function getOwner() {
|
787
|
-
{
|
788
|
-
var dispatcher = ReactSharedInternals.A;
|
789
|
-
|
790
|
-
if (dispatcher === null) {
|
791
|
-
return null;
|
792
|
-
}
|
793
|
-
|
794
|
-
return dispatcher.getOwner();
|
795
|
-
}
|
796
|
-
}
|
797
|
-
|
798
|
-
var specialPropKeyWarningShown;
|
799
|
-
var didWarnAboutElementRef;
|
800
|
-
var didWarnAboutOldJSXRuntime;
|
801
|
-
|
802
|
-
{
|
803
|
-
didWarnAboutElementRef = {};
|
804
|
-
}
|
805
|
-
|
806
|
-
function hasValidRef(config) {
|
807
|
-
{
|
808
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
809
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
810
|
-
|
811
|
-
if (getter && getter.isReactWarning) {
|
812
|
-
return false;
|
813
|
-
}
|
814
|
-
}
|
815
|
-
}
|
816
|
-
|
817
|
-
return config.ref !== undefined;
|
818
|
-
}
|
819
|
-
|
820
|
-
function hasValidKey(config) {
|
821
|
-
{
|
822
|
-
if (hasOwnProperty.call(config, 'key')) {
|
823
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
824
|
-
|
825
|
-
if (getter && getter.isReactWarning) {
|
826
|
-
return false;
|
827
|
-
}
|
828
|
-
}
|
829
|
-
}
|
830
|
-
|
831
|
-
return config.key !== undefined;
|
832
|
-
}
|
833
|
-
|
834
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
835
|
-
{
|
836
|
-
var warnAboutAccessingKey = function () {
|
837
|
-
if (!specialPropKeyWarningShown) {
|
838
|
-
specialPropKeyWarningShown = true;
|
839
|
-
|
840
|
-
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);
|
841
|
-
}
|
842
|
-
};
|
843
|
-
|
844
|
-
warnAboutAccessingKey.isReactWarning = true;
|
845
|
-
Object.defineProperty(props, 'key', {
|
846
|
-
get: warnAboutAccessingKey,
|
847
|
-
configurable: true
|
848
|
-
});
|
849
|
-
}
|
850
|
-
}
|
851
|
-
|
852
|
-
function elementRefGetterWithDeprecationWarning() {
|
853
|
-
{
|
854
|
-
var componentName = getComponentNameFromType(this.type);
|
855
|
-
|
856
|
-
if (!didWarnAboutElementRef[componentName]) {
|
857
|
-
didWarnAboutElementRef[componentName] = true;
|
858
|
-
|
859
|
-
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.');
|
860
|
-
} // An undefined `element.ref` is coerced to `null` for
|
861
|
-
// backwards compatibility.
|
862
|
-
|
863
|
-
|
864
|
-
var refProp = this.props.ref;
|
865
|
-
return refProp !== undefined ? refProp : null;
|
866
|
-
}
|
867
|
-
}
|
868
|
-
/**
|
869
|
-
* Factory method to create a new React element. This no longer adheres to
|
870
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
871
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.transitional.element') to check
|
872
|
-
* if something is a React Element.
|
873
|
-
*
|
874
|
-
* @param {*} type
|
875
|
-
* @param {*} props
|
876
|
-
* @param {*} key
|
877
|
-
* @param {string|object} ref
|
878
|
-
* @param {*} owner
|
879
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
880
|
-
* different from the `owner` when React.createElement is called, so that we
|
881
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
882
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
883
|
-
* change in behavior.
|
884
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
885
|
-
* indicating filename, line number, and/or other information.
|
886
|
-
* @internal
|
887
|
-
*/
|
888
|
-
|
889
|
-
|
890
|
-
function ReactElement(type, key, _ref, self, source, owner, props, debugStack, debugTask) {
|
891
|
-
var ref;
|
892
|
-
|
893
|
-
{
|
894
|
-
// When enableRefAsProp is on, ignore whatever was passed as the ref
|
895
|
-
// argument and treat `props.ref` as the source of truth. The only thing we
|
896
|
-
// use this for is `element.ref`, which will log a deprecation warning on
|
897
|
-
// access. In the next release, we can remove `element.ref` as well as the
|
898
|
-
// `ref` argument.
|
899
|
-
var refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
900
|
-
// backwards compatibility.
|
901
|
-
|
902
|
-
ref = refProp !== undefined ? refProp : null;
|
903
|
-
}
|
904
|
-
|
905
|
-
var element;
|
906
|
-
|
907
|
-
{
|
908
|
-
// In dev, make `ref` a non-enumerable property with a warning. It's non-
|
909
|
-
// enumerable so that test matchers and serializers don't access it and
|
910
|
-
// trigger the warning.
|
911
|
-
//
|
912
|
-
// `ref` will be removed from the element completely in a future release.
|
913
|
-
element = {
|
914
|
-
// This tag allows us to uniquely identify this as a React Element
|
915
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
916
|
-
// Built-in properties that belong on the element
|
917
|
-
type: type,
|
918
|
-
key: key,
|
919
|
-
props: props,
|
920
|
-
// Record the component responsible for creating this element.
|
921
|
-
_owner: owner
|
922
|
-
};
|
923
|
-
|
924
|
-
if (ref !== null) {
|
925
|
-
Object.defineProperty(element, 'ref', {
|
926
|
-
enumerable: false,
|
927
|
-
get: elementRefGetterWithDeprecationWarning
|
928
|
-
});
|
929
|
-
} else {
|
930
|
-
// Don't warn on access if a ref is not given. This reduces false
|
931
|
-
// positives in cases where a test serializer uses
|
932
|
-
// getOwnPropertyDescriptors to compare objects, like Jest does, which is
|
933
|
-
// a problem because it bypasses non-enumerability.
|
934
|
-
//
|
935
|
-
// So unfortunately this will trigger a false positive warning in Jest
|
936
|
-
// when the diff is printed:
|
937
|
-
//
|
938
|
-
// expect(<div ref={ref} />).toEqual(<span ref={ref} />);
|
939
|
-
//
|
940
|
-
// A bit sketchy, but this is what we've done for the `props.key` and
|
941
|
-
// `props.ref` accessors for years, which implies it will be good enough
|
942
|
-
// for `element.ref`, too. Let's see if anyone complains.
|
943
|
-
Object.defineProperty(element, 'ref', {
|
944
|
-
enumerable: false,
|
945
|
-
value: null
|
946
|
-
});
|
947
|
-
}
|
948
|
-
}
|
949
|
-
|
950
|
-
{
|
951
|
-
// The validation flag is currently mutative. We put it on
|
952
|
-
// an external backing store so that we can freeze the whole object.
|
953
|
-
// This can be replaced with a WeakMap once they are implemented in
|
954
|
-
// commonly used development environments.
|
955
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
956
|
-
// the validation flag non-enumerable (where possible, which should
|
957
|
-
// include every environment we run tests in), so the test framework
|
958
|
-
// ignores it.
|
959
|
-
|
960
|
-
Object.defineProperty(element._store, 'validated', {
|
961
|
-
configurable: false,
|
962
|
-
enumerable: false,
|
963
|
-
writable: true,
|
964
|
-
value: 0
|
965
|
-
}); // debugInfo contains Server Component debug information.
|
966
|
-
|
967
|
-
Object.defineProperty(element, '_debugInfo', {
|
968
|
-
configurable: false,
|
969
|
-
enumerable: false,
|
970
|
-
writable: true,
|
971
|
-
value: null
|
972
|
-
});
|
973
|
-
|
974
|
-
if (Object.freeze) {
|
975
|
-
Object.freeze(element.props);
|
976
|
-
Object.freeze(element);
|
977
|
-
}
|
978
|
-
}
|
979
|
-
|
980
|
-
return element;
|
981
|
-
}
|
982
|
-
/**
|
983
|
-
* Create and return a new ReactElement of the given type.
|
984
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
985
|
-
*/
|
986
|
-
|
987
|
-
|
988
|
-
function createElement(type, config, children) {
|
989
|
-
{
|
990
|
-
if (!isValidElementType(type)) {
|
991
|
-
// This is just an optimistic check that provides a better stack trace before
|
992
|
-
// owner stacks. It's really up to the renderer if it's a valid element type.
|
993
|
-
// When owner stacks are enabled, we instead warn in the renderer and it'll
|
994
|
-
// have the stack trace of the JSX element anyway.
|
995
|
-
//
|
996
|
-
// This is an invalid element type.
|
997
|
-
//
|
998
|
-
// We warn in this case but don't throw. We expect the element creation to
|
999
|
-
// succeed and there will likely be errors in render.
|
1000
|
-
var info = '';
|
1001
|
-
|
1002
|
-
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1003
|
-
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.";
|
1004
|
-
}
|
1005
|
-
|
1006
|
-
var typeString;
|
1007
|
-
|
1008
|
-
if (type === null) {
|
1009
|
-
typeString = 'null';
|
1010
|
-
} else if (isArray(type)) {
|
1011
|
-
typeString = 'array';
|
1012
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1013
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
1014
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
1015
|
-
} else {
|
1016
|
-
typeString = typeof type;
|
1017
|
-
}
|
1018
|
-
|
1019
|
-
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);
|
1020
|
-
} else {
|
1021
|
-
// This is a valid element type.
|
1022
|
-
// Skip key warning if the type isn't valid since our key validation logic
|
1023
|
-
// doesn't expect a non-string/function type and can throw confusing
|
1024
|
-
// errors. We don't want exception behavior to differ between dev and
|
1025
|
-
// prod. (Rendering will throw with a helpful message and as soon as the
|
1026
|
-
// type is fixed, the key warnings will appear.)
|
1027
|
-
for (var i = 2; i < arguments.length; i++) {
|
1028
|
-
validateChildKeys(arguments[i], type);
|
1029
|
-
}
|
1030
|
-
} // Unlike the jsx() runtime, createElement() doesn't warn about key spread.
|
1031
|
-
|
1032
|
-
}
|
1033
|
-
|
1034
|
-
var propName; // Reserved names are extracted
|
1035
|
-
|
1036
|
-
var props = {};
|
1037
|
-
var key = null;
|
1038
|
-
var ref = null;
|
1039
|
-
|
1040
|
-
if (config != null) {
|
1041
|
-
{
|
1042
|
-
if (!didWarnAboutOldJSXRuntime && '__self' in config && // Do not assume this is the result of an oudated JSX transform if key
|
1043
|
-
// is present, because the modern JSX transform sometimes outputs
|
1044
|
-
// createElement to preserve precedence between a static key and a
|
1045
|
-
// spread key. To avoid false positive warnings, we never warn if
|
1046
|
-
// there's a key.
|
1047
|
-
!('key' in config)) {
|
1048
|
-
didWarnAboutOldJSXRuntime = true;
|
1049
|
-
|
1050
|
-
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');
|
1051
|
-
}
|
1052
|
-
}
|
1053
|
-
|
1054
|
-
if (hasValidRef(config)) ;
|
1055
|
-
|
1056
|
-
if (hasValidKey(config)) {
|
1057
|
-
{
|
1058
|
-
checkKeyStringCoercion(config.key);
|
1059
|
-
}
|
1060
|
-
|
1061
|
-
key = '' + config.key;
|
1062
|
-
} // Remaining properties are added to a new props object
|
1063
|
-
|
1064
|
-
|
1065
|
-
for (propName in config) {
|
1066
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1067
|
-
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
1068
|
-
// them to appear as props, so in createElement we filter them out.
|
1069
|
-
// We don't have to do this in the jsx() runtime because the jsx()
|
1070
|
-
// transform never passed these as props; it used separate arguments.
|
1071
|
-
propName !== '__self' && propName !== '__source') {
|
1072
|
-
{
|
1073
|
-
props[propName] = config[propName];
|
1074
|
-
}
|
1075
|
-
}
|
1076
|
-
}
|
1077
|
-
} // Children can be more than one argument, and those are transferred onto
|
1078
|
-
// the newly allocated props object.
|
1079
|
-
|
1080
|
-
|
1081
|
-
var childrenLength = arguments.length - 2;
|
1082
|
-
|
1083
|
-
if (childrenLength === 1) {
|
1084
|
-
props.children = children;
|
1085
|
-
} else if (childrenLength > 1) {
|
1086
|
-
var childArray = Array(childrenLength);
|
1087
|
-
|
1088
|
-
for (var _i = 0; _i < childrenLength; _i++) {
|
1089
|
-
childArray[_i] = arguments[_i + 2];
|
1090
|
-
}
|
1091
|
-
|
1092
|
-
{
|
1093
|
-
if (Object.freeze) {
|
1094
|
-
Object.freeze(childArray);
|
1095
|
-
}
|
1096
|
-
}
|
1097
|
-
|
1098
|
-
props.children = childArray;
|
1099
|
-
} // Resolve default props
|
1100
|
-
|
1101
|
-
|
1102
|
-
if (type && type.defaultProps) {
|
1103
|
-
var defaultProps = type.defaultProps;
|
1104
|
-
|
1105
|
-
for (propName in defaultProps) {
|
1106
|
-
if (props[propName] === undefined) {
|
1107
|
-
props[propName] = defaultProps[propName];
|
1108
|
-
}
|
1109
|
-
}
|
1110
|
-
}
|
1111
|
-
|
1112
|
-
{
|
1113
|
-
if (key || !enableRefAsProp ) {
|
1114
|
-
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
1115
|
-
|
1116
|
-
if (key) {
|
1117
|
-
defineKeyPropWarningGetter(props, displayName);
|
1118
|
-
}
|
1119
|
-
}
|
1120
|
-
}
|
1121
|
-
|
1122
|
-
return ReactElement(type, key, ref, undefined, undefined, getOwner(), props);
|
1123
|
-
}
|
1124
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
1125
|
-
var clonedElement = ReactElement(oldElement.type, newKey, // When enableRefAsProp is on, this argument is ignored. This check only
|
1126
|
-
// exists to avoid the `ref` access warning.
|
1127
|
-
null , undefined, undefined, oldElement._owner, oldElement.props);
|
1128
|
-
|
1129
|
-
{
|
1130
|
-
// The cloned element should inherit the original element's key validation.
|
1131
|
-
clonedElement._store.validated = oldElement._store.validated;
|
1132
|
-
}
|
1133
|
-
|
1134
|
-
return clonedElement;
|
1135
|
-
}
|
1136
|
-
/**
|
1137
|
-
* Clone and return a new ReactElement using element as the starting point.
|
1138
|
-
* See https://reactjs.org/docs/react-api.html#cloneelement
|
1139
|
-
*/
|
1140
|
-
|
1141
|
-
function cloneElement(element, config, children) {
|
1142
|
-
if (element === null || element === undefined) {
|
1143
|
-
throw new Error("The argument must be a React element, but you passed " + element + ".");
|
1144
|
-
}
|
1145
|
-
|
1146
|
-
var propName; // Original props are copied
|
1147
|
-
|
1148
|
-
var props = assign({}, element.props); // Reserved names are extracted
|
1149
|
-
|
1150
|
-
var key = element.key;
|
1151
|
-
var ref = null ; // Owner will be preserved, unless ref is overridden
|
1152
|
-
|
1153
|
-
var owner = element._owner;
|
1154
|
-
|
1155
|
-
if (config != null) {
|
1156
|
-
if (hasValidRef(config)) {
|
1157
|
-
owner = getOwner() ;
|
11
|
+
"use strict";
|
12
|
+
"production" !== process.env.NODE_ENV &&
|
13
|
+
(function () {
|
14
|
+
function getIteratorFn(maybeIterable) {
|
15
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
16
|
+
return null;
|
17
|
+
maybeIterable =
|
18
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
19
|
+
maybeIterable["@@iterator"];
|
20
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
1158
21
|
}
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
for (propName in config) {
|
1169
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
1170
|
-
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
1171
|
-
// warnings and debug information in dev. Need to decide if we're OK
|
1172
|
-
// with dropping them. In the jsx() runtime it's not an issue because
|
1173
|
-
// the data gets passed as separate arguments instead of props, but
|
1174
|
-
// it would be nice to stop relying on them entirely so we can drop
|
1175
|
-
// them from the internal Fiber field.
|
1176
|
-
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
1177
|
-
// if the property were missing. This is mostly for
|
1178
|
-
// backwards compatibility.
|
1179
|
-
!(propName === 'ref' && config.ref === undefined)) {
|
1180
|
-
{
|
1181
|
-
{
|
1182
|
-
props[propName] = config[propName];
|
1183
|
-
}
|
1184
|
-
}
|
1185
|
-
}
|
1186
|
-
}
|
1187
|
-
} // Children can be more than one argument, and those are transferred onto
|
1188
|
-
// the newly allocated props object.
|
1189
|
-
|
1190
|
-
|
1191
|
-
var childrenLength = arguments.length - 2;
|
1192
|
-
|
1193
|
-
if (childrenLength === 1) {
|
1194
|
-
props.children = children;
|
1195
|
-
} else if (childrenLength > 1) {
|
1196
|
-
var childArray = Array(childrenLength);
|
1197
|
-
|
1198
|
-
for (var i = 0; i < childrenLength; i++) {
|
1199
|
-
childArray[i] = arguments[i + 2];
|
1200
|
-
}
|
1201
|
-
|
1202
|
-
props.children = childArray;
|
1203
|
-
}
|
1204
|
-
|
1205
|
-
var clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
|
1206
|
-
|
1207
|
-
for (var _i2 = 2; _i2 < arguments.length; _i2++) {
|
1208
|
-
validateChildKeys(arguments[_i2], clonedElement.type);
|
1209
|
-
}
|
1210
|
-
|
1211
|
-
return clonedElement;
|
1212
|
-
}
|
1213
|
-
/**
|
1214
|
-
* Ensure that every element either is passed in a static location, in an
|
1215
|
-
* array with an explicit keys property defined, or in an object literal
|
1216
|
-
* with valid key property.
|
1217
|
-
*
|
1218
|
-
* @internal
|
1219
|
-
* @param {ReactNode} node Statically passed child of any type.
|
1220
|
-
* @param {*} parentType node's parent's type.
|
1221
|
-
*/
|
1222
|
-
|
1223
|
-
function validateChildKeys(node, parentType) {
|
1224
|
-
{
|
1225
|
-
if (typeof node !== 'object' || !node) {
|
1226
|
-
return;
|
1227
|
-
}
|
1228
|
-
|
1229
|
-
if (node.$$typeof === REACT_CLIENT_REFERENCE) ; else if (isArray(node)) {
|
1230
|
-
for (var i = 0; i < node.length; i++) {
|
1231
|
-
var child = node[i];
|
1232
|
-
|
1233
|
-
if (isValidElement(child)) {
|
1234
|
-
validateExplicitKey(child, parentType);
|
1235
|
-
}
|
1236
|
-
}
|
1237
|
-
} else if (isValidElement(node)) {
|
1238
|
-
// This element was passed in a valid location.
|
1239
|
-
if (node._store) {
|
1240
|
-
node._store.validated = 1;
|
1241
|
-
}
|
1242
|
-
} else {
|
1243
|
-
var iteratorFn = getIteratorFn(node);
|
1244
|
-
|
1245
|
-
if (typeof iteratorFn === 'function') {
|
1246
|
-
// Entry iterators used to provide implicit keys,
|
1247
|
-
// but now we print a separate warning for them later.
|
1248
|
-
if (iteratorFn !== node.entries) {
|
1249
|
-
var iterator = iteratorFn.call(node);
|
1250
|
-
|
1251
|
-
if (iterator !== node) {
|
1252
|
-
var step;
|
1253
|
-
|
1254
|
-
while (!(step = iterator.next()).done) {
|
1255
|
-
if (isValidElement(step.value)) {
|
1256
|
-
validateExplicitKey(step.value, parentType);
|
1257
|
-
}
|
1258
|
-
}
|
1259
|
-
}
|
1260
|
-
}
|
1261
|
-
}
|
1262
|
-
}
|
1263
|
-
}
|
1264
|
-
}
|
1265
|
-
/**
|
1266
|
-
* Verifies the object is a ReactElement.
|
1267
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
1268
|
-
* @param {?object} object
|
1269
|
-
* @return {boolean} True if `object` is a ReactElement.
|
1270
|
-
* @final
|
1271
|
-
*/
|
1272
|
-
|
1273
|
-
|
1274
|
-
function isValidElement(object) {
|
1275
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
1276
|
-
}
|
1277
|
-
var ownerHasKeyUseWarning = {};
|
1278
|
-
/**
|
1279
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
1280
|
-
* This element is in an array. The array could grow and shrink or be
|
1281
|
-
* reordered. All children that haven't already been validated are required to
|
1282
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
1283
|
-
* will only be shown once.
|
1284
|
-
*
|
1285
|
-
* @internal
|
1286
|
-
* @param {ReactElement} element Element that requires a key.
|
1287
|
-
* @param {*} parentType element's parent's type.
|
1288
|
-
*/
|
1289
|
-
|
1290
|
-
function validateExplicitKey(element, parentType) {
|
1291
|
-
|
1292
|
-
{
|
1293
|
-
if (!element._store || element._store.validated || element.key != null) {
|
1294
|
-
return;
|
1295
|
-
}
|
1296
|
-
|
1297
|
-
element._store.validated = 1;
|
1298
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
1299
|
-
|
1300
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
1301
|
-
return;
|
1302
|
-
}
|
1303
|
-
|
1304
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
1305
|
-
// property, it may be the creator of the child that's responsible for
|
1306
|
-
// assigning it a key.
|
1307
|
-
|
1308
|
-
var childOwner = '';
|
1309
|
-
|
1310
|
-
if (element && element._owner != null && element._owner !== getOwner()) {
|
1311
|
-
var ownerName = null;
|
1312
|
-
|
1313
|
-
if (typeof element._owner.tag === 'number') {
|
1314
|
-
ownerName = getComponentNameFromType(element._owner.type);
|
1315
|
-
} else if (typeof element._owner.name === 'string') {
|
1316
|
-
ownerName = element._owner.name;
|
1317
|
-
} // Give the component that originally created this child.
|
1318
|
-
|
1319
|
-
|
1320
|
-
childOwner = " It was passed a child from " + ownerName + ".";
|
1321
|
-
}
|
1322
|
-
|
1323
|
-
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
1324
|
-
|
1325
|
-
ReactSharedInternals.getCurrentStack = function () {
|
1326
|
-
|
1327
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type); // Delegate to the injected renderer-specific implementation
|
1328
|
-
|
1329
|
-
if (prevGetCurrentStack) {
|
1330
|
-
stack += prevGetCurrentStack() || '';
|
22
|
+
function testStringCoercion(value) {
|
23
|
+
return "" + value;
|
24
|
+
}
|
25
|
+
function checkKeyStringCoercion(value) {
|
26
|
+
try {
|
27
|
+
testStringCoercion(value);
|
28
|
+
var JSCompiler_inline_result = !1;
|
29
|
+
} catch (e) {
|
30
|
+
JSCompiler_inline_result = !0;
|
1331
31
|
}
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
if (owner) {
|
1348
|
-
var name = getComponentNameFromType(owner.type);
|
1349
|
-
|
1350
|
-
if (name) {
|
1351
|
-
info = '\n\nCheck the render method of `' + name + '`.';
|
32
|
+
if (JSCompiler_inline_result) {
|
33
|
+
JSCompiler_inline_result = console;
|
34
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
35
|
+
var JSCompiler_inline_result$jscomp$0 =
|
36
|
+
("function" === typeof Symbol &&
|
37
|
+
Symbol.toStringTag &&
|
38
|
+
value[Symbol.toStringTag]) ||
|
39
|
+
value.constructor.name ||
|
40
|
+
"Object";
|
41
|
+
JSCompiler_temp_const.call(
|
42
|
+
JSCompiler_inline_result,
|
43
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
44
|
+
JSCompiler_inline_result$jscomp$0
|
45
|
+
);
|
46
|
+
return testStringCoercion(value);
|
1352
47
|
}
|
1353
48
|
}
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
49
|
+
function getComponentNameFromType(type) {
|
50
|
+
if (null == type) return null;
|
51
|
+
if ("function" === typeof type)
|
52
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE$2
|
53
|
+
? null
|
54
|
+
: type.displayName || type.name || null;
|
55
|
+
if ("string" === typeof type) return type;
|
56
|
+
switch (type) {
|
57
|
+
case REACT_FRAGMENT_TYPE:
|
58
|
+
return "Fragment";
|
59
|
+
case REACT_PORTAL_TYPE:
|
60
|
+
return "Portal";
|
61
|
+
case REACT_PROFILER_TYPE:
|
62
|
+
return "Profiler";
|
63
|
+
case REACT_STRICT_MODE_TYPE:
|
64
|
+
return "StrictMode";
|
65
|
+
case REACT_SUSPENSE_TYPE:
|
66
|
+
return "Suspense";
|
67
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
68
|
+
return "SuspenseList";
|
1360
69
|
}
|
70
|
+
if ("object" === typeof type)
|
71
|
+
switch (
|
72
|
+
("number" === typeof type.tag &&
|
73
|
+
console.error(
|
74
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
75
|
+
),
|
76
|
+
type.$$typeof)
|
77
|
+
) {
|
78
|
+
case REACT_CONTEXT_TYPE:
|
79
|
+
return (type.displayName || "Context") + ".Provider";
|
80
|
+
case REACT_CONSUMER_TYPE:
|
81
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
82
|
+
case REACT_FORWARD_REF_TYPE:
|
83
|
+
var innerType = type.render;
|
84
|
+
type = type.displayName;
|
85
|
+
type ||
|
86
|
+
((type = innerType.displayName || innerType.name || ""),
|
87
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
88
|
+
return type;
|
89
|
+
case REACT_MEMO_TYPE:
|
90
|
+
return (
|
91
|
+
(innerType = type.displayName || null),
|
92
|
+
null !== innerType
|
93
|
+
? innerType
|
94
|
+
: getComponentNameFromType(type.type) || "Memo"
|
95
|
+
);
|
96
|
+
case REACT_LAZY_TYPE:
|
97
|
+
innerType = type._payload;
|
98
|
+
type = type._init;
|
99
|
+
try {
|
100
|
+
return getComponentNameFromType(type(innerType));
|
101
|
+
} catch (x) {}
|
102
|
+
}
|
103
|
+
return null;
|
1361
104
|
}
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
var escapedString = key.replace(escapeRegex, function (match) {
|
1383
|
-
return escaperLookup[match];
|
1384
|
-
});
|
1385
|
-
return '$' + escapedString;
|
1386
|
-
}
|
1387
|
-
/**
|
1388
|
-
* TODO: Test that a single child and an array with one item have the same key
|
1389
|
-
* pattern.
|
1390
|
-
*/
|
1391
|
-
|
1392
|
-
|
1393
|
-
var didWarnAboutMaps = false;
|
1394
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
1395
|
-
|
1396
|
-
function escapeUserProvidedKey(text) {
|
1397
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
1398
|
-
}
|
1399
|
-
/**
|
1400
|
-
* Generate a key string that identifies a element within a set.
|
1401
|
-
*
|
1402
|
-
* @param {*} element A element that could contain a manual key.
|
1403
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
1404
|
-
* @return {string}
|
1405
|
-
*/
|
1406
|
-
|
1407
|
-
|
1408
|
-
function getElementKey(element, index) {
|
1409
|
-
// Do some typechecking here since we call this blindly. We want to ensure
|
1410
|
-
// that we don't block potential future ES APIs.
|
1411
|
-
if (typeof element === 'object' && element !== null && element.key != null) {
|
1412
|
-
// Explicit key
|
1413
|
-
{
|
1414
|
-
checkKeyStringCoercion(element.key);
|
105
|
+
function isValidElementType(type) {
|
106
|
+
return "string" === typeof type ||
|
107
|
+
"function" === typeof type ||
|
108
|
+
type === REACT_FRAGMENT_TYPE ||
|
109
|
+
type === REACT_PROFILER_TYPE ||
|
110
|
+
type === REACT_STRICT_MODE_TYPE ||
|
111
|
+
type === REACT_SUSPENSE_TYPE ||
|
112
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
113
|
+
type === REACT_OFFSCREEN_TYPE ||
|
114
|
+
("object" === typeof type &&
|
115
|
+
null !== type &&
|
116
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
117
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
118
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
119
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
120
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
121
|
+
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
|
122
|
+
void 0 !== type.getModuleId))
|
123
|
+
? !0
|
124
|
+
: !1;
|
1415
125
|
}
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
126
|
+
function disabledLog() {}
|
127
|
+
function disableLogs() {
|
128
|
+
if (0 === disabledDepth) {
|
129
|
+
prevLog = console.log;
|
130
|
+
prevInfo = console.info;
|
131
|
+
prevWarn = console.warn;
|
132
|
+
prevError = console.error;
|
133
|
+
prevGroup = console.group;
|
134
|
+
prevGroupCollapsed = console.groupCollapsed;
|
135
|
+
prevGroupEnd = console.groupEnd;
|
136
|
+
var props = {
|
137
|
+
configurable: !0,
|
138
|
+
enumerable: !0,
|
139
|
+
value: disabledLog,
|
140
|
+
writable: !0
|
141
|
+
};
|
142
|
+
Object.defineProperties(console, {
|
143
|
+
info: props,
|
144
|
+
log: props,
|
145
|
+
warn: props,
|
146
|
+
error: props,
|
147
|
+
group: props,
|
148
|
+
groupCollapsed: props,
|
149
|
+
groupEnd: props
|
150
|
+
});
|
1432
151
|
}
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
152
|
+
disabledDepth++;
|
153
|
+
}
|
154
|
+
function reenableLogs() {
|
155
|
+
disabledDepth--;
|
156
|
+
if (0 === disabledDepth) {
|
157
|
+
var props = { configurable: !0, enumerable: !0, writable: !0 };
|
158
|
+
Object.defineProperties(console, {
|
159
|
+
log: assign({}, props, { value: prevLog }),
|
160
|
+
info: assign({}, props, { value: prevInfo }),
|
161
|
+
warn: assign({}, props, { value: prevWarn }),
|
162
|
+
error: assign({}, props, { value: prevError }),
|
163
|
+
group: assign({}, props, { value: prevGroup }),
|
164
|
+
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
165
|
+
groupEnd: assign({}, props, { value: prevGroupEnd })
|
166
|
+
});
|
1438
167
|
}
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
168
|
+
0 > disabledDepth &&
|
169
|
+
console.error(
|
170
|
+
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
171
|
+
);
|
172
|
+
}
|
173
|
+
function describeBuiltInComponentFrame(name) {
|
174
|
+
if (void 0 === prefix)
|
175
|
+
try {
|
176
|
+
throw Error();
|
177
|
+
} catch (x) {
|
178
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
179
|
+
prefix = (match && match[1]) || "";
|
180
|
+
suffix =
|
181
|
+
-1 < x.stack.indexOf("\n at")
|
182
|
+
? " (<anonymous>)"
|
183
|
+
: -1 < x.stack.indexOf("@")
|
184
|
+
? "@unknown:0:0"
|
185
|
+
: "";
|
186
|
+
}
|
187
|
+
return "\n" + prefix + name + suffix;
|
188
|
+
}
|
189
|
+
function describeNativeComponentFrame(fn, construct) {
|
190
|
+
if (!fn || reentry) return "";
|
191
|
+
var frame = componentFrameCache.get(fn);
|
192
|
+
if (void 0 !== frame) return frame;
|
193
|
+
reentry = !0;
|
194
|
+
frame = Error.prepareStackTrace;
|
195
|
+
Error.prepareStackTrace = void 0;
|
196
|
+
var previousDispatcher = null;
|
197
|
+
previousDispatcher = ReactSharedInternals.H;
|
198
|
+
ReactSharedInternals.H = null;
|
199
|
+
disableLogs();
|
200
|
+
try {
|
201
|
+
var RunInRootFrame = {
|
202
|
+
DetermineComponentFrameRoot: function () {
|
203
|
+
try {
|
204
|
+
if (construct) {
|
205
|
+
var Fake = function () {
|
206
|
+
throw Error();
|
207
|
+
};
|
208
|
+
Object.defineProperty(Fake.prototype, "props", {
|
209
|
+
set: function () {
|
210
|
+
throw Error();
|
211
|
+
}
|
212
|
+
});
|
213
|
+
if ("object" === typeof Reflect && Reflect.construct) {
|
214
|
+
try {
|
215
|
+
Reflect.construct(Fake, []);
|
216
|
+
} catch (x) {
|
217
|
+
var control = x;
|
218
|
+
}
|
219
|
+
Reflect.construct(fn, [], Fake);
|
220
|
+
} else {
|
221
|
+
try {
|
222
|
+
Fake.call();
|
223
|
+
} catch (x$0) {
|
224
|
+
control = x$0;
|
225
|
+
}
|
226
|
+
fn.call(Fake.prototype);
|
227
|
+
}
|
228
|
+
} else {
|
229
|
+
try {
|
230
|
+
throw Error();
|
231
|
+
} catch (x$1) {
|
232
|
+
control = x$1;
|
233
|
+
}
|
234
|
+
(Fake = fn()) &&
|
235
|
+
"function" === typeof Fake.catch &&
|
236
|
+
Fake.catch(function () {});
|
237
|
+
}
|
238
|
+
} catch (sample) {
|
239
|
+
if (sample && control && "string" === typeof sample.stack)
|
240
|
+
return [sample.stack, control.stack];
|
1475
241
|
}
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
242
|
+
return [null, null];
|
243
|
+
}
|
244
|
+
};
|
245
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
246
|
+
"DetermineComponentFrameRoot";
|
247
|
+
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
248
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
249
|
+
"name"
|
250
|
+
);
|
251
|
+
namePropDescriptor &&
|
252
|
+
namePropDescriptor.configurable &&
|
253
|
+
Object.defineProperty(
|
254
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
255
|
+
"name",
|
256
|
+
{ value: "DetermineComponentFrameRoot" }
|
257
|
+
);
|
258
|
+
var _RunInRootFrame$Deter =
|
259
|
+
RunInRootFrame.DetermineComponentFrameRoot(),
|
260
|
+
sampleStack = _RunInRootFrame$Deter[0],
|
261
|
+
controlStack = _RunInRootFrame$Deter[1];
|
262
|
+
if (sampleStack && controlStack) {
|
263
|
+
var sampleLines = sampleStack.split("\n"),
|
264
|
+
controlLines = controlStack.split("\n");
|
265
|
+
for (
|
266
|
+
_RunInRootFrame$Deter = namePropDescriptor = 0;
|
267
|
+
namePropDescriptor < sampleLines.length &&
|
268
|
+
!sampleLines[namePropDescriptor].includes(
|
269
|
+
"DetermineComponentFrameRoot"
|
270
|
+
);
|
271
|
+
|
272
|
+
)
|
273
|
+
namePropDescriptor++;
|
274
|
+
for (
|
275
|
+
;
|
276
|
+
_RunInRootFrame$Deter < controlLines.length &&
|
277
|
+
!controlLines[_RunInRootFrame$Deter].includes(
|
278
|
+
"DetermineComponentFrameRoot"
|
279
|
+
);
|
280
|
+
|
281
|
+
)
|
282
|
+
_RunInRootFrame$Deter++;
|
283
|
+
if (
|
284
|
+
namePropDescriptor === sampleLines.length ||
|
285
|
+
_RunInRootFrame$Deter === controlLines.length
|
286
|
+
)
|
287
|
+
for (
|
288
|
+
namePropDescriptor = sampleLines.length - 1,
|
289
|
+
_RunInRootFrame$Deter = controlLines.length - 1;
|
290
|
+
1 <= namePropDescriptor &&
|
291
|
+
0 <= _RunInRootFrame$Deter &&
|
292
|
+
sampleLines[namePropDescriptor] !==
|
293
|
+
controlLines[_RunInRootFrame$Deter];
|
294
|
+
|
295
|
+
)
|
296
|
+
_RunInRootFrame$Deter--;
|
297
|
+
for (
|
298
|
+
;
|
299
|
+
1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
|
300
|
+
namePropDescriptor--, _RunInRootFrame$Deter--
|
301
|
+
)
|
302
|
+
if (
|
303
|
+
sampleLines[namePropDescriptor] !==
|
304
|
+
controlLines[_RunInRootFrame$Deter]
|
305
|
+
) {
|
306
|
+
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
|
307
|
+
do
|
308
|
+
if (
|
309
|
+
(namePropDescriptor--,
|
310
|
+
_RunInRootFrame$Deter--,
|
311
|
+
0 > _RunInRootFrame$Deter ||
|
312
|
+
sampleLines[namePropDescriptor] !==
|
313
|
+
controlLines[_RunInRootFrame$Deter])
|
314
|
+
) {
|
315
|
+
var _frame =
|
316
|
+
"\n" +
|
317
|
+
sampleLines[namePropDescriptor].replace(
|
318
|
+
" at new ",
|
319
|
+
" at "
|
320
|
+
);
|
321
|
+
fn.displayName &&
|
322
|
+
_frame.includes("<anonymous>") &&
|
323
|
+
(_frame = _frame.replace("<anonymous>", fn.displayName));
|
324
|
+
"function" === typeof fn &&
|
325
|
+
componentFrameCache.set(fn, _frame);
|
326
|
+
return _frame;
|
327
|
+
}
|
328
|
+
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
|
329
|
+
}
|
330
|
+
break;
|
1482
331
|
}
|
1483
332
|
}
|
333
|
+
} finally {
|
334
|
+
(reentry = !1),
|
335
|
+
(ReactSharedInternals.H = previousDispatcher),
|
336
|
+
reenableLogs(),
|
337
|
+
(Error.prepareStackTrace = frame);
|
1484
338
|
}
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
case REACT_PORTAL_TYPE:
|
1514
|
-
invokeCallback = true;
|
1515
|
-
break;
|
1516
|
-
|
339
|
+
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
|
340
|
+
? describeBuiltInComponentFrame(sampleLines)
|
341
|
+
: "";
|
342
|
+
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
343
|
+
return sampleLines;
|
344
|
+
}
|
345
|
+
function describeUnknownElementTypeFrameInDEV(type) {
|
346
|
+
if (null == type) return "";
|
347
|
+
if ("function" === typeof type) {
|
348
|
+
var prototype = type.prototype;
|
349
|
+
return describeNativeComponentFrame(
|
350
|
+
type,
|
351
|
+
!(!prototype || !prototype.isReactComponent)
|
352
|
+
);
|
353
|
+
}
|
354
|
+
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
355
|
+
switch (type) {
|
356
|
+
case REACT_SUSPENSE_TYPE:
|
357
|
+
return describeBuiltInComponentFrame("Suspense");
|
358
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
359
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
360
|
+
}
|
361
|
+
if ("object" === typeof type)
|
362
|
+
switch (type.$$typeof) {
|
363
|
+
case REACT_FORWARD_REF_TYPE:
|
364
|
+
return (type = describeNativeComponentFrame(type.render, !1)), type;
|
365
|
+
case REACT_MEMO_TYPE:
|
366
|
+
return describeUnknownElementTypeFrameInDEV(type.type);
|
1517
367
|
case REACT_LAZY_TYPE:
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
368
|
+
prototype = type._payload;
|
369
|
+
type = type._init;
|
370
|
+
try {
|
371
|
+
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
372
|
+
} catch (x) {}
|
1521
373
|
}
|
1522
|
-
|
374
|
+
return "";
|
1523
375
|
}
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
if (isArray(mappedChild)) {
|
1534
|
-
var escapedChildKey = '';
|
1535
|
-
|
1536
|
-
if (childKey != null) {
|
1537
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
376
|
+
function getOwner() {
|
377
|
+
var dispatcher = ReactSharedInternals.A;
|
378
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
379
|
+
}
|
380
|
+
function hasValidKey(config) {
|
381
|
+
if (hasOwnProperty.call(config, "key")) {
|
382
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
383
|
+
if (getter && getter.isReactWarning) return !1;
|
1538
384
|
}
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
if (mappedChild.key != null) {
|
1550
|
-
if (!_child || _child.key !== mappedChild.key) {
|
1551
|
-
checkKeyStringCoercion(mappedChild.key);
|
1552
|
-
}
|
1553
|
-
}
|
1554
|
-
}
|
1555
|
-
|
1556
|
-
var newChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
1557
|
-
// traverseAllChildren used to do for objects as children
|
1558
|
-
escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
|
1559
|
-
mappedChild.key != null && (!_child || _child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
|
1560
|
-
'' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
|
1561
|
-
) + '/' : '') + childKey);
|
1562
|
-
|
1563
|
-
{
|
1564
|
-
// If `child` was an element without a `key`, we need to validate if
|
1565
|
-
// it should have had a `key`, before assigning one to `mappedChild`.
|
1566
|
-
// $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
|
1567
|
-
if (nameSoFar !== '' && _child != null && isValidElement(_child) && _child.key == null) {
|
1568
|
-
// We check truthiness of `child._store.validated` instead of being
|
1569
|
-
// inequal to `1` to provide a bit of backward compatibility for any
|
1570
|
-
// libraries (like `fbt`) which may be hacking this property.
|
1571
|
-
if (_child._store && !_child._store.validated) {
|
1572
|
-
// Mark this child as having failed validation, but let the actual
|
1573
|
-
// renderer print the warning later.
|
1574
|
-
newChild._store.validated = 2;
|
1575
|
-
}
|
1576
|
-
}
|
1577
|
-
}
|
1578
|
-
|
1579
|
-
mappedChild = newChild;
|
385
|
+
return void 0 !== config.key;
|
386
|
+
}
|
387
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
388
|
+
function warnAboutAccessingKey() {
|
389
|
+
specialPropKeyWarningShown ||
|
390
|
+
((specialPropKeyWarningShown = !0),
|
391
|
+
console.error(
|
392
|
+
"%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)",
|
393
|
+
displayName
|
394
|
+
));
|
1580
395
|
}
|
1581
|
-
|
1582
|
-
|
396
|
+
warnAboutAccessingKey.isReactWarning = !0;
|
397
|
+
Object.defineProperty(props, "key", {
|
398
|
+
get: warnAboutAccessingKey,
|
399
|
+
configurable: !0
|
400
|
+
});
|
1583
401
|
}
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
if (isArray(children)) {
|
1595
|
-
for (var i = 0; i < children.length; i++) {
|
1596
|
-
child = children[i];
|
1597
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
1598
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
402
|
+
function elementRefGetterWithDeprecationWarning() {
|
403
|
+
var componentName = getComponentNameFromType(this.type);
|
404
|
+
didWarnAboutElementRef[componentName] ||
|
405
|
+
((didWarnAboutElementRef[componentName] = !0),
|
406
|
+
console.error(
|
407
|
+
"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."
|
408
|
+
));
|
409
|
+
componentName = this.props.ref;
|
410
|
+
return void 0 !== componentName ? componentName : null;
|
1599
411
|
}
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
412
|
+
function ReactElement(type, key, self, source, owner, props) {
|
413
|
+
self = props.ref;
|
414
|
+
type = {
|
415
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
416
|
+
type: type,
|
417
|
+
key: key,
|
418
|
+
props: props,
|
419
|
+
_owner: owner
|
420
|
+
};
|
421
|
+
null !== (void 0 !== self ? self : null)
|
422
|
+
? Object.defineProperty(type, "ref", {
|
423
|
+
enumerable: !1,
|
424
|
+
get: elementRefGetterWithDeprecationWarning
|
425
|
+
})
|
426
|
+
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
|
427
|
+
type._store = {};
|
428
|
+
Object.defineProperty(type._store, "validated", {
|
429
|
+
configurable: !1,
|
430
|
+
enumerable: !1,
|
431
|
+
writable: !0,
|
432
|
+
value: 0
|
433
|
+
});
|
434
|
+
Object.defineProperty(type, "_debugInfo", {
|
435
|
+
configurable: !1,
|
436
|
+
enumerable: !1,
|
437
|
+
writable: !0,
|
438
|
+
value: null
|
439
|
+
});
|
440
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
441
|
+
return type;
|
442
|
+
}
|
443
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
444
|
+
newKey = ReactElement(
|
445
|
+
oldElement.type,
|
446
|
+
newKey,
|
447
|
+
void 0,
|
448
|
+
void 0,
|
449
|
+
oldElement._owner,
|
450
|
+
oldElement.props
|
451
|
+
);
|
452
|
+
newKey._store.validated = oldElement._store.validated;
|
453
|
+
return newKey;
|
454
|
+
}
|
455
|
+
function validateChildKeys(node, parentType) {
|
456
|
+
if (
|
457
|
+
"object" === typeof node &&
|
458
|
+
node &&
|
459
|
+
node.$$typeof !== REACT_CLIENT_REFERENCE
|
460
|
+
)
|
461
|
+
if (isArrayImpl(node))
|
462
|
+
for (var i = 0; i < node.length; i++) {
|
463
|
+
var child = node[i];
|
464
|
+
isValidElement(child) && validateExplicitKey(child, parentType);
|
1611
465
|
}
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
1624
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1625
|
-
}
|
1626
|
-
} else if (type === 'object') {
|
1627
|
-
if (typeof children.then === 'function') {
|
1628
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
1629
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
1630
|
-
|
1631
|
-
|
1632
|
-
var childrenString = String(children);
|
1633
|
-
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.');
|
466
|
+
else if (isValidElement(node))
|
467
|
+
node._store && (node._store.validated = 1);
|
468
|
+
else if (
|
469
|
+
((i = getIteratorFn(node)),
|
470
|
+
"function" === typeof i &&
|
471
|
+
i !== node.entries &&
|
472
|
+
((i = i.call(node)), i !== node))
|
473
|
+
)
|
474
|
+
for (; !(node = i.next()).done; )
|
475
|
+
isValidElement(node.value) &&
|
476
|
+
validateExplicitKey(node.value, parentType);
|
1634
477
|
}
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
*
|
1642
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
1643
|
-
*
|
1644
|
-
* The provided mapFunction(child, index) will be called for each
|
1645
|
-
* leaf child.
|
1646
|
-
*
|
1647
|
-
* @param {?*} children Children tree container.
|
1648
|
-
* @param {function(*, int)} func The map function.
|
1649
|
-
* @param {*} context Context for mapFunction.
|
1650
|
-
* @return {object} Object containing the ordered map of results.
|
1651
|
-
*/
|
1652
|
-
|
1653
|
-
|
1654
|
-
function mapChildren(children, func, context) {
|
1655
|
-
if (children == null) {
|
1656
|
-
// $FlowFixMe limitation refining abstract types in Flow
|
1657
|
-
return children;
|
1658
|
-
}
|
1659
|
-
|
1660
|
-
var result = [];
|
1661
|
-
var count = 0;
|
1662
|
-
mapIntoArray(children, result, '', '', function (child) {
|
1663
|
-
return func.call(context, child, count++);
|
1664
|
-
});
|
1665
|
-
return result;
|
1666
|
-
}
|
1667
|
-
/**
|
1668
|
-
* Count the number of children that are typically specified as
|
1669
|
-
* `props.children`.
|
1670
|
-
*
|
1671
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
1672
|
-
*
|
1673
|
-
* @param {?*} children Children tree container.
|
1674
|
-
* @return {number} The number of children.
|
1675
|
-
*/
|
1676
|
-
|
1677
|
-
|
1678
|
-
function countChildren(children) {
|
1679
|
-
var n = 0;
|
1680
|
-
mapChildren(children, function () {
|
1681
|
-
n++; // Don't return anything
|
1682
|
-
});
|
1683
|
-
return n;
|
1684
|
-
}
|
1685
|
-
/**
|
1686
|
-
* Iterates through children that are typically specified as `props.children`.
|
1687
|
-
*
|
1688
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
1689
|
-
*
|
1690
|
-
* The provided forEachFunc(child, index) will be called for each
|
1691
|
-
* leaf child.
|
1692
|
-
*
|
1693
|
-
* @param {?*} children Children tree container.
|
1694
|
-
* @param {function(*, int)} forEachFunc
|
1695
|
-
* @param {*} forEachContext Context for forEachContext.
|
1696
|
-
*/
|
1697
|
-
|
1698
|
-
|
1699
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
1700
|
-
mapChildren(children, // $FlowFixMe[missing-this-annot]
|
1701
|
-
function () {
|
1702
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
1703
|
-
}, forEachContext);
|
1704
|
-
}
|
1705
|
-
/**
|
1706
|
-
* Flatten a children object (typically specified as `props.children`) and
|
1707
|
-
* return an array with appropriately re-keyed children.
|
1708
|
-
*
|
1709
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
1710
|
-
*/
|
1711
|
-
|
1712
|
-
|
1713
|
-
function toArray(children) {
|
1714
|
-
return mapChildren(children, function (child) {
|
1715
|
-
return child;
|
1716
|
-
}) || [];
|
1717
|
-
}
|
1718
|
-
/**
|
1719
|
-
* Returns the first child in a collection of children and verifies that there
|
1720
|
-
* is only one child in the collection.
|
1721
|
-
*
|
1722
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
1723
|
-
*
|
1724
|
-
* The current implementation of this function assumes that a single child gets
|
1725
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
1726
|
-
* abstract away the particular structure of children.
|
1727
|
-
*
|
1728
|
-
* @param {?object} children Child collection structure.
|
1729
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
1730
|
-
* structure.
|
1731
|
-
*/
|
1732
|
-
|
1733
|
-
|
1734
|
-
function onlyChild(children) {
|
1735
|
-
if (!isValidElement(children)) {
|
1736
|
-
throw new Error('React.Children.only expected to receive a single React element child.');
|
1737
|
-
}
|
1738
|
-
|
1739
|
-
return children;
|
1740
|
-
}
|
1741
|
-
|
1742
|
-
// an immutable object with a single mutable value
|
1743
|
-
function createRef() {
|
1744
|
-
var refObject = {
|
1745
|
-
current: null
|
1746
|
-
};
|
1747
|
-
|
1748
|
-
{
|
1749
|
-
Object.seal(refObject);
|
1750
|
-
}
|
1751
|
-
|
1752
|
-
return refObject;
|
1753
|
-
}
|
1754
|
-
|
1755
|
-
function resolveDispatcher() {
|
1756
|
-
var dispatcher = ReactSharedInternals.H;
|
1757
|
-
|
1758
|
-
{
|
1759
|
-
if (dispatcher === null) {
|
1760
|
-
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.');
|
478
|
+
function isValidElement(object) {
|
479
|
+
return (
|
480
|
+
"object" === typeof object &&
|
481
|
+
null !== object &&
|
482
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
483
|
+
);
|
1761
484
|
}
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
function
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
return dispatcher.useActionState(action, initialState, permalink);
|
1796
|
-
}
|
1797
|
-
}
|
1798
|
-
|
1799
|
-
function forwardRef(render) {
|
1800
|
-
{
|
1801
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1802
|
-
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1803
|
-
} else if (typeof render !== 'function') {
|
1804
|
-
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1805
|
-
} else {
|
1806
|
-
if (render.length !== 0 && render.length !== 2) {
|
1807
|
-
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.');
|
485
|
+
function validateExplicitKey(element, parentType) {
|
486
|
+
if (
|
487
|
+
element._store &&
|
488
|
+
!element._store.validated &&
|
489
|
+
null == element.key &&
|
490
|
+
((element._store.validated = 1),
|
491
|
+
(parentType = getCurrentComponentErrorInfo(parentType)),
|
492
|
+
!ownerHasKeyUseWarning[parentType])
|
493
|
+
) {
|
494
|
+
ownerHasKeyUseWarning[parentType] = !0;
|
495
|
+
var childOwner = "";
|
496
|
+
element &&
|
497
|
+
null != element._owner &&
|
498
|
+
element._owner !== getOwner() &&
|
499
|
+
((childOwner = null),
|
500
|
+
"number" === typeof element._owner.tag
|
501
|
+
? (childOwner = getComponentNameFromType(element._owner.type))
|
502
|
+
: "string" === typeof element._owner.name &&
|
503
|
+
(childOwner = element._owner.name),
|
504
|
+
(childOwner = " It was passed a child from " + childOwner + "."));
|
505
|
+
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
506
|
+
ReactSharedInternals.getCurrentStack = function () {
|
507
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
508
|
+
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
509
|
+
return stack;
|
510
|
+
};
|
511
|
+
console.error(
|
512
|
+
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
513
|
+
parentType,
|
514
|
+
childOwner
|
515
|
+
);
|
516
|
+
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
1808
517
|
}
|
1809
518
|
}
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
519
|
+
function getCurrentComponentErrorInfo(parentType) {
|
520
|
+
var info = "",
|
521
|
+
owner = getOwner();
|
522
|
+
owner &&
|
523
|
+
(owner = getComponentNameFromType(owner.type)) &&
|
524
|
+
(info = "\n\nCheck the render method of `" + owner + "`.");
|
525
|
+
info ||
|
526
|
+
((parentType = getComponentNameFromType(parentType)) &&
|
527
|
+
(info =
|
528
|
+
"\n\nCheck the top-level render call using <" + parentType + ">."));
|
529
|
+
return info;
|
530
|
+
}
|
531
|
+
function escape(key) {
|
532
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
533
|
+
return (
|
534
|
+
"$" +
|
535
|
+
key.replace(/[=:]/g, function (match) {
|
536
|
+
return escaperLookup[match];
|
537
|
+
})
|
538
|
+
);
|
539
|
+
}
|
540
|
+
function getElementKey(element, index) {
|
541
|
+
return "object" === typeof element &&
|
542
|
+
null !== element &&
|
543
|
+
null != element.key
|
544
|
+
? (checkKeyStringCoercion(element.key), escape("" + element.key))
|
545
|
+
: index.toString(36);
|
546
|
+
}
|
547
|
+
function noop() {}
|
548
|
+
function resolveThenable(thenable) {
|
549
|
+
switch (thenable.status) {
|
550
|
+
case "fulfilled":
|
551
|
+
return thenable.value;
|
552
|
+
case "rejected":
|
553
|
+
throw thenable.reason;
|
554
|
+
default:
|
555
|
+
switch (
|
556
|
+
("string" === typeof thenable.status
|
557
|
+
? thenable.then(noop, noop)
|
558
|
+
: ((thenable.status = "pending"),
|
559
|
+
thenable.then(
|
560
|
+
function (fulfilledValue) {
|
561
|
+
"pending" === thenable.status &&
|
562
|
+
((thenable.status = "fulfilled"),
|
563
|
+
(thenable.value = fulfilledValue));
|
564
|
+
},
|
565
|
+
function (error) {
|
566
|
+
"pending" === thenable.status &&
|
567
|
+
((thenable.status = "rejected"),
|
568
|
+
(thenable.reason = error));
|
569
|
+
}
|
570
|
+
)),
|
571
|
+
thenable.status)
|
572
|
+
) {
|
573
|
+
case "fulfilled":
|
574
|
+
return thenable.value;
|
575
|
+
case "rejected":
|
576
|
+
throw thenable.reason;
|
577
|
+
}
|
1814
578
|
}
|
579
|
+
throw thenable;
|
1815
580
|
}
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
581
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
582
|
+
var type = typeof children;
|
583
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
584
|
+
var invokeCallback = !1;
|
585
|
+
if (null === children) invokeCallback = !0;
|
586
|
+
else
|
587
|
+
switch (type) {
|
588
|
+
case "bigint":
|
589
|
+
case "string":
|
590
|
+
case "number":
|
591
|
+
invokeCallback = !0;
|
592
|
+
break;
|
593
|
+
case "object":
|
594
|
+
switch (children.$$typeof) {
|
595
|
+
case REACT_ELEMENT_TYPE:
|
596
|
+
case REACT_PORTAL_TYPE:
|
597
|
+
invokeCallback = !0;
|
598
|
+
break;
|
599
|
+
case REACT_LAZY_TYPE:
|
600
|
+
return (
|
601
|
+
(invokeCallback = children._init),
|
602
|
+
mapIntoArray(
|
603
|
+
invokeCallback(children._payload),
|
604
|
+
array,
|
605
|
+
escapedPrefix,
|
606
|
+
nameSoFar,
|
607
|
+
callback
|
608
|
+
)
|
609
|
+
);
|
610
|
+
}
|
1845
611
|
}
|
612
|
+
if (invokeCallback) {
|
613
|
+
invokeCallback = children;
|
614
|
+
callback = callback(invokeCallback);
|
615
|
+
var childKey =
|
616
|
+
"" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
617
|
+
isArrayImpl(callback)
|
618
|
+
? ((escapedPrefix = ""),
|
619
|
+
null != childKey &&
|
620
|
+
(escapedPrefix =
|
621
|
+
childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
|
622
|
+
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
|
623
|
+
return c;
|
624
|
+
}))
|
625
|
+
: null != callback &&
|
626
|
+
(isValidElement(callback) &&
|
627
|
+
(null != callback.key &&
|
628
|
+
((invokeCallback && invokeCallback.key === callback.key) ||
|
629
|
+
checkKeyStringCoercion(callback.key)),
|
630
|
+
(escapedPrefix = cloneAndReplaceKey(
|
631
|
+
callback,
|
632
|
+
escapedPrefix +
|
633
|
+
(null == callback.key ||
|
634
|
+
(invokeCallback && invokeCallback.key === callback.key)
|
635
|
+
? ""
|
636
|
+
: ("" + callback.key).replace(
|
637
|
+
userProvidedKeyEscapeRegex,
|
638
|
+
"$&/"
|
639
|
+
) + "/") +
|
640
|
+
childKey
|
641
|
+
)),
|
642
|
+
"" !== nameSoFar &&
|
643
|
+
null != invokeCallback &&
|
644
|
+
isValidElement(invokeCallback) &&
|
645
|
+
null == invokeCallback.key &&
|
646
|
+
invokeCallback._store &&
|
647
|
+
!invokeCallback._store.validated &&
|
648
|
+
(escapedPrefix._store.validated = 2),
|
649
|
+
(callback = escapedPrefix)),
|
650
|
+
array.push(callback));
|
651
|
+
return 1;
|
1846
652
|
}
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
653
|
+
invokeCallback = 0;
|
654
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
655
|
+
if (isArrayImpl(children))
|
656
|
+
for (var i = 0; i < children.length; i++)
|
657
|
+
(nameSoFar = children[i]),
|
658
|
+
(type = childKey + getElementKey(nameSoFar, i)),
|
659
|
+
(invokeCallback += mapIntoArray(
|
660
|
+
nameSoFar,
|
661
|
+
array,
|
662
|
+
escapedPrefix,
|
663
|
+
type,
|
664
|
+
callback
|
665
|
+
));
|
666
|
+
else if (((i = getIteratorFn(children)), "function" === typeof i))
|
667
|
+
for (
|
668
|
+
i === children.entries &&
|
669
|
+
(didWarnAboutMaps ||
|
670
|
+
console.warn(
|
671
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
672
|
+
),
|
673
|
+
(didWarnAboutMaps = !0)),
|
674
|
+
children = i.call(children),
|
675
|
+
i = 0;
|
676
|
+
!(nameSoFar = children.next()).done;
|
677
|
+
|
678
|
+
)
|
679
|
+
(nameSoFar = nameSoFar.value),
|
680
|
+
(type = childKey + getElementKey(nameSoFar, i++)),
|
681
|
+
(invokeCallback += mapIntoArray(
|
682
|
+
nameSoFar,
|
683
|
+
array,
|
684
|
+
escapedPrefix,
|
685
|
+
type,
|
686
|
+
callback
|
687
|
+
));
|
688
|
+
else if ("object" === type) {
|
689
|
+
if ("function" === typeof children.then)
|
690
|
+
return mapIntoArray(
|
691
|
+
resolveThenable(children),
|
692
|
+
array,
|
693
|
+
escapedPrefix,
|
694
|
+
nameSoFar,
|
695
|
+
callback
|
696
|
+
);
|
697
|
+
array = String(children);
|
698
|
+
throw Error(
|
699
|
+
"Objects are not valid as a React child (found: " +
|
700
|
+
("[object Object]" === array
|
701
|
+
? "object with keys {" + Object.keys(children).join(", ") + "}"
|
702
|
+
: array) +
|
703
|
+
"). If you meant to render a collection of children, use an array instead."
|
704
|
+
);
|
1880
705
|
}
|
1881
|
-
|
1882
|
-
|
1883
|
-
if (payload._status === Uninitialized) {
|
1884
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
1885
|
-
// to resolve. Set it as pending in the meantime.
|
1886
|
-
var pending = payload;
|
1887
|
-
pending._status = Pending;
|
1888
|
-
pending._result = thenable;
|
706
|
+
return invokeCallback;
|
1889
707
|
}
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1894
|
-
|
1895
|
-
|
1896
|
-
|
1897
|
-
|
1898
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
1899
|
-
}
|
708
|
+
function mapChildren(children, func, context) {
|
709
|
+
if (null == children) return children;
|
710
|
+
var result = [],
|
711
|
+
count = 0;
|
712
|
+
mapIntoArray(children, result, "", "", function (child) {
|
713
|
+
return func.call(context, child, count++);
|
714
|
+
});
|
715
|
+
return result;
|
1900
716
|
}
|
1901
|
-
|
1902
|
-
|
1903
|
-
|
1904
|
-
error(
|
1905
|
-
|
717
|
+
function resolveDispatcher() {
|
718
|
+
var dispatcher = ReactSharedInternals.H;
|
719
|
+
null === dispatcher &&
|
720
|
+
console.error(
|
721
|
+
"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."
|
722
|
+
);
|
723
|
+
return dispatcher;
|
724
|
+
}
|
725
|
+
function lazyInitializer(payload) {
|
726
|
+
if (-1 === payload._status) {
|
727
|
+
var ctor = payload._result;
|
728
|
+
ctor = ctor();
|
729
|
+
ctor.then(
|
730
|
+
function (moduleObject) {
|
731
|
+
if (0 === payload._status || -1 === payload._status)
|
732
|
+
(payload._status = 1), (payload._result = moduleObject);
|
733
|
+
},
|
734
|
+
function (error) {
|
735
|
+
if (0 === payload._status || -1 === payload._status)
|
736
|
+
(payload._status = 2), (payload._result = error);
|
737
|
+
}
|
738
|
+
);
|
739
|
+
-1 === payload._status &&
|
740
|
+
((payload._status = 0), (payload._result = ctor));
|
1906
741
|
}
|
742
|
+
if (1 === payload._status)
|
743
|
+
return (
|
744
|
+
(ctor = payload._result),
|
745
|
+
void 0 === ctor &&
|
746
|
+
console.error(
|
747
|
+
"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?",
|
748
|
+
ctor
|
749
|
+
),
|
750
|
+
"default" in ctor ||
|
751
|
+
console.error(
|
752
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
753
|
+
ctor
|
754
|
+
),
|
755
|
+
ctor.default
|
756
|
+
);
|
757
|
+
throw payload._result;
|
1907
758
|
}
|
1908
|
-
|
1909
|
-
|
1910
|
-
} else {
|
1911
|
-
throw payload._result;
|
1912
|
-
}
|
1913
|
-
}
|
1914
|
-
|
1915
|
-
function lazy(ctor) {
|
1916
|
-
var payload = {
|
1917
|
-
// We use these fields to store the result.
|
1918
|
-
_status: Uninitialized,
|
1919
|
-
_result: ctor
|
1920
|
-
};
|
1921
|
-
var lazyType = {
|
1922
|
-
$$typeof: REACT_LAZY_TYPE,
|
1923
|
-
_payload: payload,
|
1924
|
-
_init: lazyInitializer
|
1925
|
-
};
|
1926
|
-
|
1927
|
-
return lazyType;
|
1928
|
-
}
|
1929
|
-
|
1930
|
-
function memo(type, compare) {
|
1931
|
-
{
|
1932
|
-
if (!isValidElementType(type)) {
|
1933
|
-
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
759
|
+
function createCacheRoot() {
|
760
|
+
return new WeakMap();
|
1934
761
|
}
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
762
|
+
function createCacheNode() {
|
763
|
+
return { s: 0, v: void 0, o: null, p: null };
|
764
|
+
}
|
765
|
+
var ReactSharedInternals = { H: null, A: null, getCurrentStack: null },
|
766
|
+
isArrayImpl = Array.isArray,
|
767
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
768
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
769
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
770
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
771
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
772
|
+
Symbol.for("react.provider");
|
773
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
774
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
775
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
776
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
777
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
778
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
779
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
780
|
+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
781
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
782
|
+
REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
|
783
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
784
|
+
assign = Object.assign,
|
785
|
+
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
786
|
+
disabledDepth = 0,
|
787
|
+
prevLog,
|
788
|
+
prevInfo,
|
789
|
+
prevWarn,
|
790
|
+
prevError,
|
791
|
+
prevGroup,
|
792
|
+
prevGroupCollapsed,
|
793
|
+
prevGroupEnd;
|
794
|
+
disabledLog.__reactDisabledLog = !0;
|
795
|
+
var prefix,
|
796
|
+
suffix,
|
797
|
+
reentry = !1;
|
798
|
+
var componentFrameCache = new (
|
799
|
+
"function" === typeof WeakMap ? WeakMap : Map
|
800
|
+
)();
|
801
|
+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
802
|
+
specialPropKeyWarningShown,
|
803
|
+
didWarnAboutOldJSXRuntime;
|
804
|
+
var didWarnAboutElementRef = {};
|
805
|
+
var ownerHasKeyUseWarning = {},
|
806
|
+
didWarnAboutMaps = !1,
|
807
|
+
userProvidedKeyEscapeRegex = /\/+/g;
|
808
|
+
exports.Children = {
|
809
|
+
map: mapChildren,
|
810
|
+
forEach: function (children, forEachFunc, forEachContext) {
|
811
|
+
mapChildren(
|
812
|
+
children,
|
813
|
+
function () {
|
814
|
+
forEachFunc.apply(this, arguments);
|
815
|
+
},
|
816
|
+
forEachContext
|
817
|
+
);
|
1950
818
|
},
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
819
|
+
count: function (children) {
|
820
|
+
var n = 0;
|
821
|
+
mapChildren(children, function () {
|
822
|
+
n++;
|
823
|
+
});
|
824
|
+
return n;
|
825
|
+
},
|
826
|
+
toArray: function (children) {
|
827
|
+
return (
|
828
|
+
mapChildren(children, function (child) {
|
829
|
+
return child;
|
830
|
+
}) || []
|
831
|
+
);
|
832
|
+
},
|
833
|
+
only: function (children) {
|
834
|
+
if (!isValidElement(children))
|
835
|
+
throw Error(
|
836
|
+
"React.Children.only expected to receive a single React element child."
|
837
|
+
);
|
838
|
+
return children;
|
1966
839
|
}
|
1967
|
-
}
|
1968
|
-
|
1969
|
-
|
1970
|
-
|
1971
|
-
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
1983
|
-
|
1984
|
-
|
1985
|
-
|
1986
|
-
|
1987
|
-
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
|
1995
|
-
|
1996
|
-
|
1997
|
-
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
|
2002
|
-
|
2003
|
-
|
2004
|
-
var fnMap = dispatcher.getCacheForType(createCacheRoot);
|
2005
|
-
var fnNode = fnMap.get(fn);
|
2006
|
-
var cacheNode;
|
2007
|
-
|
2008
|
-
if (fnNode === undefined) {
|
2009
|
-
cacheNode = createCacheNode();
|
2010
|
-
fnMap.set(fn, cacheNode);
|
2011
|
-
} else {
|
2012
|
-
cacheNode = fnNode;
|
2013
|
-
}
|
2014
|
-
|
2015
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
2016
|
-
var arg = arguments[i];
|
2017
|
-
|
2018
|
-
if (typeof arg === 'function' || typeof arg === 'object' && arg !== null) {
|
2019
|
-
// Objects go into a WeakMap
|
2020
|
-
var objectCache = cacheNode.o;
|
2021
|
-
|
2022
|
-
if (objectCache === null) {
|
2023
|
-
cacheNode.o = objectCache = new WeakMap();
|
2024
|
-
}
|
2025
|
-
|
2026
|
-
var objectNode = objectCache.get(arg);
|
2027
|
-
|
2028
|
-
if (objectNode === undefined) {
|
2029
|
-
cacheNode = createCacheNode();
|
2030
|
-
objectCache.set(arg, cacheNode);
|
2031
|
-
} else {
|
2032
|
-
cacheNode = objectNode;
|
840
|
+
};
|
841
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
842
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
843
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
844
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
845
|
+
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
|
846
|
+
ReactSharedInternals;
|
847
|
+
exports.cache = function (fn) {
|
848
|
+
return function () {
|
849
|
+
var dispatcher = ReactSharedInternals.A;
|
850
|
+
if (!dispatcher) return fn.apply(null, arguments);
|
851
|
+
var fnMap = dispatcher.getCacheForType(createCacheRoot);
|
852
|
+
dispatcher = fnMap.get(fn);
|
853
|
+
void 0 === dispatcher &&
|
854
|
+
((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
|
855
|
+
fnMap = 0;
|
856
|
+
for (var l = arguments.length; fnMap < l; fnMap++) {
|
857
|
+
var arg = arguments[fnMap];
|
858
|
+
if (
|
859
|
+
"function" === typeof arg ||
|
860
|
+
("object" === typeof arg && null !== arg)
|
861
|
+
) {
|
862
|
+
var objectCache = dispatcher.o;
|
863
|
+
null === objectCache &&
|
864
|
+
(dispatcher.o = objectCache = new WeakMap());
|
865
|
+
dispatcher = objectCache.get(arg);
|
866
|
+
void 0 === dispatcher &&
|
867
|
+
((dispatcher = createCacheNode()),
|
868
|
+
objectCache.set(arg, dispatcher));
|
869
|
+
} else
|
870
|
+
(objectCache = dispatcher.p),
|
871
|
+
null === objectCache && (dispatcher.p = objectCache = new Map()),
|
872
|
+
(dispatcher = objectCache.get(arg)),
|
873
|
+
void 0 === dispatcher &&
|
874
|
+
((dispatcher = createCacheNode()),
|
875
|
+
objectCache.set(arg, dispatcher));
|
2033
876
|
}
|
2034
|
-
|
2035
|
-
|
2036
|
-
|
2037
|
-
|
2038
|
-
|
2039
|
-
|
877
|
+
if (1 === dispatcher.s) return dispatcher.v;
|
878
|
+
if (2 === dispatcher.s) throw dispatcher.v;
|
879
|
+
try {
|
880
|
+
var result = fn.apply(null, arguments);
|
881
|
+
fnMap = dispatcher;
|
882
|
+
fnMap.s = 1;
|
883
|
+
return (fnMap.v = result);
|
884
|
+
} catch (error) {
|
885
|
+
throw (
|
886
|
+
((result = dispatcher), (result.s = 2), (result.v = error), error)
|
887
|
+
);
|
2040
888
|
}
|
2041
|
-
|
2042
|
-
|
2043
|
-
|
2044
|
-
|
2045
|
-
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
889
|
+
};
|
890
|
+
};
|
891
|
+
exports.cloneElement = function (element, config, children) {
|
892
|
+
if (null === element || void 0 === element)
|
893
|
+
throw Error(
|
894
|
+
"The argument must be a React element, but you passed " +
|
895
|
+
element +
|
896
|
+
"."
|
897
|
+
);
|
898
|
+
var props = assign({}, element.props),
|
899
|
+
key = element.key,
|
900
|
+
owner = element._owner;
|
901
|
+
if (null != config) {
|
902
|
+
var JSCompiler_inline_result;
|
903
|
+
a: {
|
904
|
+
if (
|
905
|
+
hasOwnProperty.call(config, "ref") &&
|
906
|
+
(JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
907
|
+
config,
|
908
|
+
"ref"
|
909
|
+
).get) &&
|
910
|
+
JSCompiler_inline_result.isReactWarning
|
911
|
+
) {
|
912
|
+
JSCompiler_inline_result = !1;
|
913
|
+
break a;
|
914
|
+
}
|
915
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
2049
916
|
}
|
917
|
+
JSCompiler_inline_result && (owner = getOwner());
|
918
|
+
hasValidKey(config) &&
|
919
|
+
(checkKeyStringCoercion(config.key), (key = "" + config.key));
|
920
|
+
for (propName in config)
|
921
|
+
!hasOwnProperty.call(config, propName) ||
|
922
|
+
"key" === propName ||
|
923
|
+
"__self" === propName ||
|
924
|
+
"__source" === propName ||
|
925
|
+
("ref" === propName && void 0 === config.ref) ||
|
926
|
+
(props[propName] = config[propName]);
|
2050
927
|
}
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2056
|
-
|
2057
|
-
|
2058
|
-
throw cacheNode.v;
|
2059
|
-
}
|
2060
|
-
|
2061
|
-
try {
|
2062
|
-
// $FlowFixMe[incompatible-call]: We don't want to use rest arguments since we transpile the code.
|
2063
|
-
var result = fn.apply(null, arguments);
|
2064
|
-
var terminatedNode = cacheNode;
|
2065
|
-
terminatedNode.s = TERMINATED;
|
2066
|
-
terminatedNode.v = result;
|
2067
|
-
return result;
|
2068
|
-
} catch (error) {
|
2069
|
-
// We store the first error that's thrown and rethrow it.
|
2070
|
-
var erroredNode = cacheNode;
|
2071
|
-
erroredNode.s = ERRORED;
|
2072
|
-
erroredNode.v = error;
|
2073
|
-
throw error;
|
2074
|
-
}
|
2075
|
-
};
|
2076
|
-
}
|
2077
|
-
|
2078
|
-
var reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
|
2079
|
-
// emulating an uncaught JavaScript error.
|
2080
|
-
reportError : function (error) {
|
2081
|
-
if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
|
2082
|
-
// Browser Polyfill
|
2083
|
-
var message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
|
2084
|
-
String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
|
2085
|
-
String(error);
|
2086
|
-
var event = new window.ErrorEvent('error', {
|
2087
|
-
bubbles: true,
|
2088
|
-
cancelable: true,
|
2089
|
-
message: message,
|
2090
|
-
error: error
|
2091
|
-
});
|
2092
|
-
var shouldLog = window.dispatchEvent(event);
|
2093
|
-
|
2094
|
-
if (!shouldLog) {
|
2095
|
-
return;
|
2096
|
-
}
|
2097
|
-
} else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
|
2098
|
-
typeof process.emit === 'function') {
|
2099
|
-
// Node Polyfill
|
2100
|
-
process.emit('uncaughtException', error);
|
2101
|
-
return;
|
2102
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
2103
|
-
|
2104
|
-
|
2105
|
-
console['error'](error);
|
2106
|
-
};
|
2107
|
-
|
2108
|
-
function startTransition(scope, options) {
|
2109
|
-
var prevTransition = ReactSharedInternals.T;
|
2110
|
-
var transition = {};
|
2111
|
-
ReactSharedInternals.T = transition;
|
2112
|
-
var currentTransition = ReactSharedInternals.T;
|
2113
|
-
|
2114
|
-
{
|
2115
|
-
ReactSharedInternals.T._updatedFibers = new Set();
|
2116
|
-
}
|
2117
|
-
|
2118
|
-
{
|
2119
|
-
try {
|
2120
|
-
var returnValue = scope();
|
2121
|
-
var onStartTransitionFinish = ReactSharedInternals.S;
|
2122
|
-
|
2123
|
-
if (onStartTransitionFinish !== null) {
|
2124
|
-
onStartTransitionFinish(transition, returnValue);
|
928
|
+
var propName = arguments.length - 2;
|
929
|
+
if (1 === propName) props.children = children;
|
930
|
+
else if (1 < propName) {
|
931
|
+
JSCompiler_inline_result = Array(propName);
|
932
|
+
for (var i = 0; i < propName; i++)
|
933
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
934
|
+
props.children = JSCompiler_inline_result;
|
2125
935
|
}
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
936
|
+
props = ReactElement(element.type, key, void 0, void 0, owner, props);
|
937
|
+
for (key = 2; key < arguments.length; key++)
|
938
|
+
validateChildKeys(arguments[key], props.type);
|
939
|
+
return props;
|
940
|
+
};
|
941
|
+
exports.createElement = function (type, config, children) {
|
942
|
+
if (isValidElementType(type))
|
943
|
+
for (var i = 2; i < arguments.length; i++)
|
944
|
+
validateChildKeys(arguments[i], type);
|
945
|
+
else {
|
946
|
+
i = "";
|
947
|
+
if (
|
948
|
+
void 0 === type ||
|
949
|
+
("object" === typeof type &&
|
950
|
+
null !== type &&
|
951
|
+
0 === Object.keys(type).length)
|
952
|
+
)
|
953
|
+
i +=
|
954
|
+
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
955
|
+
if (null === type) var typeString = "null";
|
956
|
+
else
|
957
|
+
isArrayImpl(type)
|
958
|
+
? (typeString = "array")
|
959
|
+
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
|
960
|
+
? ((typeString =
|
961
|
+
"<" +
|
962
|
+
(getComponentNameFromType(type.type) || "Unknown") +
|
963
|
+
" />"),
|
964
|
+
(i =
|
965
|
+
" Did you accidentally export a JSX literal instead of a component?"))
|
966
|
+
: (typeString = typeof type);
|
967
|
+
console.error(
|
968
|
+
"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
969
|
+
typeString,
|
970
|
+
i
|
971
|
+
);
|
2129
972
|
}
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
|
2140
|
-
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
|
973
|
+
var propName;
|
974
|
+
i = {};
|
975
|
+
typeString = null;
|
976
|
+
if (null != config)
|
977
|
+
for (propName in (didWarnAboutOldJSXRuntime ||
|
978
|
+
!("__self" in config) ||
|
979
|
+
"key" in config ||
|
980
|
+
((didWarnAboutOldJSXRuntime = !0),
|
981
|
+
console.warn(
|
982
|
+
"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"
|
983
|
+
)),
|
984
|
+
hasValidKey(config) &&
|
985
|
+
(checkKeyStringCoercion(config.key), (typeString = "" + config.key)),
|
986
|
+
config))
|
987
|
+
hasOwnProperty.call(config, propName) &&
|
988
|
+
"key" !== propName &&
|
989
|
+
"__self" !== propName &&
|
990
|
+
"__source" !== propName &&
|
991
|
+
(i[propName] = config[propName]);
|
992
|
+
var childrenLength = arguments.length - 2;
|
993
|
+
if (1 === childrenLength) i.children = children;
|
994
|
+
else if (1 < childrenLength) {
|
995
|
+
for (
|
996
|
+
var childArray = Array(childrenLength), _i = 0;
|
997
|
+
_i < childrenLength;
|
998
|
+
_i++
|
999
|
+
)
|
1000
|
+
childArray[_i] = arguments[_i + 2];
|
1001
|
+
Object.freeze && Object.freeze(childArray);
|
1002
|
+
i.children = childArray;
|
2148
1003
|
}
|
2149
|
-
|
2150
|
-
|
2151
|
-
|
2152
|
-
|
2153
|
-
|
2154
|
-
|
2155
|
-
|
2156
|
-
|
2157
|
-
|
2158
|
-
|
2159
|
-
|
2160
|
-
|
2161
|
-
|
2162
|
-
|
2163
|
-
|
2164
|
-
|
2165
|
-
|
2166
|
-
exports.
|
2167
|
-
|
2168
|
-
|
2169
|
-
|
2170
|
-
|
2171
|
-
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2176
|
-
|
2177
|
-
|
2178
|
-
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
|
2185
|
-
|
2186
|
-
|
1004
|
+
if (type && type.defaultProps)
|
1005
|
+
for (propName in ((childrenLength = type.defaultProps), childrenLength))
|
1006
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
1007
|
+
typeString &&
|
1008
|
+
defineKeyPropWarningGetter(
|
1009
|
+
i,
|
1010
|
+
"function" === typeof type
|
1011
|
+
? type.displayName || type.name || "Unknown"
|
1012
|
+
: type
|
1013
|
+
);
|
1014
|
+
return ReactElement(type, typeString, void 0, void 0, getOwner(), i);
|
1015
|
+
};
|
1016
|
+
exports.createRef = function () {
|
1017
|
+
var refObject = { current: null };
|
1018
|
+
Object.seal(refObject);
|
1019
|
+
return refObject;
|
1020
|
+
};
|
1021
|
+
exports.forwardRef = function (render) {
|
1022
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE
|
1023
|
+
? console.error(
|
1024
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
1025
|
+
)
|
1026
|
+
: "function" !== typeof render
|
1027
|
+
? console.error(
|
1028
|
+
"forwardRef requires a render function but was given %s.",
|
1029
|
+
null === render ? "null" : typeof render
|
1030
|
+
)
|
1031
|
+
: 0 !== render.length &&
|
1032
|
+
2 !== render.length &&
|
1033
|
+
console.error(
|
1034
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
1035
|
+
1 === render.length
|
1036
|
+
? "Did you forget to use the ref parameter?"
|
1037
|
+
: "Any additional parameter will be undefined."
|
1038
|
+
);
|
1039
|
+
null != render &&
|
1040
|
+
null != render.defaultProps &&
|
1041
|
+
console.error(
|
1042
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
1043
|
+
);
|
1044
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
|
1045
|
+
ownName;
|
1046
|
+
Object.defineProperty(elementType, "displayName", {
|
1047
|
+
enumerable: !1,
|
1048
|
+
configurable: !0,
|
1049
|
+
get: function () {
|
1050
|
+
return ownName;
|
1051
|
+
},
|
1052
|
+
set: function (name) {
|
1053
|
+
ownName = name;
|
1054
|
+
render.name ||
|
1055
|
+
render.displayName ||
|
1056
|
+
(Object.defineProperty(render, "name", { value: name }),
|
1057
|
+
(render.displayName = name));
|
1058
|
+
}
|
1059
|
+
});
|
1060
|
+
return elementType;
|
1061
|
+
};
|
1062
|
+
exports.isValidElement = isValidElement;
|
1063
|
+
exports.lazy = function (ctor) {
|
1064
|
+
return {
|
1065
|
+
$$typeof: REACT_LAZY_TYPE,
|
1066
|
+
_payload: { _status: -1, _result: ctor },
|
1067
|
+
_init: lazyInitializer
|
1068
|
+
};
|
1069
|
+
};
|
1070
|
+
exports.memo = function (type, compare) {
|
1071
|
+
isValidElementType(type) ||
|
1072
|
+
console.error(
|
1073
|
+
"memo: The first argument must be a component. Instead received: %s",
|
1074
|
+
null === type ? "null" : typeof type
|
1075
|
+
);
|
1076
|
+
compare = {
|
1077
|
+
$$typeof: REACT_MEMO_TYPE,
|
1078
|
+
type: type,
|
1079
|
+
compare: void 0 === compare ? null : compare
|
1080
|
+
};
|
1081
|
+
var ownName;
|
1082
|
+
Object.defineProperty(compare, "displayName", {
|
1083
|
+
enumerable: !1,
|
1084
|
+
configurable: !0,
|
1085
|
+
get: function () {
|
1086
|
+
return ownName;
|
1087
|
+
},
|
1088
|
+
set: function (name) {
|
1089
|
+
ownName = name;
|
1090
|
+
type.name ||
|
1091
|
+
type.displayName ||
|
1092
|
+
(Object.defineProperty(type, "name", { value: name }),
|
1093
|
+
(type.displayName = name));
|
1094
|
+
}
|
1095
|
+
});
|
1096
|
+
return compare;
|
1097
|
+
};
|
1098
|
+
exports.use = function (usable) {
|
1099
|
+
return resolveDispatcher().use(usable);
|
1100
|
+
};
|
1101
|
+
exports.useCallback = function (callback, deps) {
|
1102
|
+
return resolveDispatcher().useCallback(callback, deps);
|
1103
|
+
};
|
1104
|
+
exports.useDebugValue = function (value, formatterFn) {
|
1105
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
1106
|
+
};
|
1107
|
+
exports.useId = function () {
|
1108
|
+
return resolveDispatcher().useId();
|
1109
|
+
};
|
1110
|
+
exports.useMemo = function (create, deps) {
|
1111
|
+
return resolveDispatcher().useMemo(create, deps);
|
1112
|
+
};
|
1113
|
+
exports.version = "19.0.0";
|
2187
1114
|
})();
|
2188
|
-
}
|