react 19.0.0-canary-33a32441e9-20240418 → 19.0.0-canary-cb151849e1-20240424
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-jsx-dev-runtime.development.js +27 -28
- package/cjs/react-jsx-dev-runtime.production.js +4 -9
- package/cjs/react-jsx-dev-runtime.profiling.js +4 -9
- package/cjs/react-jsx-runtime.development.js +27 -28
- package/cjs/react-jsx-runtime.production.js +24 -144
- package/cjs/react-jsx-runtime.profiling.js +24 -144
- package/cjs/react-jsx-runtime.react-server.development.js +27 -28
- package/cjs/react-jsx-runtime.react-server.production.js +29 -151
- package/cjs/react.development.js +33 -35
- package/cjs/react.production.js +467 -1028
- package/cjs/react.react-server.development.js +13 -139
- package/cjs/react.react-server.production.js +424 -998
- package/index.js +1 -1
- package/jsx-dev-runtime.js +1 -1
- package/jsx-runtime.js +1 -1
- package/jsx-runtime.react-server.js +1 -1
- package/package.json +1 -1
- package/react.react-server.js +1 -1
- package/cjs/react-jsx-dev-runtime.production.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-dev-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-dev-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.production.min.js +0 -12
- package/cjs/react-jsx-runtime.production.min.js.map +0 -1
- package/cjs/react-jsx-runtime.profiling.min.js +0 -12
- package/cjs/react-jsx-runtime.profiling.min.js.map +0 -1
- package/cjs/react-jsx-runtime.react-server.production.min.js +0 -13
- package/cjs/react-jsx-runtime.react-server.production.min.js.map +0 -1
- package/cjs/react.production.min.js +0 -30
- package/cjs/react.production.min.js.map +0 -1
- package/cjs/react.react-server.production.min.js +0 -29
- package/cjs/react.react-server.production.min.js.map +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/**
|
2
2
|
* @license React
|
3
|
-
* react.react-server.production.
|
3
|
+
* react.react-server.production.js
|
4
4
|
*
|
5
5
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
6
|
*
|
@@ -8,1055 +8,481 @@
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
9
|
*/
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
const assign = Object.assign;
|
14
|
-
|
15
|
-
// -----------------------------------------------------------------------------
|
16
|
-
// as a normal prop instead of stripping it from the props object.
|
17
|
-
// Passes `ref` as a normal prop instead of stripping it from the props object
|
18
|
-
// during element creation.
|
19
|
-
|
20
|
-
const enableRefAsProp = true;
|
21
|
-
|
22
|
-
const ReactSharedInternals = {
|
23
|
-
H: null,
|
24
|
-
C: null
|
25
|
-
};
|
26
|
-
|
27
|
-
function createFetchCache() {
|
28
|
-
return new Map();
|
29
|
-
}
|
30
|
-
|
31
|
-
const simpleCacheKey = '["GET",[],null,"follow",null,null,null,null]'; // generateCacheKey(new Request('https://blank'));
|
32
|
-
|
33
|
-
function generateCacheKey(request) {
|
34
|
-
// We pick the fields that goes into the key used to dedupe requests.
|
35
|
-
// We don't include the `cache` field, because we end up using whatever
|
36
|
-
// caching resulted from the first request.
|
37
|
-
// Notably we currently don't consider non-standard (or future) options.
|
38
|
-
// This might not be safe. TODO: warn for non-standard extensions differing.
|
39
|
-
// IF YOU CHANGE THIS UPDATE THE simpleCacheKey ABOVE.
|
40
|
-
return JSON.stringify([request.method, Array.from(request.headers.entries()), request.mode, request.redirect, request.credentials, request.referrer, request.referrerPolicy, request.integrity]);
|
41
|
-
}
|
42
|
-
|
43
|
-
{
|
44
|
-
if (typeof fetch === 'function') {
|
45
|
-
const originalFetch = fetch;
|
46
|
-
|
47
|
-
const cachedFetch = function fetch(resource, options) {
|
48
|
-
const dispatcher = ReactSharedInternals.C;
|
49
|
-
|
50
|
-
if (!dispatcher) {
|
51
|
-
// We're outside a cached scope.
|
52
|
-
return originalFetch(resource, options);
|
53
|
-
}
|
54
|
-
|
55
|
-
if (options && options.signal) {
|
56
|
-
// If we're passed a signal, then we assume that
|
57
|
-
// someone else controls the lifetime of this object and opts out of
|
58
|
-
// caching. It's effectively the opt-out mechanism.
|
59
|
-
// Ideally we should be able to check this on the Request but
|
60
|
-
// it always gets initialized with its own signal so we don't
|
61
|
-
// know if it's supposed to override - unless we also override the
|
62
|
-
// Request constructor.
|
63
|
-
return originalFetch(resource, options);
|
64
|
-
} // Normalize the Request
|
65
|
-
|
66
|
-
|
67
|
-
let url;
|
68
|
-
let cacheKey;
|
69
|
-
|
70
|
-
if (typeof resource === 'string' && !options) {
|
71
|
-
// Fast path.
|
72
|
-
cacheKey = simpleCacheKey;
|
73
|
-
url = resource;
|
74
|
-
} else {
|
75
|
-
// Normalize the request.
|
76
|
-
// if resource is not a string or a URL (its an instance of Request)
|
77
|
-
// then do not instantiate a new Request but instead
|
78
|
-
// reuse the request as to not disturb the body in the event it's a ReadableStream.
|
79
|
-
const request = typeof resource === 'string' || resource instanceof URL ? new Request(resource, options) : resource;
|
80
|
-
|
81
|
-
if (request.method !== 'GET' && request.method !== 'HEAD' || // $FlowFixMe[prop-missing]: keepalive is real
|
82
|
-
request.keepalive) {
|
83
|
-
// We currently don't dedupe requests that might have side-effects. Those
|
84
|
-
// have to be explicitly cached. We assume that the request doesn't have a
|
85
|
-
// body if it's GET or HEAD.
|
86
|
-
// keepalive gets treated the same as if you passed a custom cache signal.
|
87
|
-
return originalFetch(resource, options);
|
88
|
-
}
|
89
|
-
|
90
|
-
cacheKey = generateCacheKey(request);
|
91
|
-
url = request.url;
|
92
|
-
}
|
93
|
-
|
94
|
-
const cache = dispatcher.getCacheForType(createFetchCache);
|
95
|
-
const cacheEntries = cache.get(url);
|
96
|
-
let match;
|
97
|
-
|
98
|
-
if (cacheEntries === undefined) {
|
99
|
-
// We pass the original arguments here in case normalizing the Request
|
100
|
-
// doesn't include all the options in this environment.
|
101
|
-
match = originalFetch(resource, options);
|
102
|
-
cache.set(url, [cacheKey, match]);
|
103
|
-
} else {
|
104
|
-
// We use an array as the inner data structure since it's lighter and
|
105
|
-
// we typically only expect to see one or two entries here.
|
106
|
-
for (let i = 0, l = cacheEntries.length; i < l; i += 2) {
|
107
|
-
const key = cacheEntries[i];
|
108
|
-
const value = cacheEntries[i + 1];
|
109
|
-
|
110
|
-
if (key === cacheKey) {
|
111
|
-
match = value; // I would've preferred a labelled break but lint says no.
|
112
|
-
|
113
|
-
return match.then(response => response.clone());
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
match = originalFetch(resource, options);
|
118
|
-
cacheEntries.push(cacheKey, match);
|
119
|
-
} // We clone the response so that each time you call this you get a new read
|
120
|
-
// of the body so that it can be read multiple times.
|
121
|
-
|
122
|
-
|
123
|
-
return match.then(response => response.clone());
|
124
|
-
}; // We don't expect to see any extra properties on fetch but if there are any,
|
125
|
-
// copy them over. Useful for extended fetch environments or mocks.
|
126
|
-
|
127
|
-
|
128
|
-
assign(cachedFetch, originalFetch);
|
129
|
-
|
130
|
-
try {
|
131
|
-
// eslint-disable-next-line no-native-reassign
|
132
|
-
fetch = cachedFetch;
|
133
|
-
} catch (error1) {
|
134
|
-
try {
|
135
|
-
// In case assigning it globally fails, try globalThis instead just in case it exists.
|
136
|
-
globalThis.fetch = cachedFetch;
|
137
|
-
} catch (error2) {
|
138
|
-
// Log even in production just to make sure this is seen if only prod is frozen.
|
139
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
140
|
-
console.warn('React was unable to patch the fetch() function in this environment. ' + 'Suspensey APIs might not work correctly as a result.');
|
141
|
-
}
|
142
|
-
}
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
|
-
// Do not require this module directly! Use normal `invariant` calls with
|
147
|
-
// template literal strings. The messages will be replaced with error codes
|
148
|
-
// during build.
|
11
|
+
"use strict";
|
12
|
+
var ReactSharedInternals = { H: null, C: null };
|
149
13
|
function formatProdErrorMessage(code) {
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
for (let i = 2; i < arguments.length; i++) {
|
156
|
-
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
157
|
-
}
|
14
|
+
var url = "https://react.dev/errors/" + code;
|
15
|
+
if (1 < arguments.length) {
|
16
|
+
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
17
|
+
for (var i = 2; i < arguments.length; i++)
|
18
|
+
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
158
19
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
179
|
-
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
180
|
-
const REACT_MEMO_TYPE = Symbol.for('react.memo');
|
181
|
-
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
182
|
-
const MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
183
|
-
const FAUX_ITERATOR_SYMBOL = '@@iterator';
|
20
|
+
return (
|
21
|
+
"Minified React error #" +
|
22
|
+
code +
|
23
|
+
"; visit " +
|
24
|
+
url +
|
25
|
+
" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
|
26
|
+
);
|
27
|
+
}
|
28
|
+
var isArrayImpl = Array.isArray,
|
29
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
30
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
31
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
32
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
33
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
34
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
35
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
36
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
37
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
38
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
184
39
|
function getIteratorFn(maybeIterable) {
|
185
|
-
if (
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
return null;
|
196
|
-
}
|
197
|
-
|
198
|
-
// $FlowFixMe[method-unbinding]
|
199
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
200
|
-
|
201
|
-
function hasValidRef(config) {
|
202
|
-
|
203
|
-
return config.ref !== undefined;
|
204
|
-
}
|
205
|
-
|
206
|
-
function hasValidKey(config) {
|
207
|
-
|
208
|
-
return config.key !== undefined;
|
209
|
-
}
|
210
|
-
/**
|
211
|
-
* Factory method to create a new React element. This no longer adheres to
|
212
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
213
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
214
|
-
* if something is a React Element.
|
215
|
-
*
|
216
|
-
* @param {*} type
|
217
|
-
* @param {*} props
|
218
|
-
* @param {*} key
|
219
|
-
* @param {string|object} ref
|
220
|
-
* @param {*} owner
|
221
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
222
|
-
* different from the `owner` when React.createElement is called, so that we
|
223
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
224
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
225
|
-
* change in behavior.
|
226
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
227
|
-
* indicating filename, line number, and/or other information.
|
228
|
-
* @internal
|
229
|
-
*/
|
230
|
-
|
231
|
-
|
40
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
41
|
+
maybeIterable =
|
42
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
43
|
+
maybeIterable["@@iterator"];
|
44
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
45
|
+
}
|
46
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
47
|
+
assign = Object.assign;
|
232
48
|
function ReactElement(type, key, _ref, self, source, owner, props) {
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
const refProp = props.ref; // An undefined `element.ref` is coerced to `null` for
|
242
|
-
// backwards compatibility.
|
243
|
-
|
244
|
-
ref = refProp !== undefined ? refProp : null;
|
245
|
-
}
|
246
|
-
|
247
|
-
let element;
|
248
|
-
|
249
|
-
{
|
250
|
-
// In prod, `ref` is a regular property and _owner doesn't exist.
|
251
|
-
element = {
|
252
|
-
// This tag allows us to uniquely identify this as a React Element
|
253
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
254
|
-
// Built-in properties that belong on the element
|
255
|
-
type,
|
256
|
-
key,
|
257
|
-
ref,
|
258
|
-
props
|
259
|
-
};
|
260
|
-
}
|
261
|
-
|
262
|
-
return element;
|
263
|
-
}
|
264
|
-
/**
|
265
|
-
* Create and return a new ReactElement of the given type.
|
266
|
-
* See https://reactjs.org/docs/react-api.html#createelement
|
267
|
-
*/
|
268
|
-
|
269
|
-
function createElement(type, config, children) {
|
270
|
-
|
271
|
-
let propName; // Reserved names are extracted
|
272
|
-
|
273
|
-
const props = {};
|
274
|
-
let key = null;
|
275
|
-
let ref = null;
|
276
|
-
|
277
|
-
if (config != null) {
|
278
|
-
|
279
|
-
if (hasValidKey(config)) {
|
280
|
-
|
281
|
-
key = '' + config.key;
|
282
|
-
} // Remaining properties are added to a new props object
|
283
|
-
|
284
|
-
|
285
|
-
for (propName in config) {
|
286
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
287
|
-
propName !== 'key' && (enableRefAsProp ) && // Even though we don't use these anymore in the runtime, we don't want
|
288
|
-
// them to appear as props, so in createElement we filter them out.
|
289
|
-
// We don't have to do this in the jsx() runtime because the jsx()
|
290
|
-
// transform never passed these as props; it used separate arguments.
|
291
|
-
propName !== '__self' && propName !== '__source') {
|
292
|
-
{
|
293
|
-
props[propName] = config[propName];
|
294
|
-
}
|
295
|
-
}
|
296
|
-
}
|
297
|
-
} // Children can be more than one argument, and those are transferred onto
|
298
|
-
// the newly allocated props object.
|
299
|
-
|
300
|
-
|
301
|
-
const childrenLength = arguments.length - 2;
|
302
|
-
|
303
|
-
if (childrenLength === 1) {
|
304
|
-
props.children = children;
|
305
|
-
} else if (childrenLength > 1) {
|
306
|
-
const childArray = Array(childrenLength);
|
307
|
-
|
308
|
-
for (let i = 0; i < childrenLength; i++) {
|
309
|
-
childArray[i] = arguments[i + 2];
|
310
|
-
}
|
311
|
-
|
312
|
-
props.children = childArray;
|
313
|
-
} // Resolve default props
|
314
|
-
|
315
|
-
|
316
|
-
if (type && type.defaultProps) {
|
317
|
-
const defaultProps = type.defaultProps;
|
318
|
-
|
319
|
-
for (propName in defaultProps) {
|
320
|
-
if (props[propName] === undefined) {
|
321
|
-
props[propName] = defaultProps[propName];
|
322
|
-
}
|
323
|
-
}
|
324
|
-
}
|
325
|
-
|
326
|
-
const element = ReactElement(type, key, ref, undefined, undefined, ReactSharedInternals.owner, props);
|
327
|
-
|
328
|
-
return element;
|
49
|
+
_ref = props.ref;
|
50
|
+
return {
|
51
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
52
|
+
type: type,
|
53
|
+
key: key,
|
54
|
+
ref: void 0 !== _ref ? _ref : null,
|
55
|
+
props: props
|
56
|
+
};
|
329
57
|
}
|
330
58
|
function cloneAndReplaceKey(oldElement, newKey) {
|
331
|
-
return ReactElement(
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
function cloneElement(element, config, children) {
|
341
|
-
if (element === null || element === undefined) {
|
342
|
-
throw Error(formatProdErrorMessage(267, element));
|
343
|
-
}
|
344
|
-
|
345
|
-
let propName; // Original props are copied
|
346
|
-
|
347
|
-
const props = assign({}, element.props); // Reserved names are extracted
|
348
|
-
|
349
|
-
let key = element.key;
|
350
|
-
let ref = null ; // Owner will be preserved, unless ref is overridden
|
351
|
-
|
352
|
-
let owner = undefined ;
|
353
|
-
|
354
|
-
if (config != null) {
|
355
|
-
if (hasValidRef(config)) {
|
356
|
-
owner = ReactSharedInternals.owner;
|
357
|
-
}
|
358
|
-
|
359
|
-
if (hasValidKey(config)) {
|
360
|
-
|
361
|
-
key = '' + config.key;
|
362
|
-
} // Remaining properties override existing props
|
363
|
-
|
364
|
-
for (propName in config) {
|
365
|
-
if (hasOwnProperty.call(config, propName) && // Skip over reserved prop names
|
366
|
-
propName !== 'key' && (enableRefAsProp ) && // ...and maybe these, too, though we currently rely on them for
|
367
|
-
// warnings and debug information in dev. Need to decide if we're OK
|
368
|
-
// with dropping them. In the jsx() runtime it's not an issue because
|
369
|
-
// the data gets passed as separate arguments instead of props, but
|
370
|
-
// it would be nice to stop relying on them entirely so we can drop
|
371
|
-
// them from the internal Fiber field.
|
372
|
-
propName !== '__self' && propName !== '__source' && // Undefined `ref` is ignored by cloneElement. We treat it the same as
|
373
|
-
// if the property were missing. This is mostly for
|
374
|
-
// backwards compatibility.
|
375
|
-
!(propName === 'ref' && config.ref === undefined)) {
|
376
|
-
{
|
377
|
-
{
|
378
|
-
props[propName] = config[propName];
|
379
|
-
}
|
380
|
-
}
|
381
|
-
}
|
382
|
-
}
|
383
|
-
} // Children can be more than one argument, and those are transferred onto
|
384
|
-
// the newly allocated props object.
|
385
|
-
|
386
|
-
|
387
|
-
const childrenLength = arguments.length - 2;
|
388
|
-
|
389
|
-
if (childrenLength === 1) {
|
390
|
-
props.children = children;
|
391
|
-
} else if (childrenLength > 1) {
|
392
|
-
const childArray = Array(childrenLength);
|
393
|
-
|
394
|
-
for (let i = 0; i < childrenLength; i++) {
|
395
|
-
childArray[i] = arguments[i + 2];
|
396
|
-
}
|
397
|
-
|
398
|
-
props.children = childArray;
|
399
|
-
}
|
400
|
-
|
401
|
-
const clonedElement = ReactElement(element.type, key, ref, undefined, undefined, owner, props);
|
402
|
-
|
403
|
-
return clonedElement;
|
59
|
+
return ReactElement(
|
60
|
+
oldElement.type,
|
61
|
+
newKey,
|
62
|
+
null,
|
63
|
+
void 0,
|
64
|
+
void 0,
|
65
|
+
void 0,
|
66
|
+
oldElement.props
|
67
|
+
);
|
404
68
|
}
|
405
|
-
/**
|
406
|
-
* Verifies the object is a ReactElement.
|
407
|
-
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
408
|
-
* @param {?object} object
|
409
|
-
* @return {boolean} True if `object` is a ReactElement.
|
410
|
-
* @final
|
411
|
-
*/
|
412
|
-
|
413
|
-
|
414
69
|
function isValidElement(object) {
|
415
|
-
return
|
70
|
+
return (
|
71
|
+
"object" === typeof object &&
|
72
|
+
null !== object &&
|
73
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
74
|
+
);
|
416
75
|
}
|
417
|
-
|
418
|
-
const SEPARATOR = '.';
|
419
|
-
const SUBSEPARATOR = ':';
|
420
|
-
/**
|
421
|
-
* Escape and wrap key so it is safe to use as a reactid
|
422
|
-
*
|
423
|
-
* @param {string} key to be escaped.
|
424
|
-
* @return {string} the escaped key.
|
425
|
-
*/
|
426
|
-
|
427
76
|
function escape(key) {
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
}
|
438
|
-
const userProvidedKeyEscapeRegex = /\/+/g;
|
439
|
-
|
440
|
-
function escapeUserProvidedKey(text) {
|
441
|
-
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
442
|
-
}
|
443
|
-
/**
|
444
|
-
* Generate a key string that identifies a element within a set.
|
445
|
-
*
|
446
|
-
* @param {*} element A element that could contain a manual key.
|
447
|
-
* @param {number} index Index that is used if a manual key is not provided.
|
448
|
-
* @return {string}
|
449
|
-
*/
|
450
|
-
|
451
|
-
|
77
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
78
|
+
return (
|
79
|
+
"$" +
|
80
|
+
key.replace(/[=:]/g, function (match) {
|
81
|
+
return escaperLookup[match];
|
82
|
+
})
|
83
|
+
);
|
84
|
+
}
|
85
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
452
86
|
function getElementKey(element, index) {
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
return escape('' + element.key);
|
458
|
-
} // Implicit key determined by the index in the set
|
459
|
-
|
460
|
-
|
461
|
-
return index.toString(36);
|
87
|
+
return "object" === typeof element && null !== element && null != element.key
|
88
|
+
? escape("" + element.key)
|
89
|
+
: index.toString(36);
|
462
90
|
}
|
463
|
-
|
464
91
|
function noop$1() {}
|
465
|
-
|
466
92
|
function resolveThenable(thenable) {
|
467
93
|
switch (thenable.status) {
|
468
|
-
case
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
}
|
473
|
-
|
474
|
-
case 'rejected':
|
475
|
-
{
|
476
|
-
const rejectedError = thenable.reason;
|
477
|
-
throw rejectedError;
|
478
|
-
}
|
479
|
-
|
94
|
+
case "fulfilled":
|
95
|
+
return thenable.value;
|
96
|
+
case "rejected":
|
97
|
+
throw thenable.reason;
|
480
98
|
default:
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
const rejectedThenable = thenable;
|
503
|
-
rejectedThenable.status = 'rejected';
|
504
|
-
rejectedThenable.reason = error;
|
505
|
-
}
|
506
|
-
});
|
507
|
-
} // Check one more time in case the thenable resolved synchronously.
|
508
|
-
|
509
|
-
|
510
|
-
switch (thenable.status) {
|
511
|
-
case 'fulfilled':
|
512
|
-
{
|
513
|
-
const fulfilledThenable = thenable;
|
514
|
-
return fulfilledThenable.value;
|
515
|
-
}
|
516
|
-
|
517
|
-
case 'rejected':
|
518
|
-
{
|
519
|
-
const rejectedThenable = thenable;
|
520
|
-
const rejectedError = rejectedThenable.reason;
|
521
|
-
throw rejectedError;
|
522
|
-
}
|
523
|
-
}
|
99
|
+
switch (
|
100
|
+
("string" === typeof thenable.status
|
101
|
+
? thenable.then(noop$1, noop$1)
|
102
|
+
: ((thenable.status = "pending"),
|
103
|
+
thenable.then(
|
104
|
+
function (fulfilledValue) {
|
105
|
+
"pending" === thenable.status &&
|
106
|
+
((thenable.status = "fulfilled"),
|
107
|
+
(thenable.value = fulfilledValue));
|
108
|
+
},
|
109
|
+
function (error) {
|
110
|
+
"pending" === thenable.status &&
|
111
|
+
((thenable.status = "rejected"), (thenable.reason = error));
|
112
|
+
}
|
113
|
+
)),
|
114
|
+
thenable.status)
|
115
|
+
) {
|
116
|
+
case "fulfilled":
|
117
|
+
return thenable.value;
|
118
|
+
case "rejected":
|
119
|
+
throw thenable.reason;
|
524
120
|
}
|
525
121
|
}
|
526
|
-
|
527
122
|
throw thenable;
|
528
123
|
}
|
529
|
-
|
530
124
|
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
}
|
537
|
-
|
538
|
-
let invokeCallback = false;
|
539
|
-
|
540
|
-
if (children === null) {
|
541
|
-
invokeCallback = true;
|
542
|
-
} else {
|
125
|
+
var type = typeof children;
|
126
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
127
|
+
var invokeCallback = !1;
|
128
|
+
if (null === children) invokeCallback = !0;
|
129
|
+
else
|
543
130
|
switch (type) {
|
544
|
-
case
|
545
|
-
case
|
546
|
-
case
|
547
|
-
invokeCallback =
|
131
|
+
case "bigint":
|
132
|
+
case "string":
|
133
|
+
case "number":
|
134
|
+
invokeCallback = !0;
|
548
135
|
break;
|
549
|
-
|
550
|
-
case 'object':
|
136
|
+
case "object":
|
551
137
|
switch (children.$$typeof) {
|
552
138
|
case REACT_ELEMENT_TYPE:
|
553
139
|
case REACT_PORTAL_TYPE:
|
554
|
-
invokeCallback =
|
140
|
+
invokeCallback = !0;
|
555
141
|
break;
|
556
|
-
|
557
142
|
case REACT_LAZY_TYPE:
|
558
|
-
|
559
|
-
|
560
|
-
|
143
|
+
return (
|
144
|
+
(invokeCallback = children._init),
|
145
|
+
mapIntoArray(
|
146
|
+
invokeCallback(children._payload),
|
147
|
+
array,
|
148
|
+
escapedPrefix,
|
149
|
+
nameSoFar,
|
150
|
+
callback
|
151
|
+
)
|
152
|
+
);
|
561
153
|
}
|
562
|
-
|
563
|
-
}
|
564
|
-
}
|
565
|
-
|
566
|
-
if (invokeCallback) {
|
567
|
-
const child = children;
|
568
|
-
let mappedChild = callback(child); // If it's the only child, treat the name as if it was wrapped in an array
|
569
|
-
// so that it's consistent if the number of children grows:
|
570
|
-
|
571
|
-
const childKey = nameSoFar === '' ? SEPARATOR + getElementKey(child, 0) : nameSoFar;
|
572
|
-
|
573
|
-
if (isArray(mappedChild)) {
|
574
|
-
let escapedChildKey = '';
|
575
|
-
|
576
|
-
if (childKey != null) {
|
577
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
578
|
-
}
|
579
|
-
|
580
|
-
mapIntoArray(mappedChild, array, escapedChildKey, '', c => c);
|
581
|
-
} else if (mappedChild != null) {
|
582
|
-
if (isValidElement(mappedChild)) {
|
583
|
-
|
584
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
585
|
-
// traverseAllChildren used to do for objects as children
|
586
|
-
escapedPrefix + ( // $FlowFixMe[incompatible-type] Flow incorrectly thinks React.Portal doesn't have a key
|
587
|
-
mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey( // $FlowFixMe[unsafe-addition]
|
588
|
-
'' + mappedChild.key // eslint-disable-line react-internal/safe-string-coercion
|
589
|
-
) + '/' : '') + childKey);
|
590
|
-
}
|
591
|
-
|
592
|
-
array.push(mappedChild);
|
593
|
-
}
|
594
|
-
|
595
|
-
return 1;
|
596
|
-
}
|
597
|
-
|
598
|
-
let child;
|
599
|
-
let nextName;
|
600
|
-
let subtreeCount = 0; // Count of children found in the current subtree.
|
601
|
-
|
602
|
-
const nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
603
|
-
|
604
|
-
if (isArray(children)) {
|
605
|
-
for (let i = 0; i < children.length; i++) {
|
606
|
-
child = children[i];
|
607
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
608
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
609
|
-
}
|
610
|
-
} else {
|
611
|
-
const iteratorFn = getIteratorFn(children);
|
612
|
-
|
613
|
-
if (typeof iteratorFn === 'function') {
|
614
|
-
const iterableChildren = children;
|
615
|
-
|
616
|
-
const iterator = iteratorFn.call(iterableChildren);
|
617
|
-
let step;
|
618
|
-
let ii = 0; // $FlowFixMe[incompatible-use] `iteratorFn` might return null according to typing.
|
619
|
-
|
620
|
-
while (!(step = iterator.next()).done) {
|
621
|
-
child = step.value;
|
622
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
623
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
624
|
-
}
|
625
|
-
} else if (type === 'object') {
|
626
|
-
if (typeof children.then === 'function') {
|
627
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
628
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
629
|
-
|
630
|
-
|
631
|
-
const childrenString = String(children);
|
632
|
-
throw Error(formatProdErrorMessage(31, childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString));
|
633
154
|
}
|
155
|
+
if (invokeCallback)
|
156
|
+
return (
|
157
|
+
(callback = callback(children)),
|
158
|
+
(invokeCallback =
|
159
|
+
"" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),
|
160
|
+
isArrayImpl(callback)
|
161
|
+
? ((escapedPrefix = ""),
|
162
|
+
null != invokeCallback &&
|
163
|
+
(escapedPrefix =
|
164
|
+
invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
|
165
|
+
mapIntoArray(callback, array, escapedPrefix, "", function (c) {
|
166
|
+
return c;
|
167
|
+
}))
|
168
|
+
: null != callback &&
|
169
|
+
(isValidElement(callback) &&
|
170
|
+
(callback = cloneAndReplaceKey(
|
171
|
+
callback,
|
172
|
+
escapedPrefix +
|
173
|
+
(!callback.key || (children && children.key === callback.key)
|
174
|
+
? ""
|
175
|
+
: ("" + callback.key).replace(
|
176
|
+
userProvidedKeyEscapeRegex,
|
177
|
+
"$&/"
|
178
|
+
) + "/") +
|
179
|
+
invokeCallback
|
180
|
+
)),
|
181
|
+
array.push(callback)),
|
182
|
+
1
|
183
|
+
);
|
184
|
+
invokeCallback = 0;
|
185
|
+
var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
|
186
|
+
if (isArrayImpl(children))
|
187
|
+
for (var i = 0; i < children.length; i++)
|
188
|
+
(nameSoFar = children[i]),
|
189
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i)),
|
190
|
+
(invokeCallback += mapIntoArray(
|
191
|
+
nameSoFar,
|
192
|
+
array,
|
193
|
+
escapedPrefix,
|
194
|
+
type,
|
195
|
+
callback
|
196
|
+
));
|
197
|
+
else if (((i = getIteratorFn(children)), "function" === typeof i))
|
198
|
+
for (
|
199
|
+
children = i.call(children), i = 0;
|
200
|
+
!(nameSoFar = children.next()).done;
|
201
|
+
|
202
|
+
)
|
203
|
+
(nameSoFar = nameSoFar.value),
|
204
|
+
(type = nextNamePrefix + getElementKey(nameSoFar, i++)),
|
205
|
+
(invokeCallback += mapIntoArray(
|
206
|
+
nameSoFar,
|
207
|
+
array,
|
208
|
+
escapedPrefix,
|
209
|
+
type,
|
210
|
+
callback
|
211
|
+
));
|
212
|
+
else if ("object" === type) {
|
213
|
+
if ("function" === typeof children.then)
|
214
|
+
return mapIntoArray(
|
215
|
+
resolveThenable(children),
|
216
|
+
array,
|
217
|
+
escapedPrefix,
|
218
|
+
nameSoFar,
|
219
|
+
callback
|
220
|
+
);
|
221
|
+
array = String(children);
|
222
|
+
throw Error(
|
223
|
+
formatProdErrorMessage(
|
224
|
+
31,
|
225
|
+
"[object Object]" === array
|
226
|
+
? "object with keys {" + Object.keys(children).join(", ") + "}"
|
227
|
+
: array
|
228
|
+
)
|
229
|
+
);
|
634
230
|
}
|
635
|
-
|
636
|
-
return subtreeCount;
|
231
|
+
return invokeCallback;
|
637
232
|
}
|
638
|
-
/**
|
639
|
-
* Maps children that are typically specified as `props.children`.
|
640
|
-
*
|
641
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
642
|
-
*
|
643
|
-
* The provided mapFunction(child, index) will be called for each
|
644
|
-
* leaf child.
|
645
|
-
*
|
646
|
-
* @param {?*} children Children tree container.
|
647
|
-
* @param {function(*, int)} func The map function.
|
648
|
-
* @param {*} context Context for mapFunction.
|
649
|
-
* @return {object} Object containing the ordered map of results.
|
650
|
-
*/
|
651
|
-
|
652
|
-
|
653
233
|
function mapChildren(children, func, context) {
|
654
|
-
if (
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
const result = [];
|
660
|
-
let count = 0;
|
661
|
-
mapIntoArray(children, result, '', '', function (child) {
|
234
|
+
if (null == children) return children;
|
235
|
+
var result = [],
|
236
|
+
count = 0;
|
237
|
+
mapIntoArray(children, result, "", "", function (child) {
|
662
238
|
return func.call(context, child, count++);
|
663
239
|
});
|
664
240
|
return result;
|
665
241
|
}
|
666
|
-
/**
|
667
|
-
* Count the number of children that are typically specified as
|
668
|
-
* `props.children`.
|
669
|
-
*
|
670
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrencount
|
671
|
-
*
|
672
|
-
* @param {?*} children Children tree container.
|
673
|
-
* @return {number} The number of children.
|
674
|
-
*/
|
675
|
-
|
676
|
-
|
677
|
-
function countChildren(children) {
|
678
|
-
let n = 0;
|
679
|
-
mapChildren(children, () => {
|
680
|
-
n++; // Don't return anything
|
681
|
-
});
|
682
|
-
return n;
|
683
|
-
}
|
684
|
-
/**
|
685
|
-
* Iterates through children that are typically specified as `props.children`.
|
686
|
-
*
|
687
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
688
|
-
*
|
689
|
-
* The provided forEachFunc(child, index) will be called for each
|
690
|
-
* leaf child.
|
691
|
-
*
|
692
|
-
* @param {?*} children Children tree container.
|
693
|
-
* @param {function(*, int)} forEachFunc
|
694
|
-
* @param {*} forEachContext Context for forEachContext.
|
695
|
-
*/
|
696
|
-
|
697
|
-
|
698
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
699
|
-
mapChildren(children, // $FlowFixMe[missing-this-annot]
|
700
|
-
function () {
|
701
|
-
forEachFunc.apply(this, arguments); // Don't return anything.
|
702
|
-
}, forEachContext);
|
703
|
-
}
|
704
|
-
/**
|
705
|
-
* Flatten a children object (typically specified as `props.children`) and
|
706
|
-
* return an array with appropriately re-keyed children.
|
707
|
-
*
|
708
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrentoarray
|
709
|
-
*/
|
710
|
-
|
711
|
-
|
712
|
-
function toArray(children) {
|
713
|
-
return mapChildren(children, child => child) || [];
|
714
|
-
}
|
715
|
-
/**
|
716
|
-
* Returns the first child in a collection of children and verifies that there
|
717
|
-
* is only one child in the collection.
|
718
|
-
*
|
719
|
-
* See https://reactjs.org/docs/react-api.html#reactchildrenonly
|
720
|
-
*
|
721
|
-
* The current implementation of this function assumes that a single child gets
|
722
|
-
* passed without a wrapper, but the purpose of this helper function is to
|
723
|
-
* abstract away the particular structure of children.
|
724
|
-
*
|
725
|
-
* @param {?object} children Child collection structure.
|
726
|
-
* @return {ReactElement} The first and only `ReactElement` contained in the
|
727
|
-
* structure.
|
728
|
-
*/
|
729
|
-
|
730
|
-
|
731
|
-
function onlyChild(children) {
|
732
|
-
if (!isValidElement(children)) {
|
733
|
-
throw Error(formatProdErrorMessage(143));
|
734
|
-
}
|
735
|
-
|
736
|
-
return children;
|
737
|
-
}
|
738
|
-
|
739
|
-
// an immutable object with a single mutable value
|
740
|
-
function createRef() {
|
741
|
-
const refObject = {
|
742
|
-
current: null
|
743
|
-
};
|
744
|
-
|
745
|
-
return refObject;
|
746
|
-
}
|
747
|
-
|
748
|
-
function resolveDispatcher() {
|
749
|
-
const dispatcher = ReactSharedInternals.H;
|
750
|
-
// intentionally don't throw our own error because this is in a hot path.
|
751
|
-
// Also helps ensure this is inlined.
|
752
|
-
|
753
|
-
|
754
|
-
return dispatcher;
|
755
|
-
}
|
756
|
-
function useCallback(callback, deps) {
|
757
|
-
const dispatcher = resolveDispatcher();
|
758
|
-
return dispatcher.useCallback(callback, deps);
|
759
|
-
}
|
760
|
-
function useMemo(create, deps) {
|
761
|
-
const dispatcher = resolveDispatcher();
|
762
|
-
return dispatcher.useMemo(create, deps);
|
763
|
-
}
|
764
|
-
function useDebugValue(value, formatterFn) {
|
765
|
-
}
|
766
|
-
function useId() {
|
767
|
-
const dispatcher = resolveDispatcher();
|
768
|
-
return dispatcher.useId();
|
769
|
-
}
|
770
|
-
function use(usable) {
|
771
|
-
const dispatcher = resolveDispatcher();
|
772
|
-
return dispatcher.use(usable);
|
773
|
-
}
|
774
|
-
function useActionState(action, initialState, permalink) {
|
775
|
-
{
|
776
|
-
const dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] This is unstable, thus optional
|
777
|
-
|
778
|
-
return dispatcher.useActionState(action, initialState, permalink);
|
779
|
-
}
|
780
|
-
}
|
781
|
-
|
782
|
-
function forwardRef(render) {
|
783
|
-
|
784
|
-
const elementType = {
|
785
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
786
|
-
render
|
787
|
-
};
|
788
|
-
|
789
|
-
return elementType;
|
790
|
-
}
|
791
|
-
|
792
|
-
const Uninitialized = -1;
|
793
|
-
const Pending = 0;
|
794
|
-
const Resolved = 1;
|
795
|
-
const Rejected = 2;
|
796
|
-
|
797
242
|
function lazyInitializer(payload) {
|
798
|
-
if (payload._status
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
const resolved = payload;
|
810
|
-
resolved._status = Resolved;
|
811
|
-
resolved._result = moduleObject;
|
243
|
+
if (-1 === payload._status) {
|
244
|
+
var ctor = payload._result;
|
245
|
+
ctor = ctor();
|
246
|
+
ctor.then(
|
247
|
+
function (moduleObject) {
|
248
|
+
if (0 === payload._status || -1 === payload._status)
|
249
|
+
(payload._status = 1), (payload._result = moduleObject);
|
250
|
+
},
|
251
|
+
function (error) {
|
252
|
+
if (0 === payload._status || -1 === payload._status)
|
253
|
+
(payload._status = 2), (payload._result = error);
|
812
254
|
}
|
813
|
-
|
814
|
-
|
815
|
-
// Transition to the next state.
|
816
|
-
const rejected = payload;
|
817
|
-
rejected._status = Rejected;
|
818
|
-
rejected._result = error;
|
819
|
-
}
|
820
|
-
});
|
821
|
-
|
822
|
-
if (payload._status === Uninitialized) {
|
823
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
824
|
-
// to resolve. Set it as pending in the meantime.
|
825
|
-
const pending = payload;
|
826
|
-
pending._status = Pending;
|
827
|
-
pending._result = thenable;
|
828
|
-
}
|
829
|
-
}
|
830
|
-
|
831
|
-
if (payload._status === Resolved) {
|
832
|
-
const moduleObject = payload._result;
|
833
|
-
|
834
|
-
return moduleObject.default;
|
835
|
-
} else {
|
836
|
-
throw payload._result;
|
255
|
+
);
|
256
|
+
-1 === payload._status && ((payload._status = 0), (payload._result = ctor));
|
837
257
|
}
|
258
|
+
if (1 === payload._status) return payload._result.default;
|
259
|
+
throw payload._result;
|
838
260
|
}
|
839
|
-
|
840
|
-
function lazy(ctor) {
|
841
|
-
const payload = {
|
842
|
-
// We use these fields to store the result.
|
843
|
-
_status: Uninitialized,
|
844
|
-
_result: ctor
|
845
|
-
};
|
846
|
-
const lazyType = {
|
847
|
-
$$typeof: REACT_LAZY_TYPE,
|
848
|
-
_payload: payload,
|
849
|
-
_init: lazyInitializer
|
850
|
-
};
|
851
|
-
|
852
|
-
return lazyType;
|
853
|
-
}
|
854
|
-
|
855
|
-
function memo(type, compare) {
|
856
|
-
|
857
|
-
const elementType = {
|
858
|
-
$$typeof: REACT_MEMO_TYPE,
|
859
|
-
type,
|
860
|
-
compare: compare === undefined ? null : compare
|
861
|
-
};
|
862
|
-
|
863
|
-
return elementType;
|
864
|
-
}
|
865
|
-
|
866
|
-
const UNTERMINATED = 0;
|
867
|
-
const TERMINATED = 1;
|
868
|
-
const ERRORED = 2;
|
869
|
-
|
870
261
|
function createCacheRoot() {
|
871
262
|
return new WeakMap();
|
872
263
|
}
|
873
|
-
|
874
264
|
function createCacheNode() {
|
875
|
-
return {
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
fnMap.set(fn, cacheNode);
|
904
|
-
} else {
|
905
|
-
cacheNode = fnNode;
|
906
|
-
}
|
907
|
-
|
908
|
-
for (let i = 0, l = arguments.length; i < l; i++) {
|
909
|
-
const arg = arguments[i];
|
910
|
-
|
911
|
-
if (typeof arg === 'function' || typeof arg === 'object' && arg !== null) {
|
912
|
-
// Objects go into a WeakMap
|
913
|
-
let objectCache = cacheNode.o;
|
914
|
-
|
915
|
-
if (objectCache === null) {
|
916
|
-
cacheNode.o = objectCache = new WeakMap();
|
917
|
-
}
|
918
|
-
|
919
|
-
const objectNode = objectCache.get(arg);
|
920
|
-
|
921
|
-
if (objectNode === undefined) {
|
922
|
-
cacheNode = createCacheNode();
|
923
|
-
objectCache.set(arg, cacheNode);
|
924
|
-
} else {
|
925
|
-
cacheNode = objectNode;
|
926
|
-
}
|
927
|
-
} else {
|
928
|
-
// Primitives go into a regular Map
|
929
|
-
let primitiveCache = cacheNode.p;
|
930
|
-
|
931
|
-
if (primitiveCache === null) {
|
932
|
-
cacheNode.p = primitiveCache = new Map();
|
933
|
-
}
|
934
|
-
|
935
|
-
const primitiveNode = primitiveCache.get(arg);
|
936
|
-
|
937
|
-
if (primitiveNode === undefined) {
|
938
|
-
cacheNode = createCacheNode();
|
939
|
-
primitiveCache.set(arg, cacheNode);
|
940
|
-
} else {
|
941
|
-
cacheNode = primitiveNode;
|
265
|
+
return { s: 0, v: void 0, o: null, p: null };
|
266
|
+
}
|
267
|
+
var reportGlobalError =
|
268
|
+
"function" === typeof reportError
|
269
|
+
? reportError
|
270
|
+
: function (error) {
|
271
|
+
if (
|
272
|
+
"object" === typeof window &&
|
273
|
+
"function" === typeof window.ErrorEvent
|
274
|
+
) {
|
275
|
+
var event = new window.ErrorEvent("error", {
|
276
|
+
bubbles: !0,
|
277
|
+
cancelable: !0,
|
278
|
+
message:
|
279
|
+
"object" === typeof error &&
|
280
|
+
null !== error &&
|
281
|
+
"string" === typeof error.message
|
282
|
+
? String(error.message)
|
283
|
+
: String(error),
|
284
|
+
error: error
|
285
|
+
});
|
286
|
+
if (!window.dispatchEvent(event)) return;
|
287
|
+
} else if (
|
288
|
+
"object" === typeof process &&
|
289
|
+
"function" === typeof process.emit
|
290
|
+
) {
|
291
|
+
process.emit("uncaughtException", error);
|
292
|
+
return;
|
942
293
|
}
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
294
|
+
console.error(error);
|
295
|
+
};
|
296
|
+
function noop() {}
|
297
|
+
exports.Children = {
|
298
|
+
map: mapChildren,
|
299
|
+
forEach: function (children, forEachFunc, forEachContext) {
|
300
|
+
mapChildren(
|
301
|
+
children,
|
302
|
+
function () {
|
303
|
+
forEachFunc.apply(this, arguments);
|
304
|
+
},
|
305
|
+
forEachContext
|
306
|
+
);
|
307
|
+
},
|
308
|
+
count: function (children) {
|
309
|
+
var n = 0;
|
310
|
+
mapChildren(children, function () {
|
311
|
+
n++;
|
312
|
+
});
|
313
|
+
return n;
|
314
|
+
},
|
315
|
+
toArray: function (children) {
|
316
|
+
return (
|
317
|
+
mapChildren(children, function (child) {
|
318
|
+
return child;
|
319
|
+
}) || []
|
320
|
+
);
|
321
|
+
},
|
322
|
+
only: function (children) {
|
323
|
+
if (!isValidElement(children)) throw Error(formatProdErrorMessage(143));
|
324
|
+
return children;
|
325
|
+
}
|
326
|
+
};
|
327
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
328
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
329
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
330
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
331
|
+
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
|
332
|
+
ReactSharedInternals;
|
333
|
+
exports.cache = function (fn) {
|
334
|
+
return function () {
|
335
|
+
var dispatcher = ReactSharedInternals.C;
|
336
|
+
if (!dispatcher) return fn.apply(null, arguments);
|
337
|
+
var fnMap = dispatcher.getCacheForType(createCacheRoot);
|
338
|
+
dispatcher = fnMap.get(fn);
|
339
|
+
void 0 === dispatcher &&
|
340
|
+
((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
|
341
|
+
fnMap = 0;
|
342
|
+
for (var l = arguments.length; fnMap < l; fnMap++) {
|
343
|
+
var arg = arguments[fnMap];
|
344
|
+
if (
|
345
|
+
"function" === typeof arg ||
|
346
|
+
("object" === typeof arg && null !== arg)
|
347
|
+
) {
|
348
|
+
var objectCache = dispatcher.o;
|
349
|
+
null === objectCache && (dispatcher.o = objectCache = new WeakMap());
|
350
|
+
dispatcher = objectCache.get(arg);
|
351
|
+
void 0 === dispatcher &&
|
352
|
+
((dispatcher = createCacheNode()), objectCache.set(arg, dispatcher));
|
353
|
+
} else
|
354
|
+
(objectCache = dispatcher.p),
|
355
|
+
null === objectCache && (dispatcher.p = objectCache = new Map()),
|
356
|
+
(dispatcher = objectCache.get(arg)),
|
357
|
+
void 0 === dispatcher &&
|
358
|
+
((dispatcher = createCacheNode()),
|
359
|
+
objectCache.set(arg, dispatcher));
|
952
360
|
}
|
953
|
-
|
361
|
+
if (1 === dispatcher.s) return dispatcher.v;
|
362
|
+
if (2 === dispatcher.s) throw dispatcher.v;
|
954
363
|
try {
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
terminatedNode.v = result;
|
960
|
-
return result;
|
364
|
+
var result = fn.apply(null, arguments);
|
365
|
+
fnMap = dispatcher;
|
366
|
+
fnMap.s = 1;
|
367
|
+
return (fnMap.v = result);
|
961
368
|
} catch (error) {
|
962
|
-
|
963
|
-
const erroredNode = cacheNode;
|
964
|
-
erroredNode.s = ERRORED;
|
965
|
-
erroredNode.v = error;
|
966
|
-
throw error;
|
369
|
+
throw ((result = dispatcher), (result.s = 2), (result.v = error), error);
|
967
370
|
}
|
968
371
|
};
|
969
|
-
}
|
970
|
-
|
971
|
-
const reportGlobalError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event,
|
972
|
-
// emulating an uncaught JavaScript error.
|
973
|
-
reportError : error => {
|
974
|
-
if (typeof window === 'object' && typeof window.ErrorEvent === 'function') {
|
975
|
-
// Browser Polyfill
|
976
|
-
const message = typeof error === 'object' && error !== null && typeof error.message === 'string' ? // eslint-disable-next-line react-internal/safe-string-coercion
|
977
|
-
String(error.message) : // eslint-disable-next-line react-internal/safe-string-coercion
|
978
|
-
String(error);
|
979
|
-
const event = new window.ErrorEvent('error', {
|
980
|
-
bubbles: true,
|
981
|
-
cancelable: true,
|
982
|
-
message: message,
|
983
|
-
error: error
|
984
|
-
});
|
985
|
-
const shouldLog = window.dispatchEvent(event);
|
986
|
-
|
987
|
-
if (!shouldLog) {
|
988
|
-
return;
|
989
|
-
}
|
990
|
-
} else if (typeof process === 'object' && // $FlowFixMe[method-unbinding]
|
991
|
-
typeof process.emit === 'function') {
|
992
|
-
// Node Polyfill
|
993
|
-
process.emit('uncaughtException', error);
|
994
|
-
return;
|
995
|
-
} // eslint-disable-next-line react-internal/no-production-logging
|
996
|
-
|
997
|
-
|
998
|
-
console['error'](error);
|
999
372
|
};
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
ReactSharedInternals.T = prevTransition;
|
1024
|
-
}
|
373
|
+
exports.cloneElement = function (element, config, children) {
|
374
|
+
if (null === element || void 0 === element)
|
375
|
+
throw Error(formatProdErrorMessage(267, element));
|
376
|
+
var props = assign({}, element.props),
|
377
|
+
key = element.key,
|
378
|
+
owner = void 0;
|
379
|
+
if (null != config)
|
380
|
+
for (propName in (void 0 !== config.ref &&
|
381
|
+
(owner = ReactSharedInternals.owner),
|
382
|
+
void 0 !== config.key && (key = "" + config.key),
|
383
|
+
config))
|
384
|
+
!hasOwnProperty.call(config, propName) ||
|
385
|
+
"key" === propName ||
|
386
|
+
"__self" === propName ||
|
387
|
+
"__source" === propName ||
|
388
|
+
("ref" === propName && void 0 === config.ref) ||
|
389
|
+
(props[propName] = config[propName]);
|
390
|
+
var propName = arguments.length - 2;
|
391
|
+
if (1 === propName) props.children = children;
|
392
|
+
else if (1 < propName) {
|
393
|
+
for (var childArray = Array(propName), i = 0; i < propName; i++)
|
394
|
+
childArray[i] = arguments[i + 2];
|
395
|
+
props.children = childArray;
|
1025
396
|
}
|
1026
|
-
|
1027
|
-
|
1028
|
-
function
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
397
|
+
return ReactElement(element.type, key, null, void 0, void 0, owner, props);
|
398
|
+
};
|
399
|
+
exports.createElement = function (type, config, children) {
|
400
|
+
var propName,
|
401
|
+
props = {},
|
402
|
+
key = null;
|
403
|
+
if (null != config)
|
404
|
+
for (propName in (void 0 !== config.key && (key = "" + config.key), config))
|
405
|
+
hasOwnProperty.call(config, propName) &&
|
406
|
+
"key" !== propName &&
|
407
|
+
"__self" !== propName &&
|
408
|
+
"__source" !== propName &&
|
409
|
+
(props[propName] = config[propName]);
|
410
|
+
var childrenLength = arguments.length - 2;
|
411
|
+
if (1 === childrenLength) props.children = children;
|
412
|
+
else if (1 < childrenLength) {
|
413
|
+
for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)
|
414
|
+
childArray[i] = arguments[i + 2];
|
415
|
+
props.children = childArray;
|
416
|
+
}
|
417
|
+
if (type && type.defaultProps)
|
418
|
+
for (propName in ((childrenLength = type.defaultProps), childrenLength))
|
419
|
+
void 0 === props[propName] &&
|
420
|
+
(props[propName] = childrenLength[propName]);
|
421
|
+
return ReactElement(
|
422
|
+
type,
|
423
|
+
key,
|
424
|
+
null,
|
425
|
+
void 0,
|
426
|
+
void 0,
|
427
|
+
ReactSharedInternals.owner,
|
428
|
+
props
|
429
|
+
);
|
430
|
+
};
|
431
|
+
exports.createRef = function () {
|
432
|
+
return { current: null };
|
433
|
+
};
|
434
|
+
exports.forwardRef = function (render) {
|
435
|
+
return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };
|
1039
436
|
};
|
1040
|
-
|
1041
|
-
exports.Children = Children;
|
1042
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
1043
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
1044
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
1045
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
1046
|
-
exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
1047
|
-
exports.cache = cache;
|
1048
|
-
exports.cloneElement = cloneElement;
|
1049
|
-
exports.createElement = createElement;
|
1050
|
-
exports.createRef = createRef;
|
1051
|
-
exports.forwardRef = forwardRef;
|
1052
437
|
exports.isValidElement = isValidElement;
|
1053
|
-
exports.lazy =
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
exports.
|
1061
|
-
|
1062
|
-
|
438
|
+
exports.lazy = function (ctor) {
|
439
|
+
return {
|
440
|
+
$$typeof: REACT_LAZY_TYPE,
|
441
|
+
_payload: { _status: -1, _result: ctor },
|
442
|
+
_init: lazyInitializer
|
443
|
+
};
|
444
|
+
};
|
445
|
+
exports.memo = function (type, compare) {
|
446
|
+
return {
|
447
|
+
$$typeof: REACT_MEMO_TYPE,
|
448
|
+
type: type,
|
449
|
+
compare: void 0 === compare ? null : compare
|
450
|
+
};
|
451
|
+
};
|
452
|
+
exports.startTransition = function (scope) {
|
453
|
+
var prevTransition = ReactSharedInternals.T,
|
454
|
+
callbacks = new Set();
|
455
|
+
ReactSharedInternals.T = { _callbacks: callbacks };
|
456
|
+
var currentTransition = ReactSharedInternals.T;
|
457
|
+
try {
|
458
|
+
var returnValue = scope();
|
459
|
+
"object" === typeof returnValue &&
|
460
|
+
null !== returnValue &&
|
461
|
+
"function" === typeof returnValue.then &&
|
462
|
+
(callbacks.forEach(function (callback) {
|
463
|
+
return callback(currentTransition, returnValue);
|
464
|
+
}),
|
465
|
+
returnValue.then(noop, reportGlobalError));
|
466
|
+
} catch (error) {
|
467
|
+
reportGlobalError(error);
|
468
|
+
} finally {
|
469
|
+
ReactSharedInternals.T = prevTransition;
|
470
|
+
}
|
471
|
+
};
|
472
|
+
exports.use = function (usable) {
|
473
|
+
return ReactSharedInternals.H.use(usable);
|
474
|
+
};
|
475
|
+
exports.useActionState = function (action, initialState, permalink) {
|
476
|
+
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
477
|
+
};
|
478
|
+
exports.useCallback = function (callback, deps) {
|
479
|
+
return ReactSharedInternals.H.useCallback(callback, deps);
|
480
|
+
};
|
481
|
+
exports.useDebugValue = function () {};
|
482
|
+
exports.useId = function () {
|
483
|
+
return ReactSharedInternals.H.useId();
|
484
|
+
};
|
485
|
+
exports.useMemo = function (create, deps) {
|
486
|
+
return ReactSharedInternals.H.useMemo(create, deps);
|
487
|
+
};
|
488
|
+
exports.version = "19.0.0-canary-cb151849e1-20240424";
|