1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | if (process.env.NODE_ENV !== "production") {
|
14 | (function() {
|
15 |
|
16 | 'use strict';
|
17 |
|
18 |
|
19 | if (
|
20 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
21 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
22 | 'function'
|
23 | ) {
|
24 | __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
25 | }
|
26 | var ReactVersion = '18.1.0';
|
27 |
|
28 |
|
29 |
|
30 | var enableScopeAPI = false;
|
31 | var enableCacheElement = false;
|
32 | var enableTransitionTracing = false;
|
33 |
|
34 | var enableLegacyHidden = false;
|
35 |
|
36 |
|
37 |
|
38 | var enableDebugTracing = false;
|
39 |
|
40 |
|
41 |
|
42 | var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
43 | var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
44 | var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
45 | var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
46 | var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
47 | var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
48 | var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
49 | var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
50 | var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
51 | var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
52 | var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
53 | var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
54 | var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
55 | var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
56 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
57 | function getIteratorFn(maybeIterable) {
|
58 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
59 | return null;
|
60 | }
|
61 |
|
62 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
63 |
|
64 | if (typeof maybeIterator === 'function') {
|
65 | return maybeIterator;
|
66 | }
|
67 |
|
68 | return null;
|
69 | }
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | var ReactCurrentDispatcher = {
|
75 | |
76 |
|
77 |
|
78 |
|
79 | current: null
|
80 | };
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | var ReactCurrentBatchConfig = {
|
87 | transition: null
|
88 | };
|
89 |
|
90 | var ReactCurrentActQueue = {
|
91 | current: null,
|
92 |
|
93 | isBatchingLegacy: false,
|
94 | didScheduleLegacyUpdate: false
|
95 | };
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | var ReactCurrentOwner = {
|
104 | |
105 |
|
106 |
|
107 |
|
108 | current: null
|
109 | };
|
110 |
|
111 | var ReactDebugCurrentFrame = {};
|
112 | var currentExtraStackFrame = null;
|
113 | function setExtraStackFrame(stack) {
|
114 | {
|
115 | currentExtraStackFrame = stack;
|
116 | }
|
117 | }
|
118 |
|
119 | {
|
120 | ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
|
121 | {
|
122 | currentExtraStackFrame = stack;
|
123 | }
|
124 | };
|
125 |
|
126 |
|
127 | ReactDebugCurrentFrame.getCurrentStack = null;
|
128 |
|
129 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
130 | var stack = '';
|
131 |
|
132 | if (currentExtraStackFrame) {
|
133 | stack += currentExtraStackFrame;
|
134 | }
|
135 |
|
136 |
|
137 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
138 |
|
139 | if (impl) {
|
140 | stack += impl() || '';
|
141 | }
|
142 |
|
143 | return stack;
|
144 | };
|
145 | }
|
146 |
|
147 | var ReactSharedInternals = {
|
148 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
149 | ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
150 | ReactCurrentOwner: ReactCurrentOwner
|
151 | };
|
152 |
|
153 | {
|
154 | ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
155 | ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
156 | }
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 | function warn(format) {
|
164 | {
|
165 | {
|
166 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
167 | args[_key - 1] = arguments[_key];
|
168 | }
|
169 |
|
170 | printWarning('warn', format, args);
|
171 | }
|
172 | }
|
173 | }
|
174 | function error(format) {
|
175 | {
|
176 | {
|
177 | for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
178 | args[_key2 - 1] = arguments[_key2];
|
179 | }
|
180 |
|
181 | printWarning('error', format, args);
|
182 | }
|
183 | }
|
184 | }
|
185 |
|
186 | function printWarning(level, format, args) {
|
187 |
|
188 |
|
189 | {
|
190 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
191 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
192 |
|
193 | if (stack !== '') {
|
194 | format += '%s';
|
195 | args = args.concat([stack]);
|
196 | }
|
197 |
|
198 |
|
199 | var argsWithFormat = args.map(function (item) {
|
200 | return String(item);
|
201 | });
|
202 |
|
203 | argsWithFormat.unshift('Warning: ' + format);
|
204 |
|
205 |
|
206 |
|
207 | Function.prototype.apply.call(console[level], console, argsWithFormat);
|
208 | }
|
209 | }
|
210 |
|
211 | var didWarnStateUpdateForUnmountedComponent = {};
|
212 |
|
213 | function warnNoop(publicInstance, callerName) {
|
214 | {
|
215 | var _constructor = publicInstance.constructor;
|
216 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
217 | var warningKey = componentName + "." + callerName;
|
218 |
|
219 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
220 | return;
|
221 | }
|
222 |
|
223 | error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
224 |
|
225 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
226 | }
|
227 | }
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 | var ReactNoopUpdateQueue = {
|
234 | |
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 | isMounted: function (publicInstance) {
|
242 | return false;
|
243 | },
|
244 |
|
245 | |
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
261 | warnNoop(publicInstance, 'forceUpdate');
|
262 | },
|
263 |
|
264 | |
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
278 | warnNoop(publicInstance, 'replaceState');
|
279 | },
|
280 |
|
281 | |
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
294 | warnNoop(publicInstance, 'setState');
|
295 | }
|
296 | };
|
297 |
|
298 | var assign = Object.assign;
|
299 |
|
300 | var emptyObject = {};
|
301 |
|
302 | {
|
303 | Object.freeze(emptyObject);
|
304 | }
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 | function Component(props, context, updater) {
|
311 | this.props = props;
|
312 | this.context = context;
|
313 |
|
314 | this.refs = emptyObject;
|
315 |
|
316 |
|
317 | this.updater = updater || ReactNoopUpdateQueue;
|
318 | }
|
319 |
|
320 | Component.prototype.isReactComponent = {};
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 | Component.prototype.setState = function (partialState, callback) {
|
348 | if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
|
349 | throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
|
350 | }
|
351 |
|
352 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
353 | };
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 | Component.prototype.forceUpdate = function (callback) {
|
371 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
372 | };
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 | {
|
381 | var deprecatedAPIs = {
|
382 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
383 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
384 | };
|
385 |
|
386 | var defineDeprecationWarning = function (methodName, info) {
|
387 | Object.defineProperty(Component.prototype, methodName, {
|
388 | get: function () {
|
389 | warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
390 |
|
391 | return undefined;
|
392 | }
|
393 | });
|
394 | };
|
395 |
|
396 | for (var fnName in deprecatedAPIs) {
|
397 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
398 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
399 | }
|
400 | }
|
401 | }
|
402 |
|
403 | function ComponentDummy() {}
|
404 |
|
405 | ComponentDummy.prototype = Component.prototype;
|
406 |
|
407 |
|
408 |
|
409 |
|
410 | function PureComponent(props, context, updater) {
|
411 | this.props = props;
|
412 | this.context = context;
|
413 |
|
414 | this.refs = emptyObject;
|
415 | this.updater = updater || ReactNoopUpdateQueue;
|
416 | }
|
417 |
|
418 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
419 | pureComponentPrototype.constructor = PureComponent;
|
420 |
|
421 | assign(pureComponentPrototype, Component.prototype);
|
422 | pureComponentPrototype.isPureReactComponent = true;
|
423 |
|
424 |
|
425 | function createRef() {
|
426 | var refObject = {
|
427 | current: null
|
428 | };
|
429 |
|
430 | {
|
431 | Object.seal(refObject);
|
432 | }
|
433 |
|
434 | return refObject;
|
435 | }
|
436 |
|
437 | var isArrayImpl = Array.isArray;
|
438 |
|
439 | function isArray(a) {
|
440 | return isArrayImpl(a);
|
441 | }
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 | function typeName(value) {
|
454 | {
|
455 |
|
456 | var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
457 | var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
458 | return type;
|
459 | }
|
460 | }
|
461 |
|
462 |
|
463 | function willCoercionThrow(value) {
|
464 | {
|
465 | try {
|
466 | testStringCoercion(value);
|
467 | return false;
|
468 | } catch (e) {
|
469 | return true;
|
470 | }
|
471 | }
|
472 | }
|
473 |
|
474 | function testStringCoercion(value) {
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 | return '' + value;
|
499 | }
|
500 | function checkKeyStringCoercion(value) {
|
501 | {
|
502 | if (willCoercionThrow(value)) {
|
503 | error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
504 |
|
505 | return testStringCoercion(value);
|
506 | }
|
507 | }
|
508 | }
|
509 |
|
510 | function getWrappedName(outerType, innerType, wrapperName) {
|
511 | var displayName = outerType.displayName;
|
512 |
|
513 | if (displayName) {
|
514 | return displayName;
|
515 | }
|
516 |
|
517 | var functionName = innerType.displayName || innerType.name || '';
|
518 | return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
519 | }
|
520 |
|
521 |
|
522 | function getContextName(type) {
|
523 | return type.displayName || 'Context';
|
524 | }
|
525 |
|
526 |
|
527 | function getComponentNameFromType(type) {
|
528 | if (type == null) {
|
529 |
|
530 | return null;
|
531 | }
|
532 |
|
533 | {
|
534 | if (typeof type.tag === 'number') {
|
535 | error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
536 | }
|
537 | }
|
538 |
|
539 | if (typeof type === 'function') {
|
540 | return type.displayName || type.name || null;
|
541 | }
|
542 |
|
543 | if (typeof type === 'string') {
|
544 | return type;
|
545 | }
|
546 |
|
547 | switch (type) {
|
548 | case REACT_FRAGMENT_TYPE:
|
549 | return 'Fragment';
|
550 |
|
551 | case REACT_PORTAL_TYPE:
|
552 | return 'Portal';
|
553 |
|
554 | case REACT_PROFILER_TYPE:
|
555 | return 'Profiler';
|
556 |
|
557 | case REACT_STRICT_MODE_TYPE:
|
558 | return 'StrictMode';
|
559 |
|
560 | case REACT_SUSPENSE_TYPE:
|
561 | return 'Suspense';
|
562 |
|
563 | case REACT_SUSPENSE_LIST_TYPE:
|
564 | return 'SuspenseList';
|
565 |
|
566 | }
|
567 |
|
568 | if (typeof type === 'object') {
|
569 | switch (type.$$typeof) {
|
570 | case REACT_CONTEXT_TYPE:
|
571 | var context = type;
|
572 | return getContextName(context) + '.Consumer';
|
573 |
|
574 | case REACT_PROVIDER_TYPE:
|
575 | var provider = type;
|
576 | return getContextName(provider._context) + '.Provider';
|
577 |
|
578 | case REACT_FORWARD_REF_TYPE:
|
579 | return getWrappedName(type, type.render, 'ForwardRef');
|
580 |
|
581 | case REACT_MEMO_TYPE:
|
582 | var outerName = type.displayName || null;
|
583 |
|
584 | if (outerName !== null) {
|
585 | return outerName;
|
586 | }
|
587 |
|
588 | return getComponentNameFromType(type.type) || 'Memo';
|
589 |
|
590 | case REACT_LAZY_TYPE:
|
591 | {
|
592 | var lazyComponent = type;
|
593 | var payload = lazyComponent._payload;
|
594 | var init = lazyComponent._init;
|
595 |
|
596 | try {
|
597 | return getComponentNameFromType(init(payload));
|
598 | } catch (x) {
|
599 | return null;
|
600 | }
|
601 | }
|
602 |
|
603 |
|
604 | }
|
605 | }
|
606 |
|
607 | return null;
|
608 | }
|
609 |
|
610 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
611 |
|
612 | var RESERVED_PROPS = {
|
613 | key: true,
|
614 | ref: true,
|
615 | __self: true,
|
616 | __source: true
|
617 | };
|
618 | var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
619 |
|
620 | {
|
621 | didWarnAboutStringRefs = {};
|
622 | }
|
623 |
|
624 | function hasValidRef(config) {
|
625 | {
|
626 | if (hasOwnProperty.call(config, 'ref')) {
|
627 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
628 |
|
629 | if (getter && getter.isReactWarning) {
|
630 | return false;
|
631 | }
|
632 | }
|
633 | }
|
634 |
|
635 | return config.ref !== undefined;
|
636 | }
|
637 |
|
638 | function hasValidKey(config) {
|
639 | {
|
640 | if (hasOwnProperty.call(config, 'key')) {
|
641 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
642 |
|
643 | if (getter && getter.isReactWarning) {
|
644 | return false;
|
645 | }
|
646 | }
|
647 | }
|
648 |
|
649 | return config.key !== undefined;
|
650 | }
|
651 |
|
652 | function defineKeyPropWarningGetter(props, displayName) {
|
653 | var warnAboutAccessingKey = function () {
|
654 | {
|
655 | if (!specialPropKeyWarningShown) {
|
656 | specialPropKeyWarningShown = true;
|
657 |
|
658 | 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://reactjs.org/link/special-props)', displayName);
|
659 | }
|
660 | }
|
661 | };
|
662 |
|
663 | warnAboutAccessingKey.isReactWarning = true;
|
664 | Object.defineProperty(props, 'key', {
|
665 | get: warnAboutAccessingKey,
|
666 | configurable: true
|
667 | });
|
668 | }
|
669 |
|
670 | function defineRefPropWarningGetter(props, displayName) {
|
671 | var warnAboutAccessingRef = function () {
|
672 | {
|
673 | if (!specialPropRefWarningShown) {
|
674 | specialPropRefWarningShown = true;
|
675 |
|
676 | error('%s: `ref` 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://reactjs.org/link/special-props)', displayName);
|
677 | }
|
678 | }
|
679 | };
|
680 |
|
681 | warnAboutAccessingRef.isReactWarning = true;
|
682 | Object.defineProperty(props, 'ref', {
|
683 | get: warnAboutAccessingRef,
|
684 | configurable: true
|
685 | });
|
686 | }
|
687 |
|
688 | function warnIfStringRefCannotBeAutoConverted(config) {
|
689 | {
|
690 | if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
691 | var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
692 |
|
693 | if (!didWarnAboutStringRefs[componentName]) {
|
694 | error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
695 |
|
696 | didWarnAboutStringRefs[componentName] = true;
|
697 | }
|
698 | }
|
699 | }
|
700 | }
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 |
|
723 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
724 | var element = {
|
725 |
|
726 | $$typeof: REACT_ELEMENT_TYPE,
|
727 |
|
728 | type: type,
|
729 | key: key,
|
730 | ref: ref,
|
731 | props: props,
|
732 |
|
733 | _owner: owner
|
734 | };
|
735 |
|
736 | {
|
737 |
|
738 |
|
739 |
|
740 |
|
741 | element._store = {};
|
742 |
|
743 |
|
744 |
|
745 |
|
746 | Object.defineProperty(element._store, 'validated', {
|
747 | configurable: false,
|
748 | enumerable: false,
|
749 | writable: true,
|
750 | value: false
|
751 | });
|
752 |
|
753 | Object.defineProperty(element, '_self', {
|
754 | configurable: false,
|
755 | enumerable: false,
|
756 | writable: false,
|
757 | value: self
|
758 | });
|
759 |
|
760 |
|
761 | Object.defineProperty(element, '_source', {
|
762 | configurable: false,
|
763 | enumerable: false,
|
764 | writable: false,
|
765 | value: source
|
766 | });
|
767 |
|
768 | if (Object.freeze) {
|
769 | Object.freeze(element.props);
|
770 | Object.freeze(element);
|
771 | }
|
772 | }
|
773 |
|
774 | return element;
|
775 | };
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 | function createElement(type, config, children) {
|
782 | var propName;
|
783 |
|
784 | var props = {};
|
785 | var key = null;
|
786 | var ref = null;
|
787 | var self = null;
|
788 | var source = null;
|
789 |
|
790 | if (config != null) {
|
791 | if (hasValidRef(config)) {
|
792 | ref = config.ref;
|
793 |
|
794 | {
|
795 | warnIfStringRefCannotBeAutoConverted(config);
|
796 | }
|
797 | }
|
798 |
|
799 | if (hasValidKey(config)) {
|
800 | {
|
801 | checkKeyStringCoercion(config.key);
|
802 | }
|
803 |
|
804 | key = '' + config.key;
|
805 | }
|
806 |
|
807 | self = config.__self === undefined ? null : config.__self;
|
808 | source = config.__source === undefined ? null : config.__source;
|
809 |
|
810 | for (propName in config) {
|
811 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
812 | props[propName] = config[propName];
|
813 | }
|
814 | }
|
815 | }
|
816 |
|
817 |
|
818 |
|
819 | var childrenLength = arguments.length - 2;
|
820 |
|
821 | if (childrenLength === 1) {
|
822 | props.children = children;
|
823 | } else if (childrenLength > 1) {
|
824 | var childArray = Array(childrenLength);
|
825 |
|
826 | for (var i = 0; i < childrenLength; i++) {
|
827 | childArray[i] = arguments[i + 2];
|
828 | }
|
829 |
|
830 | {
|
831 | if (Object.freeze) {
|
832 | Object.freeze(childArray);
|
833 | }
|
834 | }
|
835 |
|
836 | props.children = childArray;
|
837 | }
|
838 |
|
839 |
|
840 | if (type && type.defaultProps) {
|
841 | var defaultProps = type.defaultProps;
|
842 |
|
843 | for (propName in defaultProps) {
|
844 | if (props[propName] === undefined) {
|
845 | props[propName] = defaultProps[propName];
|
846 | }
|
847 | }
|
848 | }
|
849 |
|
850 | {
|
851 | if (key || ref) {
|
852 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
853 |
|
854 | if (key) {
|
855 | defineKeyPropWarningGetter(props, displayName);
|
856 | }
|
857 |
|
858 | if (ref) {
|
859 | defineRefPropWarningGetter(props, displayName);
|
860 | }
|
861 | }
|
862 | }
|
863 |
|
864 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
865 | }
|
866 | function cloneAndReplaceKey(oldElement, newKey) {
|
867 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
868 | return newElement;
|
869 | }
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 | function cloneElement(element, config, children) {
|
876 | if (element === null || element === undefined) {
|
877 | throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
878 | }
|
879 |
|
880 | var propName;
|
881 |
|
882 | var props = assign({}, element.props);
|
883 |
|
884 | var key = element.key;
|
885 | var ref = element.ref;
|
886 |
|
887 | var self = element._self;
|
888 |
|
889 |
|
890 |
|
891 | var source = element._source;
|
892 |
|
893 | var owner = element._owner;
|
894 |
|
895 | if (config != null) {
|
896 | if (hasValidRef(config)) {
|
897 |
|
898 | ref = config.ref;
|
899 | owner = ReactCurrentOwner.current;
|
900 | }
|
901 |
|
902 | if (hasValidKey(config)) {
|
903 | {
|
904 | checkKeyStringCoercion(config.key);
|
905 | }
|
906 |
|
907 | key = '' + config.key;
|
908 | }
|
909 |
|
910 |
|
911 | var defaultProps;
|
912 |
|
913 | if (element.type && element.type.defaultProps) {
|
914 | defaultProps = element.type.defaultProps;
|
915 | }
|
916 |
|
917 | for (propName in config) {
|
918 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
919 | if (config[propName] === undefined && defaultProps !== undefined) {
|
920 |
|
921 | props[propName] = defaultProps[propName];
|
922 | } else {
|
923 | props[propName] = config[propName];
|
924 | }
|
925 | }
|
926 | }
|
927 | }
|
928 |
|
929 |
|
930 |
|
931 | var childrenLength = arguments.length - 2;
|
932 |
|
933 | if (childrenLength === 1) {
|
934 | props.children = children;
|
935 | } else if (childrenLength > 1) {
|
936 | var childArray = Array(childrenLength);
|
937 |
|
938 | for (var i = 0; i < childrenLength; i++) {
|
939 | childArray[i] = arguments[i + 2];
|
940 | }
|
941 |
|
942 | props.children = childArray;
|
943 | }
|
944 |
|
945 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
946 | }
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 | function isValidElement(object) {
|
956 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
957 | }
|
958 |
|
959 | var SEPARATOR = '.';
|
960 | var SUBSEPARATOR = ':';
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 |
|
968 | function escape(key) {
|
969 | var escapeRegex = /[=:]/g;
|
970 | var escaperLookup = {
|
971 | '=': '=0',
|
972 | ':': '=2'
|
973 | };
|
974 | var escapedString = key.replace(escapeRegex, function (match) {
|
975 | return escaperLookup[match];
|
976 | });
|
977 | return '$' + escapedString;
|
978 | }
|
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 | var didWarnAboutMaps = false;
|
986 | var userProvidedKeyEscapeRegex = /\/+/g;
|
987 |
|
988 | function escapeUserProvidedKey(text) {
|
989 | return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
990 | }
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 | function getElementKey(element, index) {
|
1001 |
|
1002 |
|
1003 | if (typeof element === 'object' && element !== null && element.key != null) {
|
1004 |
|
1005 | {
|
1006 | checkKeyStringCoercion(element.key);
|
1007 | }
|
1008 |
|
1009 | return escape('' + element.key);
|
1010 | }
|
1011 |
|
1012 |
|
1013 | return index.toString(36);
|
1014 | }
|
1015 |
|
1016 | function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
1017 | var type = typeof children;
|
1018 |
|
1019 | if (type === 'undefined' || type === 'boolean') {
|
1020 |
|
1021 | children = null;
|
1022 | }
|
1023 |
|
1024 | var invokeCallback = false;
|
1025 |
|
1026 | if (children === null) {
|
1027 | invokeCallback = true;
|
1028 | } else {
|
1029 | switch (type) {
|
1030 | case 'string':
|
1031 | case 'number':
|
1032 | invokeCallback = true;
|
1033 | break;
|
1034 |
|
1035 | case 'object':
|
1036 | switch (children.$$typeof) {
|
1037 | case REACT_ELEMENT_TYPE:
|
1038 | case REACT_PORTAL_TYPE:
|
1039 | invokeCallback = true;
|
1040 | }
|
1041 |
|
1042 | }
|
1043 | }
|
1044 |
|
1045 | if (invokeCallback) {
|
1046 | var _child = children;
|
1047 | var mappedChild = callback(_child);
|
1048 |
|
1049 |
|
1050 | var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
1051 |
|
1052 | if (isArray(mappedChild)) {
|
1053 | var escapedChildKey = '';
|
1054 |
|
1055 | if (childKey != null) {
|
1056 | escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
1057 | }
|
1058 |
|
1059 | mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
|
1060 | return c;
|
1061 | });
|
1062 | } else if (mappedChild != null) {
|
1063 | if (isValidElement(mappedChild)) {
|
1064 | {
|
1065 |
|
1066 |
|
1067 |
|
1068 | if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
1069 | checkKeyStringCoercion(mappedChild.key);
|
1070 | }
|
1071 | }
|
1072 |
|
1073 | mappedChild = cloneAndReplaceKey(mappedChild,
|
1074 |
|
1075 | escapedPrefix + (
|
1076 | mappedChild.key && (!_child || _child.key !== mappedChild.key) ?
|
1077 |
|
1078 | escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
1079 | }
|
1080 |
|
1081 | array.push(mappedChild);
|
1082 | }
|
1083 |
|
1084 | return 1;
|
1085 | }
|
1086 |
|
1087 | var child;
|
1088 | var nextName;
|
1089 | var subtreeCount = 0;
|
1090 |
|
1091 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1092 |
|
1093 | if (isArray(children)) {
|
1094 | for (var i = 0; i < children.length; i++) {
|
1095 | child = children[i];
|
1096 | nextName = nextNamePrefix + getElementKey(child, i);
|
1097 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1098 | }
|
1099 | } else {
|
1100 | var iteratorFn = getIteratorFn(children);
|
1101 |
|
1102 | if (typeof iteratorFn === 'function') {
|
1103 | var iterableChildren = children;
|
1104 |
|
1105 | {
|
1106 |
|
1107 | if (iteratorFn === iterableChildren.entries) {
|
1108 | if (!didWarnAboutMaps) {
|
1109 | warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
1110 | }
|
1111 |
|
1112 | didWarnAboutMaps = true;
|
1113 | }
|
1114 | }
|
1115 |
|
1116 | var iterator = iteratorFn.call(iterableChildren);
|
1117 | var step;
|
1118 | var ii = 0;
|
1119 |
|
1120 | while (!(step = iterator.next()).done) {
|
1121 | child = step.value;
|
1122 | nextName = nextNamePrefix + getElementKey(child, ii++);
|
1123 | subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
1124 | }
|
1125 | } else if (type === 'object') {
|
1126 |
|
1127 | var childrenString = String(children);
|
1128 | 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.');
|
1129 | }
|
1130 | }
|
1131 |
|
1132 | return subtreeCount;
|
1133 | }
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 | function mapChildren(children, func, context) {
|
1149 | if (children == null) {
|
1150 | return children;
|
1151 | }
|
1152 |
|
1153 | var result = [];
|
1154 | var count = 0;
|
1155 | mapIntoArray(children, result, '', '', function (child) {
|
1156 | return func.call(context, child, count++);
|
1157 | });
|
1158 | return result;
|
1159 | }
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 | function countChildren(children) {
|
1172 | var n = 0;
|
1173 | mapChildren(children, function () {
|
1174 | n++;
|
1175 | });
|
1176 | return n;
|
1177 | }
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 | function forEachChildren(children, forEachFunc, forEachContext) {
|
1192 | mapChildren(children, function () {
|
1193 | forEachFunc.apply(this, arguments);
|
1194 | }, forEachContext);
|
1195 | }
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 | function toArray(children) {
|
1205 | return mapChildren(children, function (child) {
|
1206 | return child;
|
1207 | }) || [];
|
1208 | }
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 | function onlyChild(children) {
|
1226 | if (!isValidElement(children)) {
|
1227 | throw new Error('React.Children.only expected to receive a single React element child.');
|
1228 | }
|
1229 |
|
1230 | return children;
|
1231 | }
|
1232 |
|
1233 | function createContext(defaultValue) {
|
1234 |
|
1235 |
|
1236 | var context = {
|
1237 | $$typeof: REACT_CONTEXT_TYPE,
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 | _currentValue: defaultValue,
|
1244 | _currentValue2: defaultValue,
|
1245 |
|
1246 |
|
1247 | _threadCount: 0,
|
1248 |
|
1249 | Provider: null,
|
1250 | Consumer: null,
|
1251 |
|
1252 | _defaultValue: null,
|
1253 | _globalName: null
|
1254 | };
|
1255 | context.Provider = {
|
1256 | $$typeof: REACT_PROVIDER_TYPE,
|
1257 | _context: context
|
1258 | };
|
1259 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
1260 | var hasWarnedAboutUsingConsumerProvider = false;
|
1261 | var hasWarnedAboutDisplayNameOnConsumer = false;
|
1262 |
|
1263 | {
|
1264 |
|
1265 |
|
1266 |
|
1267 | var Consumer = {
|
1268 | $$typeof: REACT_CONTEXT_TYPE,
|
1269 | _context: context
|
1270 | };
|
1271 |
|
1272 | Object.defineProperties(Consumer, {
|
1273 | Provider: {
|
1274 | get: function () {
|
1275 | if (!hasWarnedAboutUsingConsumerProvider) {
|
1276 | hasWarnedAboutUsingConsumerProvider = true;
|
1277 |
|
1278 | error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
1279 | }
|
1280 |
|
1281 | return context.Provider;
|
1282 | },
|
1283 | set: function (_Provider) {
|
1284 | context.Provider = _Provider;
|
1285 | }
|
1286 | },
|
1287 | _currentValue: {
|
1288 | get: function () {
|
1289 | return context._currentValue;
|
1290 | },
|
1291 | set: function (_currentValue) {
|
1292 | context._currentValue = _currentValue;
|
1293 | }
|
1294 | },
|
1295 | _currentValue2: {
|
1296 | get: function () {
|
1297 | return context._currentValue2;
|
1298 | },
|
1299 | set: function (_currentValue2) {
|
1300 | context._currentValue2 = _currentValue2;
|
1301 | }
|
1302 | },
|
1303 | _threadCount: {
|
1304 | get: function () {
|
1305 | return context._threadCount;
|
1306 | },
|
1307 | set: function (_threadCount) {
|
1308 | context._threadCount = _threadCount;
|
1309 | }
|
1310 | },
|
1311 | Consumer: {
|
1312 | get: function () {
|
1313 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
1314 | hasWarnedAboutUsingNestedContextConsumers = true;
|
1315 |
|
1316 | error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
1317 | }
|
1318 |
|
1319 | return context.Consumer;
|
1320 | }
|
1321 | },
|
1322 | displayName: {
|
1323 | get: function () {
|
1324 | return context.displayName;
|
1325 | },
|
1326 | set: function (displayName) {
|
1327 | if (!hasWarnedAboutDisplayNameOnConsumer) {
|
1328 | warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
1329 |
|
1330 | hasWarnedAboutDisplayNameOnConsumer = true;
|
1331 | }
|
1332 | }
|
1333 | }
|
1334 | });
|
1335 |
|
1336 | context.Consumer = Consumer;
|
1337 | }
|
1338 |
|
1339 | {
|
1340 | context._currentRenderer = null;
|
1341 | context._currentRenderer2 = null;
|
1342 | }
|
1343 |
|
1344 | return context;
|
1345 | }
|
1346 |
|
1347 | var Uninitialized = -1;
|
1348 | var Pending = 0;
|
1349 | var Resolved = 1;
|
1350 | var Rejected = 2;
|
1351 |
|
1352 | function lazyInitializer(payload) {
|
1353 | if (payload._status === Uninitialized) {
|
1354 | var ctor = payload._result;
|
1355 | var thenable = ctor();
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 |
|
1361 | thenable.then(function (moduleObject) {
|
1362 | if (payload._status === Pending || payload._status === Uninitialized) {
|
1363 |
|
1364 | var resolved = payload;
|
1365 | resolved._status = Resolved;
|
1366 | resolved._result = moduleObject;
|
1367 | }
|
1368 | }, function (error) {
|
1369 | if (payload._status === Pending || payload._status === Uninitialized) {
|
1370 |
|
1371 | var rejected = payload;
|
1372 | rejected._status = Rejected;
|
1373 | rejected._result = error;
|
1374 | }
|
1375 | });
|
1376 |
|
1377 | if (payload._status === Uninitialized) {
|
1378 |
|
1379 |
|
1380 | var pending = payload;
|
1381 | pending._status = Pending;
|
1382 | pending._result = thenable;
|
1383 | }
|
1384 | }
|
1385 |
|
1386 | if (payload._status === Resolved) {
|
1387 | var moduleObject = payload._result;
|
1388 |
|
1389 | {
|
1390 | if (moduleObject === undefined) {
|
1391 | error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' +
|
1392 | 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
1393 | }
|
1394 | }
|
1395 |
|
1396 | {
|
1397 | if (!('default' in moduleObject)) {
|
1398 | error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' +
|
1399 | 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
1400 | }
|
1401 | }
|
1402 |
|
1403 | return moduleObject.default;
|
1404 | } else {
|
1405 | throw payload._result;
|
1406 | }
|
1407 | }
|
1408 |
|
1409 | function lazy(ctor) {
|
1410 | var payload = {
|
1411 |
|
1412 | _status: Uninitialized,
|
1413 | _result: ctor
|
1414 | };
|
1415 | var lazyType = {
|
1416 | $$typeof: REACT_LAZY_TYPE,
|
1417 | _payload: payload,
|
1418 | _init: lazyInitializer
|
1419 | };
|
1420 |
|
1421 | {
|
1422 |
|
1423 | var defaultProps;
|
1424 | var propTypes;
|
1425 |
|
1426 | Object.defineProperties(lazyType, {
|
1427 | defaultProps: {
|
1428 | configurable: true,
|
1429 | get: function () {
|
1430 | return defaultProps;
|
1431 | },
|
1432 | set: function (newDefaultProps) {
|
1433 | error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1434 |
|
1435 | defaultProps = newDefaultProps;
|
1436 |
|
1437 |
|
1438 | Object.defineProperty(lazyType, 'defaultProps', {
|
1439 | enumerable: true
|
1440 | });
|
1441 | }
|
1442 | },
|
1443 | propTypes: {
|
1444 | configurable: true,
|
1445 | get: function () {
|
1446 | return propTypes;
|
1447 | },
|
1448 | set: function (newPropTypes) {
|
1449 | error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
1450 |
|
1451 | propTypes = newPropTypes;
|
1452 |
|
1453 |
|
1454 | Object.defineProperty(lazyType, 'propTypes', {
|
1455 | enumerable: true
|
1456 | });
|
1457 | }
|
1458 | }
|
1459 | });
|
1460 | }
|
1461 |
|
1462 | return lazyType;
|
1463 | }
|
1464 |
|
1465 | function forwardRef(render) {
|
1466 | {
|
1467 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1468 | error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1469 | } else if (typeof render !== 'function') {
|
1470 | error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1471 | } else {
|
1472 | if (render.length !== 0 && render.length !== 2) {
|
1473 | 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.');
|
1474 | }
|
1475 | }
|
1476 |
|
1477 | if (render != null) {
|
1478 | if (render.defaultProps != null || render.propTypes != null) {
|
1479 | error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
1480 | }
|
1481 | }
|
1482 | }
|
1483 |
|
1484 | var elementType = {
|
1485 | $$typeof: REACT_FORWARD_REF_TYPE,
|
1486 | render: render
|
1487 | };
|
1488 |
|
1489 | {
|
1490 | var ownName;
|
1491 | Object.defineProperty(elementType, 'displayName', {
|
1492 | enumerable: false,
|
1493 | configurable: true,
|
1494 | get: function () {
|
1495 | return ownName;
|
1496 | },
|
1497 | set: function (name) {
|
1498 | ownName = name;
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 |
|
1505 |
|
1506 | if (!render.name && !render.displayName) {
|
1507 | render.displayName = name;
|
1508 | }
|
1509 | }
|
1510 | });
|
1511 | }
|
1512 |
|
1513 | return elementType;
|
1514 | }
|
1515 |
|
1516 | var REACT_MODULE_REFERENCE;
|
1517 |
|
1518 | {
|
1519 | REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
1520 | }
|
1521 |
|
1522 | function isValidElementType(type) {
|
1523 | if (typeof type === 'string' || typeof type === 'function') {
|
1524 | return true;
|
1525 | }
|
1526 |
|
1527 |
|
1528 | 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 || enableCacheElement || enableTransitionTracing ) {
|
1529 | return true;
|
1530 | }
|
1531 |
|
1532 | if (typeof type === 'object' && type !== null) {
|
1533 | if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
1534 |
|
1535 |
|
1536 |
|
1537 | type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
1538 | return true;
|
1539 | }
|
1540 | }
|
1541 |
|
1542 | return false;
|
1543 | }
|
1544 |
|
1545 | function memo(type, compare) {
|
1546 | {
|
1547 | if (!isValidElementType(type)) {
|
1548 | error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
1549 | }
|
1550 | }
|
1551 |
|
1552 | var elementType = {
|
1553 | $$typeof: REACT_MEMO_TYPE,
|
1554 | type: type,
|
1555 | compare: compare === undefined ? null : compare
|
1556 | };
|
1557 |
|
1558 | {
|
1559 | var ownName;
|
1560 | Object.defineProperty(elementType, 'displayName', {
|
1561 | enumerable: false,
|
1562 | configurable: true,
|
1563 | get: function () {
|
1564 | return ownName;
|
1565 | },
|
1566 | set: function (name) {
|
1567 | ownName = name;
|
1568 |
|
1569 |
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 | if (!type.name && !type.displayName) {
|
1576 | type.displayName = name;
|
1577 | }
|
1578 | }
|
1579 | });
|
1580 | }
|
1581 |
|
1582 | return elementType;
|
1583 | }
|
1584 |
|
1585 | function resolveDispatcher() {
|
1586 | var dispatcher = ReactCurrentDispatcher.current;
|
1587 |
|
1588 | {
|
1589 | if (dispatcher === null) {
|
1590 | 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
1591 | }
|
1592 | }
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 | return dispatcher;
|
1598 | }
|
1599 | function useContext(Context) {
|
1600 | var dispatcher = resolveDispatcher();
|
1601 |
|
1602 | {
|
1603 |
|
1604 | if (Context._context !== undefined) {
|
1605 | var realContext = Context._context;
|
1606 |
|
1607 |
|
1608 | if (realContext.Consumer === Context) {
|
1609 | error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
1610 | } else if (realContext.Provider === Context) {
|
1611 | error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
1612 | }
|
1613 | }
|
1614 | }
|
1615 |
|
1616 | return dispatcher.useContext(Context);
|
1617 | }
|
1618 | function useState(initialState) {
|
1619 | var dispatcher = resolveDispatcher();
|
1620 | return dispatcher.useState(initialState);
|
1621 | }
|
1622 | function useReducer(reducer, initialArg, init) {
|
1623 | var dispatcher = resolveDispatcher();
|
1624 | return dispatcher.useReducer(reducer, initialArg, init);
|
1625 | }
|
1626 | function useRef(initialValue) {
|
1627 | var dispatcher = resolveDispatcher();
|
1628 | return dispatcher.useRef(initialValue);
|
1629 | }
|
1630 | function useEffect(create, deps) {
|
1631 | var dispatcher = resolveDispatcher();
|
1632 | return dispatcher.useEffect(create, deps);
|
1633 | }
|
1634 | function useInsertionEffect(create, deps) {
|
1635 | var dispatcher = resolveDispatcher();
|
1636 | return dispatcher.useInsertionEffect(create, deps);
|
1637 | }
|
1638 | function useLayoutEffect(create, deps) {
|
1639 | var dispatcher = resolveDispatcher();
|
1640 | return dispatcher.useLayoutEffect(create, deps);
|
1641 | }
|
1642 | function useCallback(callback, deps) {
|
1643 | var dispatcher = resolveDispatcher();
|
1644 | return dispatcher.useCallback(callback, deps);
|
1645 | }
|
1646 | function useMemo(create, deps) {
|
1647 | var dispatcher = resolveDispatcher();
|
1648 | return dispatcher.useMemo(create, deps);
|
1649 | }
|
1650 | function useImperativeHandle(ref, create, deps) {
|
1651 | var dispatcher = resolveDispatcher();
|
1652 | return dispatcher.useImperativeHandle(ref, create, deps);
|
1653 | }
|
1654 | function useDebugValue(value, formatterFn) {
|
1655 | {
|
1656 | var dispatcher = resolveDispatcher();
|
1657 | return dispatcher.useDebugValue(value, formatterFn);
|
1658 | }
|
1659 | }
|
1660 | function useTransition() {
|
1661 | var dispatcher = resolveDispatcher();
|
1662 | return dispatcher.useTransition();
|
1663 | }
|
1664 | function useDeferredValue(value) {
|
1665 | var dispatcher = resolveDispatcher();
|
1666 | return dispatcher.useDeferredValue(value);
|
1667 | }
|
1668 | function useId() {
|
1669 | var dispatcher = resolveDispatcher();
|
1670 | return dispatcher.useId();
|
1671 | }
|
1672 | function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
1673 | var dispatcher = resolveDispatcher();
|
1674 | return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
1675 | }
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 | var disabledDepth = 0;
|
1682 | var prevLog;
|
1683 | var prevInfo;
|
1684 | var prevWarn;
|
1685 | var prevError;
|
1686 | var prevGroup;
|
1687 | var prevGroupCollapsed;
|
1688 | var prevGroupEnd;
|
1689 |
|
1690 | function disabledLog() {}
|
1691 |
|
1692 | disabledLog.__reactDisabledLog = true;
|
1693 | function disableLogs() {
|
1694 | {
|
1695 | if (disabledDepth === 0) {
|
1696 |
|
1697 | prevLog = console.log;
|
1698 | prevInfo = console.info;
|
1699 | prevWarn = console.warn;
|
1700 | prevError = console.error;
|
1701 | prevGroup = console.group;
|
1702 | prevGroupCollapsed = console.groupCollapsed;
|
1703 | prevGroupEnd = console.groupEnd;
|
1704 |
|
1705 | var props = {
|
1706 | configurable: true,
|
1707 | enumerable: true,
|
1708 | value: disabledLog,
|
1709 | writable: true
|
1710 | };
|
1711 |
|
1712 | Object.defineProperties(console, {
|
1713 | info: props,
|
1714 | log: props,
|
1715 | warn: props,
|
1716 | error: props,
|
1717 | group: props,
|
1718 | groupCollapsed: props,
|
1719 | groupEnd: props
|
1720 | });
|
1721 |
|
1722 | }
|
1723 |
|
1724 | disabledDepth++;
|
1725 | }
|
1726 | }
|
1727 | function reenableLogs() {
|
1728 | {
|
1729 | disabledDepth--;
|
1730 |
|
1731 | if (disabledDepth === 0) {
|
1732 |
|
1733 | var props = {
|
1734 | configurable: true,
|
1735 | enumerable: true,
|
1736 | writable: true
|
1737 | };
|
1738 |
|
1739 | Object.defineProperties(console, {
|
1740 | log: assign({}, props, {
|
1741 | value: prevLog
|
1742 | }),
|
1743 | info: assign({}, props, {
|
1744 | value: prevInfo
|
1745 | }),
|
1746 | warn: assign({}, props, {
|
1747 | value: prevWarn
|
1748 | }),
|
1749 | error: assign({}, props, {
|
1750 | value: prevError
|
1751 | }),
|
1752 | group: assign({}, props, {
|
1753 | value: prevGroup
|
1754 | }),
|
1755 | groupCollapsed: assign({}, props, {
|
1756 | value: prevGroupCollapsed
|
1757 | }),
|
1758 | groupEnd: assign({}, props, {
|
1759 | value: prevGroupEnd
|
1760 | })
|
1761 | });
|
1762 |
|
1763 | }
|
1764 |
|
1765 | if (disabledDepth < 0) {
|
1766 | error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
1767 | }
|
1768 | }
|
1769 | }
|
1770 |
|
1771 | var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
1772 | var prefix;
|
1773 | function describeBuiltInComponentFrame(name, source, ownerFn) {
|
1774 | {
|
1775 | if (prefix === undefined) {
|
1776 |
|
1777 | try {
|
1778 | throw Error();
|
1779 | } catch (x) {
|
1780 | var match = x.stack.trim().match(/\n( *(at )?)/);
|
1781 | prefix = match && match[1] || '';
|
1782 | }
|
1783 | }
|
1784 |
|
1785 |
|
1786 | return '\n' + prefix + name;
|
1787 | }
|
1788 | }
|
1789 | var reentry = false;
|
1790 | var componentFrameCache;
|
1791 |
|
1792 | {
|
1793 | var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
1794 | componentFrameCache = new PossiblyWeakMap();
|
1795 | }
|
1796 |
|
1797 | function describeNativeComponentFrame(fn, construct) {
|
1798 |
|
1799 | if ( !fn || reentry) {
|
1800 | return '';
|
1801 | }
|
1802 |
|
1803 | {
|
1804 | var frame = componentFrameCache.get(fn);
|
1805 |
|
1806 | if (frame !== undefined) {
|
1807 | return frame;
|
1808 | }
|
1809 | }
|
1810 |
|
1811 | var control;
|
1812 | reentry = true;
|
1813 | var previousPrepareStackTrace = Error.prepareStackTrace;
|
1814 |
|
1815 | Error.prepareStackTrace = undefined;
|
1816 | var previousDispatcher;
|
1817 |
|
1818 | {
|
1819 | previousDispatcher = ReactCurrentDispatcher$1.current;
|
1820 |
|
1821 |
|
1822 | ReactCurrentDispatcher$1.current = null;
|
1823 | disableLogs();
|
1824 | }
|
1825 |
|
1826 | try {
|
1827 |
|
1828 | if (construct) {
|
1829 |
|
1830 | var Fake = function () {
|
1831 | throw Error();
|
1832 | };
|
1833 |
|
1834 |
|
1835 | Object.defineProperty(Fake.prototype, 'props', {
|
1836 | set: function () {
|
1837 |
|
1838 |
|
1839 | throw Error();
|
1840 | }
|
1841 | });
|
1842 |
|
1843 | if (typeof Reflect === 'object' && Reflect.construct) {
|
1844 |
|
1845 |
|
1846 | try {
|
1847 | Reflect.construct(Fake, []);
|
1848 | } catch (x) {
|
1849 | control = x;
|
1850 | }
|
1851 |
|
1852 | Reflect.construct(fn, [], Fake);
|
1853 | } else {
|
1854 | try {
|
1855 | Fake.call();
|
1856 | } catch (x) {
|
1857 | control = x;
|
1858 | }
|
1859 |
|
1860 | fn.call(Fake.prototype);
|
1861 | }
|
1862 | } else {
|
1863 | try {
|
1864 | throw Error();
|
1865 | } catch (x) {
|
1866 | control = x;
|
1867 | }
|
1868 |
|
1869 | fn();
|
1870 | }
|
1871 | } catch (sample) {
|
1872 |
|
1873 | if (sample && control && typeof sample.stack === 'string') {
|
1874 |
|
1875 |
|
1876 | var sampleLines = sample.stack.split('\n');
|
1877 | var controlLines = control.stack.split('\n');
|
1878 | var s = sampleLines.length - 1;
|
1879 | var c = controlLines.length - 1;
|
1880 |
|
1881 | while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 | c--;
|
1889 | }
|
1890 |
|
1891 | for (; s >= 1 && c >= 0; s--, c--) {
|
1892 |
|
1893 |
|
1894 | if (sampleLines[s] !== controlLines[c]) {
|
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 | if (s !== 1 || c !== 1) {
|
1901 | do {
|
1902 | s--;
|
1903 | c--;
|
1904 |
|
1905 |
|
1906 | if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
1907 |
|
1908 | var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
1909 |
|
1910 |
|
1911 |
|
1912 |
|
1913 | if (fn.displayName && _frame.includes('<anonymous>')) {
|
1914 | _frame = _frame.replace('<anonymous>', fn.displayName);
|
1915 | }
|
1916 |
|
1917 | {
|
1918 | if (typeof fn === 'function') {
|
1919 | componentFrameCache.set(fn, _frame);
|
1920 | }
|
1921 | }
|
1922 |
|
1923 |
|
1924 | return _frame;
|
1925 | }
|
1926 | } while (s >= 1 && c >= 0);
|
1927 | }
|
1928 |
|
1929 | break;
|
1930 | }
|
1931 | }
|
1932 | }
|
1933 | } finally {
|
1934 | reentry = false;
|
1935 |
|
1936 | {
|
1937 | ReactCurrentDispatcher$1.current = previousDispatcher;
|
1938 | reenableLogs();
|
1939 | }
|
1940 |
|
1941 | Error.prepareStackTrace = previousPrepareStackTrace;
|
1942 | }
|
1943 |
|
1944 |
|
1945 | var name = fn ? fn.displayName || fn.name : '';
|
1946 | var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
1947 |
|
1948 | {
|
1949 | if (typeof fn === 'function') {
|
1950 | componentFrameCache.set(fn, syntheticFrame);
|
1951 | }
|
1952 | }
|
1953 |
|
1954 | return syntheticFrame;
|
1955 | }
|
1956 | function describeFunctionComponentFrame(fn, source, ownerFn) {
|
1957 | {
|
1958 | return describeNativeComponentFrame(fn, false);
|
1959 | }
|
1960 | }
|
1961 |
|
1962 | function shouldConstruct(Component) {
|
1963 | var prototype = Component.prototype;
|
1964 | return !!(prototype && prototype.isReactComponent);
|
1965 | }
|
1966 |
|
1967 | function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
1968 |
|
1969 | if (type == null) {
|
1970 | return '';
|
1971 | }
|
1972 |
|
1973 | if (typeof type === 'function') {
|
1974 | {
|
1975 | return describeNativeComponentFrame(type, shouldConstruct(type));
|
1976 | }
|
1977 | }
|
1978 |
|
1979 | if (typeof type === 'string') {
|
1980 | return describeBuiltInComponentFrame(type);
|
1981 | }
|
1982 |
|
1983 | switch (type) {
|
1984 | case REACT_SUSPENSE_TYPE:
|
1985 | return describeBuiltInComponentFrame('Suspense');
|
1986 |
|
1987 | case REACT_SUSPENSE_LIST_TYPE:
|
1988 | return describeBuiltInComponentFrame('SuspenseList');
|
1989 | }
|
1990 |
|
1991 | if (typeof type === 'object') {
|
1992 | switch (type.$$typeof) {
|
1993 | case REACT_FORWARD_REF_TYPE:
|
1994 | return describeFunctionComponentFrame(type.render);
|
1995 |
|
1996 | case REACT_MEMO_TYPE:
|
1997 |
|
1998 | return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
1999 |
|
2000 | case REACT_LAZY_TYPE:
|
2001 | {
|
2002 | var lazyComponent = type;
|
2003 | var payload = lazyComponent._payload;
|
2004 | var init = lazyComponent._init;
|
2005 |
|
2006 | try {
|
2007 |
|
2008 | return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
2009 | } catch (x) {}
|
2010 | }
|
2011 | }
|
2012 | }
|
2013 |
|
2014 | return '';
|
2015 | }
|
2016 |
|
2017 | var loggedTypeFailures = {};
|
2018 | var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
2019 |
|
2020 | function setCurrentlyValidatingElement(element) {
|
2021 | {
|
2022 | if (element) {
|
2023 | var owner = element._owner;
|
2024 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2025 | ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
2026 | } else {
|
2027 | ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
2028 | }
|
2029 | }
|
2030 | }
|
2031 |
|
2032 | function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
2033 | {
|
2034 |
|
2035 | var has = Function.call.bind(hasOwnProperty);
|
2036 |
|
2037 | for (var typeSpecName in typeSpecs) {
|
2038 | if (has(typeSpecs, typeSpecName)) {
|
2039 | var error$1 = void 0;
|
2040 |
|
2041 |
|
2042 |
|
2043 | try {
|
2044 |
|
2045 |
|
2046 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
2047 |
|
2048 | var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
2049 | err.name = 'Invariant Violation';
|
2050 | throw err;
|
2051 | }
|
2052 |
|
2053 | error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
2054 | } catch (ex) {
|
2055 | error$1 = ex;
|
2056 | }
|
2057 |
|
2058 | if (error$1 && !(error$1 instanceof Error)) {
|
2059 | setCurrentlyValidatingElement(element);
|
2060 |
|
2061 | error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
2062 |
|
2063 | setCurrentlyValidatingElement(null);
|
2064 | }
|
2065 |
|
2066 | if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
2067 |
|
2068 |
|
2069 | loggedTypeFailures[error$1.message] = true;
|
2070 | setCurrentlyValidatingElement(element);
|
2071 |
|
2072 | error('Failed %s type: %s', location, error$1.message);
|
2073 |
|
2074 | setCurrentlyValidatingElement(null);
|
2075 | }
|
2076 | }
|
2077 | }
|
2078 | }
|
2079 | }
|
2080 |
|
2081 | function setCurrentlyValidatingElement$1(element) {
|
2082 | {
|
2083 | if (element) {
|
2084 | var owner = element._owner;
|
2085 | var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2086 | setExtraStackFrame(stack);
|
2087 | } else {
|
2088 | setExtraStackFrame(null);
|
2089 | }
|
2090 | }
|
2091 | }
|
2092 |
|
2093 | var propTypesMisspellWarningShown;
|
2094 |
|
2095 | {
|
2096 | propTypesMisspellWarningShown = false;
|
2097 | }
|
2098 |
|
2099 | function getDeclarationErrorAddendum() {
|
2100 | if (ReactCurrentOwner.current) {
|
2101 | var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
2102 |
|
2103 | if (name) {
|
2104 | return '\n\nCheck the render method of `' + name + '`.';
|
2105 | }
|
2106 | }
|
2107 |
|
2108 | return '';
|
2109 | }
|
2110 |
|
2111 | function getSourceInfoErrorAddendum(source) {
|
2112 | if (source !== undefined) {
|
2113 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
2114 | var lineNumber = source.lineNumber;
|
2115 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
2116 | }
|
2117 |
|
2118 | return '';
|
2119 | }
|
2120 |
|
2121 | function getSourceInfoErrorAddendumForProps(elementProps) {
|
2122 | if (elementProps !== null && elementProps !== undefined) {
|
2123 | return getSourceInfoErrorAddendum(elementProps.__source);
|
2124 | }
|
2125 |
|
2126 | return '';
|
2127 | }
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 | var ownerHasKeyUseWarning = {};
|
2136 |
|
2137 | function getCurrentComponentErrorInfo(parentType) {
|
2138 | var info = getDeclarationErrorAddendum();
|
2139 |
|
2140 | if (!info) {
|
2141 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
2142 |
|
2143 | if (parentName) {
|
2144 | info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
2145 | }
|
2146 | }
|
2147 |
|
2148 | return info;
|
2149 | }
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 | function validateExplicitKey(element, parentType) {
|
2164 | if (!element._store || element._store.validated || element.key != null) {
|
2165 | return;
|
2166 | }
|
2167 |
|
2168 | element._store.validated = true;
|
2169 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
2170 |
|
2171 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
2172 | return;
|
2173 | }
|
2174 |
|
2175 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
2176 |
|
2177 |
|
2178 |
|
2179 | var childOwner = '';
|
2180 |
|
2181 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
2182 |
|
2183 | childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
2184 | }
|
2185 |
|
2186 | {
|
2187 | setCurrentlyValidatingElement$1(element);
|
2188 |
|
2189 | error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
2190 |
|
2191 | setCurrentlyValidatingElement$1(null);
|
2192 | }
|
2193 | }
|
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 | function validateChildKeys(node, parentType) {
|
2206 | if (typeof node !== 'object') {
|
2207 | return;
|
2208 | }
|
2209 |
|
2210 | if (isArray(node)) {
|
2211 | for (var i = 0; i < node.length; i++) {
|
2212 | var child = node[i];
|
2213 |
|
2214 | if (isValidElement(child)) {
|
2215 | validateExplicitKey(child, parentType);
|
2216 | }
|
2217 | }
|
2218 | } else if (isValidElement(node)) {
|
2219 |
|
2220 | if (node._store) {
|
2221 | node._store.validated = true;
|
2222 | }
|
2223 | } else if (node) {
|
2224 | var iteratorFn = getIteratorFn(node);
|
2225 |
|
2226 | if (typeof iteratorFn === 'function') {
|
2227 |
|
2228 |
|
2229 | if (iteratorFn !== node.entries) {
|
2230 | var iterator = iteratorFn.call(node);
|
2231 | var step;
|
2232 |
|
2233 | while (!(step = iterator.next()).done) {
|
2234 | if (isValidElement(step.value)) {
|
2235 | validateExplicitKey(step.value, parentType);
|
2236 | }
|
2237 | }
|
2238 | }
|
2239 | }
|
2240 | }
|
2241 | }
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 |
|
2249 |
|
2250 | function validatePropTypes(element) {
|
2251 | {
|
2252 | var type = element.type;
|
2253 |
|
2254 | if (type === null || type === undefined || typeof type === 'string') {
|
2255 | return;
|
2256 | }
|
2257 |
|
2258 | var propTypes;
|
2259 |
|
2260 | if (typeof type === 'function') {
|
2261 | propTypes = type.propTypes;
|
2262 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
2263 |
|
2264 | type.$$typeof === REACT_MEMO_TYPE)) {
|
2265 | propTypes = type.propTypes;
|
2266 | } else {
|
2267 | return;
|
2268 | }
|
2269 |
|
2270 | if (propTypes) {
|
2271 |
|
2272 | var name = getComponentNameFromType(type);
|
2273 | checkPropTypes(propTypes, element.props, 'prop', name, element);
|
2274 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
2275 | propTypesMisspellWarningShown = true;
|
2276 |
|
2277 | var _name = getComponentNameFromType(type);
|
2278 |
|
2279 | error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
2280 | }
|
2281 |
|
2282 | if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
2283 | error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
2284 | }
|
2285 | }
|
2286 | }
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 | function validateFragmentProps(fragment) {
|
2294 | {
|
2295 | var keys = Object.keys(fragment.props);
|
2296 |
|
2297 | for (var i = 0; i < keys.length; i++) {
|
2298 | var key = keys[i];
|
2299 |
|
2300 | if (key !== 'children' && key !== 'key') {
|
2301 | setCurrentlyValidatingElement$1(fragment);
|
2302 |
|
2303 | error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
2304 |
|
2305 | setCurrentlyValidatingElement$1(null);
|
2306 | break;
|
2307 | }
|
2308 | }
|
2309 |
|
2310 | if (fragment.ref !== null) {
|
2311 | setCurrentlyValidatingElement$1(fragment);
|
2312 |
|
2313 | error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
2314 |
|
2315 | setCurrentlyValidatingElement$1(null);
|
2316 | }
|
2317 | }
|
2318 | }
|
2319 | function createElementWithValidation(type, props, children) {
|
2320 | var validType = isValidElementType(type);
|
2321 |
|
2322 |
|
2323 | if (!validType) {
|
2324 | var info = '';
|
2325 |
|
2326 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
2327 | 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.";
|
2328 | }
|
2329 |
|
2330 | var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
2331 |
|
2332 | if (sourceInfo) {
|
2333 | info += sourceInfo;
|
2334 | } else {
|
2335 | info += getDeclarationErrorAddendum();
|
2336 | }
|
2337 |
|
2338 | var typeString;
|
2339 |
|
2340 | if (type === null) {
|
2341 | typeString = 'null';
|
2342 | } else if (isArray(type)) {
|
2343 | typeString = 'array';
|
2344 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
2345 | typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
2346 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
2347 | } else {
|
2348 | typeString = typeof type;
|
2349 | }
|
2350 |
|
2351 | {
|
2352 | 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);
|
2353 | }
|
2354 | }
|
2355 |
|
2356 | var element = createElement.apply(this, arguments);
|
2357 |
|
2358 |
|
2359 | if (element == null) {
|
2360 | return element;
|
2361 | }
|
2362 |
|
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 | if (validType) {
|
2369 | for (var i = 2; i < arguments.length; i++) {
|
2370 | validateChildKeys(arguments[i], type);
|
2371 | }
|
2372 | }
|
2373 |
|
2374 | if (type === REACT_FRAGMENT_TYPE) {
|
2375 | validateFragmentProps(element);
|
2376 | } else {
|
2377 | validatePropTypes(element);
|
2378 | }
|
2379 |
|
2380 | return element;
|
2381 | }
|
2382 | var didWarnAboutDeprecatedCreateFactory = false;
|
2383 | function createFactoryWithValidation(type) {
|
2384 | var validatedFactory = createElementWithValidation.bind(null, type);
|
2385 | validatedFactory.type = type;
|
2386 |
|
2387 | {
|
2388 | if (!didWarnAboutDeprecatedCreateFactory) {
|
2389 | didWarnAboutDeprecatedCreateFactory = true;
|
2390 |
|
2391 | warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
2392 | }
|
2393 |
|
2394 |
|
2395 | Object.defineProperty(validatedFactory, 'type', {
|
2396 | enumerable: false,
|
2397 | get: function () {
|
2398 | warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
2399 |
|
2400 | Object.defineProperty(this, 'type', {
|
2401 | value: type
|
2402 | });
|
2403 | return type;
|
2404 | }
|
2405 | });
|
2406 | }
|
2407 |
|
2408 | return validatedFactory;
|
2409 | }
|
2410 | function cloneElementWithValidation(element, props, children) {
|
2411 | var newElement = cloneElement.apply(this, arguments);
|
2412 |
|
2413 | for (var i = 2; i < arguments.length; i++) {
|
2414 | validateChildKeys(arguments[i], newElement.type);
|
2415 | }
|
2416 |
|
2417 | validatePropTypes(newElement);
|
2418 | return newElement;
|
2419 | }
|
2420 |
|
2421 | function startTransition(scope, options) {
|
2422 | var prevTransition = ReactCurrentBatchConfig.transition;
|
2423 | ReactCurrentBatchConfig.transition = {};
|
2424 | var currentTransition = ReactCurrentBatchConfig.transition;
|
2425 |
|
2426 | {
|
2427 | ReactCurrentBatchConfig.transition._updatedFibers = new Set();
|
2428 | }
|
2429 |
|
2430 | try {
|
2431 | scope();
|
2432 | } finally {
|
2433 | ReactCurrentBatchConfig.transition = prevTransition;
|
2434 |
|
2435 | {
|
2436 | if (prevTransition === null && currentTransition._updatedFibers) {
|
2437 | var updatedFibersCount = currentTransition._updatedFibers.size;
|
2438 |
|
2439 | if (updatedFibersCount > 10) {
|
2440 | warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
2441 | }
|
2442 |
|
2443 | currentTransition._updatedFibers.clear();
|
2444 | }
|
2445 | }
|
2446 | }
|
2447 | }
|
2448 |
|
2449 | var didWarnAboutMessageChannel = false;
|
2450 | var enqueueTaskImpl = null;
|
2451 | function enqueueTask(task) {
|
2452 | if (enqueueTaskImpl === null) {
|
2453 | try {
|
2454 |
|
2455 |
|
2456 | var requireString = ('require' + Math.random()).slice(0, 7);
|
2457 | var nodeRequire = module && module[requireString];
|
2458 |
|
2459 |
|
2460 | enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
2461 | } catch (_err) {
|
2462 |
|
2463 |
|
2464 |
|
2465 | enqueueTaskImpl = function (callback) {
|
2466 | {
|
2467 | if (didWarnAboutMessageChannel === false) {
|
2468 | didWarnAboutMessageChannel = true;
|
2469 |
|
2470 | if (typeof MessageChannel === 'undefined') {
|
2471 | error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
|
2472 | }
|
2473 | }
|
2474 | }
|
2475 |
|
2476 | var channel = new MessageChannel();
|
2477 | channel.port1.onmessage = callback;
|
2478 | channel.port2.postMessage(undefined);
|
2479 | };
|
2480 | }
|
2481 | }
|
2482 |
|
2483 | return enqueueTaskImpl(task);
|
2484 | }
|
2485 |
|
2486 | var actScopeDepth = 0;
|
2487 | var didWarnNoAwaitAct = false;
|
2488 | function act(callback) {
|
2489 | {
|
2490 |
|
2491 |
|
2492 | var prevActScopeDepth = actScopeDepth;
|
2493 | actScopeDepth++;
|
2494 |
|
2495 | if (ReactCurrentActQueue.current === null) {
|
2496 |
|
2497 |
|
2498 | ReactCurrentActQueue.current = [];
|
2499 | }
|
2500 |
|
2501 | var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
2502 | var result;
|
2503 |
|
2504 | try {
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 | ReactCurrentActQueue.isBatchingLegacy = true;
|
2510 | result = callback();
|
2511 |
|
2512 |
|
2513 |
|
2514 | if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
2515 | var queue = ReactCurrentActQueue.current;
|
2516 |
|
2517 | if (queue !== null) {
|
2518 | ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
2519 | flushActQueue(queue);
|
2520 | }
|
2521 | }
|
2522 | } catch (error) {
|
2523 | popActScope(prevActScopeDepth);
|
2524 | throw error;
|
2525 | } finally {
|
2526 | ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
2527 | }
|
2528 |
|
2529 | if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
2530 | var thenableResult = result;
|
2531 |
|
2532 |
|
2533 | var wasAwaited = false;
|
2534 | var thenable = {
|
2535 | then: function (resolve, reject) {
|
2536 | wasAwaited = true;
|
2537 | thenableResult.then(function (returnValue) {
|
2538 | popActScope(prevActScopeDepth);
|
2539 |
|
2540 | if (actScopeDepth === 0) {
|
2541 |
|
2542 |
|
2543 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2544 | } else {
|
2545 | resolve(returnValue);
|
2546 | }
|
2547 | }, function (error) {
|
2548 |
|
2549 | popActScope(prevActScopeDepth);
|
2550 | reject(error);
|
2551 | });
|
2552 | }
|
2553 | };
|
2554 |
|
2555 | {
|
2556 | if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
2557 |
|
2558 | Promise.resolve().then(function () {}).then(function () {
|
2559 | if (!wasAwaited) {
|
2560 | didWarnNoAwaitAct = true;
|
2561 |
|
2562 | error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
|
2563 | }
|
2564 | });
|
2565 | }
|
2566 | }
|
2567 |
|
2568 | return thenable;
|
2569 | } else {
|
2570 | var returnValue = result;
|
2571 |
|
2572 |
|
2573 | popActScope(prevActScopeDepth);
|
2574 |
|
2575 | if (actScopeDepth === 0) {
|
2576 |
|
2577 | var _queue = ReactCurrentActQueue.current;
|
2578 |
|
2579 | if (_queue !== null) {
|
2580 | flushActQueue(_queue);
|
2581 | ReactCurrentActQueue.current = null;
|
2582 | }
|
2583 |
|
2584 |
|
2585 |
|
2586 | var _thenable = {
|
2587 | then: function (resolve, reject) {
|
2588 |
|
2589 |
|
2590 |
|
2591 | if (ReactCurrentActQueue.current === null) {
|
2592 |
|
2593 | ReactCurrentActQueue.current = [];
|
2594 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2595 | } else {
|
2596 | resolve(returnValue);
|
2597 | }
|
2598 | }
|
2599 | };
|
2600 | return _thenable;
|
2601 | } else {
|
2602 |
|
2603 |
|
2604 | var _thenable2 = {
|
2605 | then: function (resolve, reject) {
|
2606 | resolve(returnValue);
|
2607 | }
|
2608 | };
|
2609 | return _thenable2;
|
2610 | }
|
2611 | }
|
2612 | }
|
2613 | }
|
2614 |
|
2615 | function popActScope(prevActScopeDepth) {
|
2616 | {
|
2617 | if (prevActScopeDepth !== actScopeDepth - 1) {
|
2618 | error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
2619 | }
|
2620 |
|
2621 | actScopeDepth = prevActScopeDepth;
|
2622 | }
|
2623 | }
|
2624 |
|
2625 | function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
2626 | {
|
2627 | var queue = ReactCurrentActQueue.current;
|
2628 |
|
2629 | if (queue !== null) {
|
2630 | try {
|
2631 | flushActQueue(queue);
|
2632 | enqueueTask(function () {
|
2633 | if (queue.length === 0) {
|
2634 |
|
2635 | ReactCurrentActQueue.current = null;
|
2636 | resolve(returnValue);
|
2637 | } else {
|
2638 |
|
2639 | recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
2640 | }
|
2641 | });
|
2642 | } catch (error) {
|
2643 | reject(error);
|
2644 | }
|
2645 | } else {
|
2646 | resolve(returnValue);
|
2647 | }
|
2648 | }
|
2649 | }
|
2650 |
|
2651 | var isFlushing = false;
|
2652 |
|
2653 | function flushActQueue(queue) {
|
2654 | {
|
2655 | if (!isFlushing) {
|
2656 |
|
2657 | isFlushing = true;
|
2658 | var i = 0;
|
2659 |
|
2660 | try {
|
2661 | for (; i < queue.length; i++) {
|
2662 | var callback = queue[i];
|
2663 |
|
2664 | do {
|
2665 | callback = callback(true);
|
2666 | } while (callback !== null);
|
2667 | }
|
2668 |
|
2669 | queue.length = 0;
|
2670 | } catch (error) {
|
2671 |
|
2672 | queue = queue.slice(i + 1);
|
2673 | throw error;
|
2674 | } finally {
|
2675 | isFlushing = false;
|
2676 | }
|
2677 | }
|
2678 | }
|
2679 | }
|
2680 |
|
2681 | var createElement$1 = createElementWithValidation ;
|
2682 | var cloneElement$1 = cloneElementWithValidation ;
|
2683 | var createFactory = createFactoryWithValidation ;
|
2684 | var Children = {
|
2685 | map: mapChildren,
|
2686 | forEach: forEachChildren,
|
2687 | count: countChildren,
|
2688 | toArray: toArray,
|
2689 | only: onlyChild
|
2690 | };
|
2691 |
|
2692 | exports.Children = Children;
|
2693 | exports.Component = Component;
|
2694 | exports.Fragment = REACT_FRAGMENT_TYPE;
|
2695 | exports.Profiler = REACT_PROFILER_TYPE;
|
2696 | exports.PureComponent = PureComponent;
|
2697 | exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
2698 | exports.Suspense = REACT_SUSPENSE_TYPE;
|
2699 | exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
2700 | exports.cloneElement = cloneElement$1;
|
2701 | exports.createContext = createContext;
|
2702 | exports.createElement = createElement$1;
|
2703 | exports.createFactory = createFactory;
|
2704 | exports.createRef = createRef;
|
2705 | exports.forwardRef = forwardRef;
|
2706 | exports.isValidElement = isValidElement;
|
2707 | exports.lazy = lazy;
|
2708 | exports.memo = memo;
|
2709 | exports.startTransition = startTransition;
|
2710 | exports.unstable_act = act;
|
2711 | exports.useCallback = useCallback;
|
2712 | exports.useContext = useContext;
|
2713 | exports.useDebugValue = useDebugValue;
|
2714 | exports.useDeferredValue = useDeferredValue;
|
2715 | exports.useEffect = useEffect;
|
2716 | exports.useId = useId;
|
2717 | exports.useImperativeHandle = useImperativeHandle;
|
2718 | exports.useInsertionEffect = useInsertionEffect;
|
2719 | exports.useLayoutEffect = useLayoutEffect;
|
2720 | exports.useMemo = useMemo;
|
2721 | exports.useReducer = useReducer;
|
2722 | exports.useRef = useRef;
|
2723 | exports.useState = useState;
|
2724 | exports.useSyncExternalStore = useSyncExternalStore;
|
2725 | exports.useTransition = useTransition;
|
2726 | exports.version = ReactVersion;
|
2727 |
|
2728 | if (
|
2729 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
2730 | typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
2731 | 'function'
|
2732 | ) {
|
2733 | __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
2734 | }
|
2735 |
|
2736 | })();
|
2737 | }
|