1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 |
|
13 |
|
14 | if (process.env.NODE_ENV !== "production") {
|
15 | (function() {
|
16 | 'use strict';
|
17 |
|
18 | var _assign = require('object-assign');
|
19 | var checkPropTypes = require('prop-types/checkPropTypes');
|
20 |
|
21 |
|
22 |
|
23 | var ReactVersion = '16.10.2';
|
24 |
|
25 |
|
26 |
|
27 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
28 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
29 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
30 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
31 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
32 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
33 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
34 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
35 |
|
36 |
|
37 |
|
38 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
39 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
40 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
41 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
42 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
43 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
44 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
45 | var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
46 | var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
47 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
48 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
49 | function getIteratorFn(maybeIterable) {
|
50 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
51 | return null;
|
52 | }
|
53 |
|
54 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
55 |
|
56 | if (typeof maybeIterator === 'function') {
|
57 | return maybeIterator;
|
58 | }
|
59 |
|
60 | return null;
|
61 | }
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | function ReactError(error) {
|
71 | error.name = 'Invariant Violation';
|
72 | return error;
|
73 | }
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | var lowPriorityWarningWithoutStack = function () {};
|
100 |
|
101 | {
|
102 | var printWarning = function (format) {
|
103 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
104 | args[_key - 1] = arguments[_key];
|
105 | }
|
106 |
|
107 | var argIndex = 0;
|
108 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
109 | return args[argIndex++];
|
110 | });
|
111 |
|
112 | if (typeof console !== 'undefined') {
|
113 | console.warn(message);
|
114 | }
|
115 |
|
116 | try {
|
117 |
|
118 |
|
119 |
|
120 | throw new Error(message);
|
121 | } catch (x) {}
|
122 | };
|
123 |
|
124 | lowPriorityWarningWithoutStack = function (condition, format) {
|
125 | if (format === undefined) {
|
126 | throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
127 | }
|
128 |
|
129 | if (!condition) {
|
130 | for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
131 | args[_key2 - 2] = arguments[_key2];
|
132 | }
|
133 |
|
134 | printWarning.apply(void 0, [format].concat(args));
|
135 | }
|
136 | };
|
137 | }
|
138 |
|
139 | var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 | var warningWithoutStack = function () {};
|
148 |
|
149 | {
|
150 | warningWithoutStack = function (condition, format) {
|
151 | for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
152 | args[_key - 2] = arguments[_key];
|
153 | }
|
154 |
|
155 | if (format === undefined) {
|
156 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
157 | }
|
158 |
|
159 | if (args.length > 8) {
|
160 |
|
161 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
162 | }
|
163 |
|
164 | if (condition) {
|
165 | return;
|
166 | }
|
167 |
|
168 | if (typeof console !== 'undefined') {
|
169 | var argsWithFormat = args.map(function (item) {
|
170 | return '' + item;
|
171 | });
|
172 | argsWithFormat.unshift('Warning: ' + format);
|
173 |
|
174 |
|
175 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
176 | }
|
177 |
|
178 | try {
|
179 |
|
180 |
|
181 |
|
182 | var argIndex = 0;
|
183 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
184 | return args[argIndex++];
|
185 | });
|
186 | throw new Error(message);
|
187 | } catch (x) {}
|
188 | };
|
189 | }
|
190 |
|
191 | var warningWithoutStack$1 = warningWithoutStack;
|
192 |
|
193 | var didWarnStateUpdateForUnmountedComponent = {};
|
194 |
|
195 | function warnNoop(publicInstance, callerName) {
|
196 | {
|
197 | var _constructor = publicInstance.constructor;
|
198 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
199 | var warningKey = componentName + "." + callerName;
|
200 |
|
201 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
202 | return;
|
203 | }
|
204 |
|
205 | warningWithoutStack$1(false, "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);
|
206 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
207 | }
|
208 | }
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 | var ReactNoopUpdateQueue = {
|
215 | |
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 | isMounted: function (publicInstance) {
|
223 | return false;
|
224 | },
|
225 |
|
226 | |
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
242 | warnNoop(publicInstance, 'forceUpdate');
|
243 | },
|
244 |
|
245 | |
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
259 | warnNoop(publicInstance, 'replaceState');
|
260 | },
|
261 |
|
262 | |
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
275 | warnNoop(publicInstance, 'setState');
|
276 | }
|
277 | };
|
278 |
|
279 | var emptyObject = {};
|
280 |
|
281 | {
|
282 | Object.freeze(emptyObject);
|
283 | }
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 | function Component(props, context, updater) {
|
290 | this.props = props;
|
291 | this.context = context;
|
292 |
|
293 | this.refs = emptyObject;
|
294 |
|
295 |
|
296 | this.updater = updater || ReactNoopUpdateQueue;
|
297 | }
|
298 |
|
299 | Component.prototype.isReactComponent = {};
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 | Component.prototype.setState = function (partialState, callback) {
|
327 | (function () {
|
328 | if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
329 | {
|
330 | throw ReactError(Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."));
|
331 | }
|
332 | }
|
333 | })();
|
334 |
|
335 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
336 | };
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 | Component.prototype.forceUpdate = function (callback) {
|
354 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
355 | };
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 | {
|
364 | var deprecatedAPIs = {
|
365 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
366 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
367 | };
|
368 |
|
369 | var defineDeprecationWarning = function (methodName, info) {
|
370 | Object.defineProperty(Component.prototype, methodName, {
|
371 | get: function () {
|
372 | lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
373 | return undefined;
|
374 | }
|
375 | });
|
376 | };
|
377 |
|
378 | for (var fnName in deprecatedAPIs) {
|
379 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
380 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
381 | }
|
382 | }
|
383 | }
|
384 |
|
385 | function ComponentDummy() {}
|
386 |
|
387 | ComponentDummy.prototype = Component.prototype;
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | function PureComponent(props, context, updater) {
|
393 | this.props = props;
|
394 | this.context = context;
|
395 |
|
396 | this.refs = emptyObject;
|
397 | this.updater = updater || ReactNoopUpdateQueue;
|
398 | }
|
399 |
|
400 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
401 | pureComponentPrototype.constructor = PureComponent;
|
402 |
|
403 | _assign(pureComponentPrototype, Component.prototype);
|
404 |
|
405 | pureComponentPrototype.isPureReactComponent = true;
|
406 |
|
407 |
|
408 | function createRef() {
|
409 | var refObject = {
|
410 | current: null
|
411 | };
|
412 |
|
413 | {
|
414 | Object.seal(refObject);
|
415 | }
|
416 |
|
417 | return refObject;
|
418 | }
|
419 |
|
420 |
|
421 |
|
422 |
|
423 | var ReactCurrentDispatcher = {
|
424 | |
425 |
|
426 |
|
427 |
|
428 | current: null
|
429 | };
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 | var ReactCurrentBatchConfig = {
|
436 | suspense: null
|
437 | };
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | var ReactCurrentOwner = {
|
446 | |
447 |
|
448 |
|
449 |
|
450 | current: null
|
451 | };
|
452 |
|
453 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
454 | var describeComponentFrame = function (name, source, ownerName) {
|
455 | var sourceInfo = '';
|
456 |
|
457 | if (source) {
|
458 | var path = source.fileName;
|
459 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
460 |
|
461 | {
|
462 |
|
463 |
|
464 | if (/^index\./.test(fileName)) {
|
465 | var match = path.match(BEFORE_SLASH_RE);
|
466 |
|
467 | if (match) {
|
468 | var pathBeforeSlash = match[1];
|
469 |
|
470 | if (pathBeforeSlash) {
|
471 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
472 | fileName = folderName + '/' + fileName;
|
473 | }
|
474 | }
|
475 | }
|
476 | }
|
477 |
|
478 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
479 | } else if (ownerName) {
|
480 | sourceInfo = ' (created by ' + ownerName + ')';
|
481 | }
|
482 |
|
483 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
484 | };
|
485 |
|
486 | var Resolved = 1;
|
487 |
|
488 | function refineResolvedLazyComponent(lazyComponent) {
|
489 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
490 | }
|
491 |
|
492 | function getWrappedName(outerType, innerType, wrapperName) {
|
493 | var functionName = innerType.displayName || innerType.name || '';
|
494 | return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
495 | }
|
496 |
|
497 | function getComponentName(type) {
|
498 | if (type == null) {
|
499 |
|
500 | return null;
|
501 | }
|
502 |
|
503 | {
|
504 | if (typeof type.tag === 'number') {
|
505 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
506 | }
|
507 | }
|
508 |
|
509 | if (typeof type === 'function') {
|
510 | return type.displayName || type.name || null;
|
511 | }
|
512 |
|
513 | if (typeof type === 'string') {
|
514 | return type;
|
515 | }
|
516 |
|
517 | switch (type) {
|
518 | case REACT_FRAGMENT_TYPE:
|
519 | return 'Fragment';
|
520 |
|
521 | case REACT_PORTAL_TYPE:
|
522 | return 'Portal';
|
523 |
|
524 | case REACT_PROFILER_TYPE:
|
525 | return "Profiler";
|
526 |
|
527 | case REACT_STRICT_MODE_TYPE:
|
528 | return 'StrictMode';
|
529 |
|
530 | case REACT_SUSPENSE_TYPE:
|
531 | return 'Suspense';
|
532 |
|
533 | case REACT_SUSPENSE_LIST_TYPE:
|
534 | return 'SuspenseList';
|
535 | }
|
536 |
|
537 | if (typeof type === 'object') {
|
538 | switch (type.$$typeof) {
|
539 | case REACT_CONTEXT_TYPE:
|
540 | return 'Context.Consumer';
|
541 |
|
542 | case REACT_PROVIDER_TYPE:
|
543 | return 'Context.Provider';
|
544 |
|
545 | case REACT_FORWARD_REF_TYPE:
|
546 | return getWrappedName(type, type.render, 'ForwardRef');
|
547 |
|
548 | case REACT_MEMO_TYPE:
|
549 | return getComponentName(type.type);
|
550 |
|
551 | case REACT_LAZY_TYPE:
|
552 | {
|
553 | var thenable = type;
|
554 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
555 |
|
556 | if (resolvedThenable) {
|
557 | return getComponentName(resolvedThenable);
|
558 | }
|
559 |
|
560 | break;
|
561 | }
|
562 | }
|
563 | }
|
564 |
|
565 | return null;
|
566 | }
|
567 |
|
568 | var ReactDebugCurrentFrame = {};
|
569 | var currentlyValidatingElement = null;
|
570 | function setCurrentlyValidatingElement(element) {
|
571 | {
|
572 | currentlyValidatingElement = element;
|
573 | }
|
574 | }
|
575 |
|
576 | {
|
577 |
|
578 | ReactDebugCurrentFrame.getCurrentStack = null;
|
579 |
|
580 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
581 | var stack = '';
|
582 |
|
583 | if (currentlyValidatingElement) {
|
584 | var name = getComponentName(currentlyValidatingElement.type);
|
585 | var owner = currentlyValidatingElement._owner;
|
586 | stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
587 | }
|
588 |
|
589 |
|
590 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
591 |
|
592 | if (impl) {
|
593 | stack += impl() || '';
|
594 | }
|
595 |
|
596 | return stack;
|
597 | };
|
598 | }
|
599 |
|
600 |
|
601 |
|
602 |
|
603 | var IsSomeRendererActing = {
|
604 | current: false
|
605 | };
|
606 |
|
607 | var ReactSharedInternals = {
|
608 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
609 | ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
610 | ReactCurrentOwner: ReactCurrentOwner,
|
611 | IsSomeRendererActing: IsSomeRendererActing,
|
612 |
|
613 | assign: _assign
|
614 | };
|
615 |
|
616 | {
|
617 | _assign(ReactSharedInternals, {
|
618 |
|
619 | ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
620 |
|
621 |
|
622 | ReactComponentTreeHook: {}
|
623 | });
|
624 | }
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 | var warning = warningWithoutStack$1;
|
634 |
|
635 | {
|
636 | warning = function (condition, format) {
|
637 | if (condition) {
|
638 | return;
|
639 | }
|
640 |
|
641 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
642 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
643 |
|
644 | for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
645 | args[_key - 2] = arguments[_key];
|
646 | }
|
647 |
|
648 | warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
|
649 | };
|
650 | }
|
651 |
|
652 | var warning$1 = warning;
|
653 |
|
654 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
655 | var RESERVED_PROPS = {
|
656 | key: true,
|
657 | ref: true,
|
658 | __self: true,
|
659 | __source: true
|
660 | };
|
661 | var specialPropKeyWarningShown;
|
662 | var specialPropRefWarningShown;
|
663 |
|
664 | function hasValidRef(config) {
|
665 | {
|
666 | if (hasOwnProperty.call(config, 'ref')) {
|
667 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
668 |
|
669 | if (getter && getter.isReactWarning) {
|
670 | return false;
|
671 | }
|
672 | }
|
673 | }
|
674 |
|
675 | return config.ref !== undefined;
|
676 | }
|
677 |
|
678 | function hasValidKey(config) {
|
679 | {
|
680 | if (hasOwnProperty.call(config, 'key')) {
|
681 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
682 |
|
683 | if (getter && getter.isReactWarning) {
|
684 | return false;
|
685 | }
|
686 | }
|
687 | }
|
688 |
|
689 | return config.key !== undefined;
|
690 | }
|
691 |
|
692 | function defineKeyPropWarningGetter(props, displayName) {
|
693 | var warnAboutAccessingKey = function () {
|
694 | if (!specialPropKeyWarningShown) {
|
695 | specialPropKeyWarningShown = true;
|
696 | warningWithoutStack$1(false, '%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://fb.me/react-special-props)', displayName);
|
697 | }
|
698 | };
|
699 |
|
700 | warnAboutAccessingKey.isReactWarning = true;
|
701 | Object.defineProperty(props, 'key', {
|
702 | get: warnAboutAccessingKey,
|
703 | configurable: true
|
704 | });
|
705 | }
|
706 |
|
707 | function defineRefPropWarningGetter(props, displayName) {
|
708 | var warnAboutAccessingRef = function () {
|
709 | if (!specialPropRefWarningShown) {
|
710 | specialPropRefWarningShown = true;
|
711 | warningWithoutStack$1(false, '%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://fb.me/react-special-props)', displayName);
|
712 | }
|
713 | };
|
714 |
|
715 | warnAboutAccessingRef.isReactWarning = true;
|
716 | Object.defineProperty(props, 'ref', {
|
717 | get: warnAboutAccessingRef,
|
718 | configurable: true
|
719 | });
|
720 | }
|
721 | /**
|
722 | * Factory method to create a new React element. This no longer adheres to
|
723 | * the class pattern, so do not use new to call it. Also, no instanceof check
|
724 | * will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
725 | * if something is a React Element.
|
726 | *
|
727 | * @param {*} type
|
728 | * @param {*} props
|
729 | * @param {*} key
|
730 | * @param {string|object} ref
|
731 | * @param {*} owner
|
732 | * @param {*} self A *temporary* helper to detect places where `this` is
|
733 | * different from the `owner` when React.createElement is called, so that we
|
734 | * can warn. We want to get rid of owner and replace string `ref`s with arrow
|
735 | * functions, and as long as `this` and owner are the same, there will be no
|
736 | * change in behavior.
|
737 | * @param {*} source An annotation object (added by a transpiler or otherwise)
|
738 | * indicating filename, line number, and/or other information.
|
739 | * @internal
|
740 | */
|
741 |
|
742 |
|
743 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
744 | var element = {
|
745 |
|
746 | $$typeof: REACT_ELEMENT_TYPE,
|
747 |
|
748 | type: type,
|
749 | key: key,
|
750 | ref: ref,
|
751 | props: props,
|
752 |
|
753 | _owner: owner
|
754 | };
|
755 |
|
756 | {
|
757 |
|
758 |
|
759 |
|
760 |
|
761 | element._store = {};
|
762 |
|
763 |
|
764 |
|
765 |
|
766 | Object.defineProperty(element._store, 'validated', {
|
767 | configurable: false,
|
768 | enumerable: false,
|
769 | writable: true,
|
770 | value: false
|
771 | });
|
772 |
|
773 | Object.defineProperty(element, '_self', {
|
774 | configurable: false,
|
775 | enumerable: false,
|
776 | writable: false,
|
777 | value: self
|
778 | });
|
779 |
|
780 |
|
781 | Object.defineProperty(element, '_source', {
|
782 | configurable: false,
|
783 | enumerable: false,
|
784 | writable: false,
|
785 | value: source
|
786 | });
|
787 |
|
788 | if (Object.freeze) {
|
789 | Object.freeze(element.props);
|
790 | Object.freeze(element);
|
791 | }
|
792 | }
|
793 |
|
794 | return element;
|
795 | };
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 | function jsxDEV(type, config, maybeKey, source, self) {
|
813 | var propName;
|
814 |
|
815 | var props = {};
|
816 | var key = null;
|
817 | var ref = null;
|
818 |
|
819 |
|
820 |
|
821 |
|
822 |
|
823 |
|
824 | if (maybeKey !== undefined) {
|
825 | key = '' + maybeKey;
|
826 | }
|
827 |
|
828 | if (hasValidKey(config)) {
|
829 | key = '' + config.key;
|
830 | }
|
831 |
|
832 | if (hasValidRef(config)) {
|
833 | ref = config.ref;
|
834 | }
|
835 |
|
836 |
|
837 | for (propName in config) {
|
838 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
839 | props[propName] = config[propName];
|
840 | }
|
841 | }
|
842 |
|
843 |
|
844 | if (type && type.defaultProps) {
|
845 | var defaultProps = type.defaultProps;
|
846 |
|
847 | for (propName in defaultProps) {
|
848 | if (props[propName] === undefined) {
|
849 | props[propName] = defaultProps[propName];
|
850 | }
|
851 | }
|
852 | }
|
853 |
|
854 | if (key || ref) {
|
855 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
856 |
|
857 | if (key) {
|
858 | defineKeyPropWarningGetter(props, displayName);
|
859 | }
|
860 |
|
861 | if (ref) {
|
862 | defineRefPropWarningGetter(props, displayName);
|
863 | }
|
864 | }
|
865 |
|
866 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
867 | }
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 | function createElement(type, config, children) {
|
874 | var propName;
|
875 |
|
876 | var props = {};
|
877 | var key = null;
|
878 | var ref = null;
|
879 | var self = null;
|
880 | var source = null;
|
881 |
|
882 | if (config != null) {
|
883 | if (hasValidRef(config)) {
|
884 | ref = config.ref;
|
885 | }
|
886 |
|
887 | if (hasValidKey(config)) {
|
888 | key = '' + config.key;
|
889 | }
|
890 |
|
891 | self = config.__self === undefined ? null : config.__self;
|
892 | source = config.__source === undefined ? null : config.__source;
|
893 |
|
894 | for (propName in config) {
|
895 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
896 | props[propName] = config[propName];
|
897 | }
|
898 | }
|
899 | }
|
900 |
|
901 |
|
902 |
|
903 | var childrenLength = arguments.length - 2;
|
904 |
|
905 | if (childrenLength === 1) {
|
906 | props.children = children;
|
907 | } else if (childrenLength > 1) {
|
908 | var childArray = Array(childrenLength);
|
909 |
|
910 | for (var i = 0; i < childrenLength; i++) {
|
911 | childArray[i] = arguments[i + 2];
|
912 | }
|
913 |
|
914 | {
|
915 | if (Object.freeze) {
|
916 | Object.freeze(childArray);
|
917 | }
|
918 | }
|
919 |
|
920 | props.children = childArray;
|
921 | }
|
922 |
|
923 |
|
924 | if (type && type.defaultProps) {
|
925 | var defaultProps = type.defaultProps;
|
926 |
|
927 | for (propName in defaultProps) {
|
928 | if (props[propName] === undefined) {
|
929 | props[propName] = defaultProps[propName];
|
930 | }
|
931 | }
|
932 | }
|
933 |
|
934 | {
|
935 | if (key || ref) {
|
936 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
937 |
|
938 | if (key) {
|
939 | defineKeyPropWarningGetter(props, displayName);
|
940 | }
|
941 |
|
942 | if (ref) {
|
943 | defineRefPropWarningGetter(props, displayName);
|
944 | }
|
945 | }
|
946 | }
|
947 |
|
948 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
949 | }
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 | function cloneAndReplaceKey(oldElement, newKey) {
|
957 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
958 | return newElement;
|
959 | }
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | function cloneElement(element, config, children) {
|
966 | (function () {
|
967 | if (!!(element === null || element === undefined)) {
|
968 | {
|
969 | throw ReactError(Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."));
|
970 | }
|
971 | }
|
972 | })();
|
973 |
|
974 | var propName;
|
975 |
|
976 | var props = _assign({}, element.props);
|
977 |
|
978 |
|
979 | var key = element.key;
|
980 | var ref = element.ref;
|
981 |
|
982 | var self = element._self;
|
983 |
|
984 |
|
985 |
|
986 | var source = element._source;
|
987 |
|
988 | var owner = element._owner;
|
989 |
|
990 | if (config != null) {
|
991 | if (hasValidRef(config)) {
|
992 |
|
993 | ref = config.ref;
|
994 | owner = ReactCurrentOwner.current;
|
995 | }
|
996 |
|
997 | if (hasValidKey(config)) {
|
998 | key = '' + config.key;
|
999 | }
|
1000 |
|
1001 |
|
1002 | var defaultProps;
|
1003 |
|
1004 | if (element.type && element.type.defaultProps) {
|
1005 | defaultProps = element.type.defaultProps;
|
1006 | }
|
1007 |
|
1008 | for (propName in config) {
|
1009 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
1010 | if (config[propName] === undefined && defaultProps !== undefined) {
|
1011 |
|
1012 | props[propName] = defaultProps[propName];
|
1013 | } else {
|
1014 | props[propName] = config[propName];
|
1015 | }
|
1016 | }
|
1017 | }
|
1018 | }
|
1019 |
|
1020 |
|
1021 |
|
1022 | var childrenLength = arguments.length - 2;
|
1023 |
|
1024 | if (childrenLength === 1) {
|
1025 | props.children = children;
|
1026 | } else if (childrenLength > 1) {
|
1027 | var childArray = Array(childrenLength);
|
1028 |
|
1029 | for (var i = 0; i < childrenLength; i++) {
|
1030 | childArray[i] = arguments[i + 2];
|
1031 | }
|
1032 |
|
1033 | props.children = childArray;
|
1034 | }
|
1035 |
|
1036 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
1037 | }
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 |
|
1045 |
|
1046 | function isValidElement(object) {
|
1047 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
1048 | }
|
1049 |
|
1050 | var SEPARATOR = '.';
|
1051 | var SUBSEPARATOR = ':';
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 | function escape(key) {
|
1060 | var escapeRegex = /[=:]/g;
|
1061 | var escaperLookup = {
|
1062 | '=': '=0',
|
1063 | ':': '=2'
|
1064 | };
|
1065 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
1066 | return escaperLookup[match];
|
1067 | });
|
1068 | return '$' + escapedString;
|
1069 | }
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 | var didWarnAboutMaps = false;
|
1077 | var userProvidedKeyEscapeRegex = /\/+/g;
|
1078 |
|
1079 | function escapeUserProvidedKey(text) {
|
1080 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
1081 | }
|
1082 |
|
1083 | var POOL_SIZE = 10;
|
1084 | var traverseContextPool = [];
|
1085 |
|
1086 | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
1087 | if (traverseContextPool.length) {
|
1088 | var traverseContext = traverseContextPool.pop();
|
1089 | traverseContext.result = mapResult;
|
1090 | traverseContext.keyPrefix = keyPrefix;
|
1091 | traverseContext.func = mapFunction;
|
1092 | traverseContext.context = mapContext;
|
1093 | traverseContext.count = 0;
|
1094 | return traverseContext;
|
1095 | } else {
|
1096 | return {
|
1097 | result: mapResult,
|
1098 | keyPrefix: keyPrefix,
|
1099 | func: mapFunction,
|
1100 | context: mapContext,
|
1101 | count: 0
|
1102 | };
|
1103 | }
|
1104 | }
|
1105 |
|
1106 | function releaseTraverseContext(traverseContext) {
|
1107 | traverseContext.result = null;
|
1108 | traverseContext.keyPrefix = null;
|
1109 | traverseContext.func = null;
|
1110 | traverseContext.context = null;
|
1111 | traverseContext.count = 0;
|
1112 |
|
1113 | if (traverseContextPool.length < POOL_SIZE) {
|
1114 | traverseContextPool.push(traverseContext);
|
1115 | }
|
1116 | }
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
1128 | var type = typeof children;
|
1129 |
|
1130 | if (type === 'undefined' || type === 'boolean') {
|
1131 |
|
1132 | children = null;
|
1133 | }
|
1134 |
|
1135 | var invokeCallback = false;
|
1136 |
|
1137 | if (children === null) {
|
1138 | invokeCallback = true;
|
1139 | } else {
|
1140 | switch (type) {
|
1141 | case 'string':
|
1142 | case 'number':
|
1143 | invokeCallback = true;
|
1144 | break;
|
1145 |
|
1146 | case 'object':
|
1147 | switch (children.$$typeof) {
|
1148 | case REACT_ELEMENT_TYPE:
|
1149 | case REACT_PORTAL_TYPE:
|
1150 | invokeCallback = true;
|
1151 | }
|
1152 |
|
1153 | }
|
1154 | }
|
1155 |
|
1156 | if (invokeCallback) {
|
1157 | callback(traverseContext, children,
|
1158 |
|
1159 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
1160 | return 1;
|
1161 | }
|
1162 |
|
1163 | var child;
|
1164 | var nextName;
|
1165 | var subtreeCount = 0;
|
1166 |
|
1167 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
1168 |
|
1169 | if (Array.isArray(children)) {
|
1170 | for (var i = 0; i < children.length; i++) {
|
1171 | child = children[i];
|
1172 | nextName = nextNamePrefix + getComponentKey(child, i);
|
1173 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
1174 | }
|
1175 | } else {
|
1176 | var iteratorFn = getIteratorFn(children);
|
1177 |
|
1178 | if (typeof iteratorFn === 'function') {
|
1179 | {
|
1180 |
|
1181 | if (iteratorFn === children.entries) {
|
1182 | !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
|
1183 | didWarnAboutMaps = true;
|
1184 | }
|
1185 | }
|
1186 |
|
1187 | var iterator = iteratorFn.call(children);
|
1188 | var step;
|
1189 | var ii = 0;
|
1190 |
|
1191 | while (!(step = iterator.next()).done) {
|
1192 | child = step.value;
|
1193 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
1194 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
1195 | }
|
1196 | } else if (type === 'object') {
|
1197 | var addendum = '';
|
1198 |
|
1199 | {
|
1200 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
1201 | }
|
1202 |
|
1203 | var childrenString = '' + children;
|
1204 |
|
1205 | (function () {
|
1206 | {
|
1207 | {
|
1208 | throw ReactError(Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum));
|
1209 | }
|
1210 | }
|
1211 | })();
|
1212 | }
|
1213 | }
|
1214 |
|
1215 | return subtreeCount;
|
1216 | }
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 | function traverseAllChildren(children, callback, traverseContext) {
|
1236 | if (children == null) {
|
1237 | return 0;
|
1238 | }
|
1239 |
|
1240 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
1241 | }
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 | function getComponentKey(component, index) {
|
1252 |
|
1253 |
|
1254 | if (typeof component === 'object' && component !== null && component.key != null) {
|
1255 |
|
1256 | return escape(component.key);
|
1257 | }
|
1258 |
|
1259 |
|
1260 | return index.toString(36);
|
1261 | }
|
1262 |
|
1263 | function forEachSingleChild(bookKeeping, child, name) {
|
1264 | var func = bookKeeping.func,
|
1265 | context = bookKeeping.context;
|
1266 | func.call(context, child, bookKeeping.count++);
|
1267 | }
|
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 | function forEachChildren(children, forEachFunc, forEachContext) {
|
1283 | if (children == null) {
|
1284 | return children;
|
1285 | }
|
1286 |
|
1287 | var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
1288 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
1289 | releaseTraverseContext(traverseContext);
|
1290 | }
|
1291 |
|
1292 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
1293 | var result = bookKeeping.result,
|
1294 | keyPrefix = bookKeeping.keyPrefix,
|
1295 | func = bookKeeping.func,
|
1296 | context = bookKeeping.context;
|
1297 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
1298 |
|
1299 | if (Array.isArray(mappedChild)) {
|
1300 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
1301 | return c;
|
1302 | });
|
1303 | } else if (mappedChild != null) {
|
1304 | if (isValidElement(mappedChild)) {
|
1305 | mappedChild = cloneAndReplaceKey(mappedChild,
|
1306 |
|
1307 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
1308 | }
|
1309 |
|
1310 | result.push(mappedChild);
|
1311 | }
|
1312 | }
|
1313 |
|
1314 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
1315 | var escapedPrefix = '';
|
1316 |
|
1317 | if (prefix != null) {
|
1318 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
1319 | }
|
1320 |
|
1321 | var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
1322 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
1323 | releaseTraverseContext(traverseContext);
|
1324 | }
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 | function mapChildren(children, func, context) {
|
1341 | if (children == null) {
|
1342 | return children;
|
1343 | }
|
1344 |
|
1345 | var result = [];
|
1346 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
1347 | return result;
|
1348 | }
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | function countChildren(children) {
|
1361 | return traverseAllChildren(children, function () {
|
1362 | return null;
|
1363 | }, null);
|
1364 | }
|
1365 |
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 | function toArray(children) {
|
1374 | var result = [];
|
1375 | mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
1376 | return child;
|
1377 | });
|
1378 | return result;
|
1379 | }
|
1380 |
|
1381 |
|
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 |
|
1395 |
|
1396 | function onlyChild(children) {
|
1397 | (function () {
|
1398 | if (!isValidElement(children)) {
|
1399 | {
|
1400 | throw ReactError(Error("React.Children.only expected to receive a single React element child."));
|
1401 | }
|
1402 | }
|
1403 | })();
|
1404 |
|
1405 | return children;
|
1406 | }
|
1407 |
|
1408 | function createContext(defaultValue, calculateChangedBits) {
|
1409 | if (calculateChangedBits === undefined) {
|
1410 | calculateChangedBits = null;
|
1411 | } else {
|
1412 | {
|
1413 | !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
1414 | }
|
1415 | }
|
1416 |
|
1417 | var context = {
|
1418 | $$typeof: REACT_CONTEXT_TYPE,
|
1419 | _calculateChangedBits: calculateChangedBits,
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 | _currentValue: defaultValue,
|
1426 | _currentValue2: defaultValue,
|
1427 |
|
1428 |
|
1429 | _threadCount: 0,
|
1430 |
|
1431 | Provider: null,
|
1432 | Consumer: null
|
1433 | };
|
1434 | context.Provider = {
|
1435 | $$typeof: REACT_PROVIDER_TYPE,
|
1436 | _context: context
|
1437 | };
|
1438 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
1439 | var hasWarnedAboutUsingConsumerProvider = false;
|
1440 |
|
1441 | {
|
1442 |
|
1443 |
|
1444 |
|
1445 | var Consumer = {
|
1446 | $$typeof: REACT_CONTEXT_TYPE,
|
1447 | _context: context,
|
1448 | _calculateChangedBits: context._calculateChangedBits
|
1449 | };
|
1450 |
|
1451 | Object.defineProperties(Consumer, {
|
1452 | Provider: {
|
1453 | get: function () {
|
1454 | if (!hasWarnedAboutUsingConsumerProvider) {
|
1455 | hasWarnedAboutUsingConsumerProvider = true;
|
1456 | warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
1457 | }
|
1458 |
|
1459 | return context.Provider;
|
1460 | },
|
1461 | set: function (_Provider) {
|
1462 | context.Provider = _Provider;
|
1463 | }
|
1464 | },
|
1465 | _currentValue: {
|
1466 | get: function () {
|
1467 | return context._currentValue;
|
1468 | },
|
1469 | set: function (_currentValue) {
|
1470 | context._currentValue = _currentValue;
|
1471 | }
|
1472 | },
|
1473 | _currentValue2: {
|
1474 | get: function () {
|
1475 | return context._currentValue2;
|
1476 | },
|
1477 | set: function (_currentValue2) {
|
1478 | context._currentValue2 = _currentValue2;
|
1479 | }
|
1480 | },
|
1481 | _threadCount: {
|
1482 | get: function () {
|
1483 | return context._threadCount;
|
1484 | },
|
1485 | set: function (_threadCount) {
|
1486 | context._threadCount = _threadCount;
|
1487 | }
|
1488 | },
|
1489 | Consumer: {
|
1490 | get: function () {
|
1491 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
1492 | hasWarnedAboutUsingNestedContextConsumers = true;
|
1493 | warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
1494 | }
|
1495 |
|
1496 | return context.Consumer;
|
1497 | }
|
1498 | }
|
1499 | });
|
1500 |
|
1501 | context.Consumer = Consumer;
|
1502 | }
|
1503 |
|
1504 | {
|
1505 | context._currentRenderer = null;
|
1506 | context._currentRenderer2 = null;
|
1507 | }
|
1508 |
|
1509 | return context;
|
1510 | }
|
1511 |
|
1512 | function lazy(ctor) {
|
1513 | var lazyType = {
|
1514 | $$typeof: REACT_LAZY_TYPE,
|
1515 | _ctor: ctor,
|
1516 |
|
1517 | _status: -1,
|
1518 | _result: null
|
1519 | };
|
1520 |
|
1521 | {
|
1522 |
|
1523 | var defaultProps;
|
1524 | var propTypes;
|
1525 | Object.defineProperties(lazyType, {
|
1526 | defaultProps: {
|
1527 | configurable: true,
|
1528 | get: function () {
|
1529 | return defaultProps;
|
1530 | },
|
1531 | set: function (newDefaultProps) {
|
1532 | warning$1(false, '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.');
|
1533 | defaultProps = newDefaultProps;
|
1534 |
|
1535 | Object.defineProperty(lazyType, 'defaultProps', {
|
1536 | enumerable: true
|
1537 | });
|
1538 | }
|
1539 | },
|
1540 | propTypes: {
|
1541 | configurable: true,
|
1542 | get: function () {
|
1543 | return propTypes;
|
1544 | },
|
1545 | set: function (newPropTypes) {
|
1546 | warning$1(false, '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.');
|
1547 | propTypes = newPropTypes;
|
1548 |
|
1549 | Object.defineProperty(lazyType, 'propTypes', {
|
1550 | enumerable: true
|
1551 | });
|
1552 | }
|
1553 | }
|
1554 | });
|
1555 | }
|
1556 |
|
1557 | return lazyType;
|
1558 | }
|
1559 |
|
1560 | function forwardRef(render) {
|
1561 | {
|
1562 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
1563 | warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
1564 | } else if (typeof render !== 'function') {
|
1565 | warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
1566 | } else {
|
1567 | !(
|
1568 | render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, '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.') : void 0;
|
1569 | }
|
1570 |
|
1571 | if (render != null) {
|
1572 | !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
|
1573 | }
|
1574 | }
|
1575 |
|
1576 | return {
|
1577 | $$typeof: REACT_FORWARD_REF_TYPE,
|
1578 | render: render
|
1579 | };
|
1580 | }
|
1581 |
|
1582 | function isValidElementType(type) {
|
1583 | return typeof type === 'string' || typeof type === 'function' ||
|
1584 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
|
1585 | }
|
1586 |
|
1587 | function memo(type, compare) {
|
1588 | {
|
1589 | if (!isValidElementType(type)) {
|
1590 | warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
1591 | }
|
1592 | }
|
1593 |
|
1594 | return {
|
1595 | $$typeof: REACT_MEMO_TYPE,
|
1596 | type: type,
|
1597 | compare: compare === undefined ? null : compare
|
1598 | };
|
1599 | }
|
1600 |
|
1601 | function resolveDispatcher() {
|
1602 | var dispatcher = ReactCurrentDispatcher.current;
|
1603 |
|
1604 | (function () {
|
1605 | if (!(dispatcher !== null)) {
|
1606 | {
|
1607 | throw ReactError(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:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."));
|
1608 | }
|
1609 | }
|
1610 | })();
|
1611 |
|
1612 | return dispatcher;
|
1613 | }
|
1614 |
|
1615 | function useContext(Context, unstable_observedBits) {
|
1616 | var dispatcher = resolveDispatcher();
|
1617 |
|
1618 | {
|
1619 | !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;
|
1620 |
|
1621 | if (Context._context !== undefined) {
|
1622 | var realContext = Context._context;
|
1623 |
|
1624 |
|
1625 | if (realContext.Consumer === Context) {
|
1626 | warning$1(false, '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?');
|
1627 | } else if (realContext.Provider === Context) {
|
1628 | warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
1629 | }
|
1630 | }
|
1631 | }
|
1632 |
|
1633 | return dispatcher.useContext(Context, unstable_observedBits);
|
1634 | }
|
1635 | function useState(initialState) {
|
1636 | var dispatcher = resolveDispatcher();
|
1637 | return dispatcher.useState(initialState);
|
1638 | }
|
1639 | function useReducer(reducer, initialArg, init) {
|
1640 | var dispatcher = resolveDispatcher();
|
1641 | return dispatcher.useReducer(reducer, initialArg, init);
|
1642 | }
|
1643 | function useRef(initialValue) {
|
1644 | var dispatcher = resolveDispatcher();
|
1645 | return dispatcher.useRef(initialValue);
|
1646 | }
|
1647 | function useEffect(create, inputs) {
|
1648 | var dispatcher = resolveDispatcher();
|
1649 | return dispatcher.useEffect(create, inputs);
|
1650 | }
|
1651 | function useLayoutEffect(create, inputs) {
|
1652 | var dispatcher = resolveDispatcher();
|
1653 | return dispatcher.useLayoutEffect(create, inputs);
|
1654 | }
|
1655 | function useCallback(callback, inputs) {
|
1656 | var dispatcher = resolveDispatcher();
|
1657 | return dispatcher.useCallback(callback, inputs);
|
1658 | }
|
1659 | function useMemo(create, inputs) {
|
1660 | var dispatcher = resolveDispatcher();
|
1661 | return dispatcher.useMemo(create, inputs);
|
1662 | }
|
1663 | function useImperativeHandle(ref, create, inputs) {
|
1664 | var dispatcher = resolveDispatcher();
|
1665 | return dispatcher.useImperativeHandle(ref, create, inputs);
|
1666 | }
|
1667 | function useDebugValue(value, formatterFn) {
|
1668 | {
|
1669 | var dispatcher = resolveDispatcher();
|
1670 | return dispatcher.useDebugValue(value, formatterFn);
|
1671 | }
|
1672 | }
|
1673 | var emptyObject$1 = {};
|
1674 | function useResponder(responder, listenerProps) {
|
1675 | var dispatcher = resolveDispatcher();
|
1676 |
|
1677 | {
|
1678 | if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
|
1679 | warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
|
1680 | return;
|
1681 | }
|
1682 | }
|
1683 |
|
1684 | return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
|
1685 | }
|
1686 |
|
1687 | function withSuspenseConfig(scope, config) {
|
1688 | var previousConfig = ReactCurrentBatchConfig.suspense;
|
1689 | ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
|
1690 |
|
1691 | try {
|
1692 | scope();
|
1693 | } finally {
|
1694 | ReactCurrentBatchConfig.suspense = previousConfig;
|
1695 | }
|
1696 | }
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 | var propTypesMisspellWarningShown;
|
1705 |
|
1706 | {
|
1707 | propTypesMisspellWarningShown = false;
|
1708 | }
|
1709 |
|
1710 | var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
1711 |
|
1712 | function getDeclarationErrorAddendum() {
|
1713 | if (ReactCurrentOwner.current) {
|
1714 | var name = getComponentName(ReactCurrentOwner.current.type);
|
1715 |
|
1716 | if (name) {
|
1717 | return '\n\nCheck the render method of `' + name + '`.';
|
1718 | }
|
1719 | }
|
1720 |
|
1721 | return '';
|
1722 | }
|
1723 |
|
1724 | function getSourceInfoErrorAddendum(source) {
|
1725 | if (source !== undefined) {
|
1726 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
1727 | var lineNumber = source.lineNumber;
|
1728 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
1729 | }
|
1730 |
|
1731 | return '';
|
1732 | }
|
1733 |
|
1734 | function getSourceInfoErrorAddendumForProps(elementProps) {
|
1735 | if (elementProps !== null && elementProps !== undefined) {
|
1736 | return getSourceInfoErrorAddendum(elementProps.__source);
|
1737 | }
|
1738 |
|
1739 | return '';
|
1740 | }
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 | var ownerHasKeyUseWarning = {};
|
1749 |
|
1750 | function getCurrentComponentErrorInfo(parentType) {
|
1751 | var info = getDeclarationErrorAddendum();
|
1752 |
|
1753 | if (!info) {
|
1754 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
1755 |
|
1756 | if (parentName) {
|
1757 | info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
1758 | }
|
1759 | }
|
1760 |
|
1761 | return info;
|
1762 | }
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 | function validateExplicitKey(element, parentType) {
|
1777 | if (!element._store || element._store.validated || element.key != null) {
|
1778 | return;
|
1779 | }
|
1780 |
|
1781 | element._store.validated = true;
|
1782 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
1783 |
|
1784 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
1785 | return;
|
1786 | }
|
1787 |
|
1788 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
1789 |
|
1790 |
|
1791 |
|
1792 | var childOwner = '';
|
1793 |
|
1794 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
1795 |
|
1796 | childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
1797 | }
|
1798 |
|
1799 | setCurrentlyValidatingElement(element);
|
1800 |
|
1801 | {
|
1802 | warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
1803 | }
|
1804 |
|
1805 | setCurrentlyValidatingElement(null);
|
1806 | }
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 | function validateChildKeys(node, parentType) {
|
1819 | if (typeof node !== 'object') {
|
1820 | return;
|
1821 | }
|
1822 |
|
1823 | if (Array.isArray(node)) {
|
1824 | for (var i = 0; i < node.length; i++) {
|
1825 | var child = node[i];
|
1826 |
|
1827 | if (isValidElement(child)) {
|
1828 | validateExplicitKey(child, parentType);
|
1829 | }
|
1830 | }
|
1831 | } else if (isValidElement(node)) {
|
1832 |
|
1833 | if (node._store) {
|
1834 | node._store.validated = true;
|
1835 | }
|
1836 | } else if (node) {
|
1837 | var iteratorFn = getIteratorFn(node);
|
1838 |
|
1839 | if (typeof iteratorFn === 'function') {
|
1840 |
|
1841 |
|
1842 | if (iteratorFn !== node.entries) {
|
1843 | var iterator = iteratorFn.call(node);
|
1844 | var step;
|
1845 |
|
1846 | while (!(step = iterator.next()).done) {
|
1847 | if (isValidElement(step.value)) {
|
1848 | validateExplicitKey(step.value, parentType);
|
1849 | }
|
1850 | }
|
1851 | }
|
1852 | }
|
1853 | }
|
1854 | }
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 | function validatePropTypes(element) {
|
1864 | var type = element.type;
|
1865 |
|
1866 | if (type === null || type === undefined || typeof type === 'string') {
|
1867 | return;
|
1868 | }
|
1869 |
|
1870 | var name = getComponentName(type);
|
1871 | var propTypes;
|
1872 |
|
1873 | if (typeof type === 'function') {
|
1874 | propTypes = type.propTypes;
|
1875 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
1876 |
|
1877 | type.$$typeof === REACT_MEMO_TYPE)) {
|
1878 | propTypes = type.propTypes;
|
1879 | } else {
|
1880 | return;
|
1881 | }
|
1882 |
|
1883 | if (propTypes) {
|
1884 | setCurrentlyValidatingElement(element);
|
1885 | checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
1886 | setCurrentlyValidatingElement(null);
|
1887 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
1888 | propTypesMisspellWarningShown = true;
|
1889 | warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
1890 | }
|
1891 |
|
1892 | if (typeof type.getDefaultProps === 'function') {
|
1893 | !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
1894 | }
|
1895 | }
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 | function validateFragmentProps(fragment) {
|
1903 | setCurrentlyValidatingElement(fragment);
|
1904 | var keys = Object.keys(fragment.props);
|
1905 |
|
1906 | for (var i = 0; i < keys.length; i++) {
|
1907 | var key = keys[i];
|
1908 |
|
1909 | if (key !== 'children' && key !== 'key') {
|
1910 | warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
1911 | break;
|
1912 | }
|
1913 | }
|
1914 |
|
1915 | if (fragment.ref !== null) {
|
1916 | warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
1917 | }
|
1918 |
|
1919 | setCurrentlyValidatingElement(null);
|
1920 | }
|
1921 |
|
1922 | function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
1923 | var validType = isValidElementType(type);
|
1924 |
|
1925 |
|
1926 | if (!validType) {
|
1927 | var info = '';
|
1928 |
|
1929 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
1930 | 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.";
|
1931 | }
|
1932 |
|
1933 | var sourceInfo = getSourceInfoErrorAddendum(source);
|
1934 |
|
1935 | if (sourceInfo) {
|
1936 | info += sourceInfo;
|
1937 | } else {
|
1938 | info += getDeclarationErrorAddendum();
|
1939 | }
|
1940 |
|
1941 | var typeString;
|
1942 |
|
1943 | if (type === null) {
|
1944 | typeString = 'null';
|
1945 | } else if (Array.isArray(type)) {
|
1946 | typeString = 'array';
|
1947 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1948 | typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
1949 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
1950 | } else {
|
1951 | typeString = typeof type;
|
1952 | }
|
1953 |
|
1954 | warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
1955 | }
|
1956 |
|
1957 | var element = jsxDEV(type, props, key, source, self);
|
1958 |
|
1959 |
|
1960 | if (element == null) {
|
1961 | return element;
|
1962 | }
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 |
|
1969 | if (validType) {
|
1970 | var children = props.children;
|
1971 |
|
1972 | if (children !== undefined) {
|
1973 | if (isStaticChildren) {
|
1974 | if (Array.isArray(children)) {
|
1975 | for (var i = 0; i < children.length; i++) {
|
1976 | validateChildKeys(children[i], type);
|
1977 | }
|
1978 |
|
1979 | if (Object.freeze) {
|
1980 | Object.freeze(children);
|
1981 | }
|
1982 | } else {
|
1983 | warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
1984 | }
|
1985 | } else {
|
1986 | validateChildKeys(children, type);
|
1987 | }
|
1988 | }
|
1989 | }
|
1990 |
|
1991 | if (hasOwnProperty$1.call(props, 'key')) {
|
1992 | warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
|
1993 | }
|
1994 |
|
1995 | if (type === REACT_FRAGMENT_TYPE) {
|
1996 | validateFragmentProps(element);
|
1997 | } else {
|
1998 | validatePropTypes(element);
|
1999 | }
|
2000 |
|
2001 | return element;
|
2002 | }
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 | function jsxWithValidationStatic(type, props, key) {
|
2008 | return jsxWithValidation(type, props, key, true);
|
2009 | }
|
2010 | function jsxWithValidationDynamic(type, props, key) {
|
2011 | return jsxWithValidation(type, props, key, false);
|
2012 | }
|
2013 | function createElementWithValidation(type, props, children) {
|
2014 | var validType = isValidElementType(type);
|
2015 |
|
2016 |
|
2017 | if (!validType) {
|
2018 | var info = '';
|
2019 |
|
2020 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
2021 | 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.";
|
2022 | }
|
2023 |
|
2024 | var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
2025 |
|
2026 | if (sourceInfo) {
|
2027 | info += sourceInfo;
|
2028 | } else {
|
2029 | info += getDeclarationErrorAddendum();
|
2030 | }
|
2031 |
|
2032 | var typeString;
|
2033 |
|
2034 | if (type === null) {
|
2035 | typeString = 'null';
|
2036 | } else if (Array.isArray(type)) {
|
2037 | typeString = 'array';
|
2038 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
2039 | typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
2040 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
2041 | } else {
|
2042 | typeString = typeof type;
|
2043 | }
|
2044 |
|
2045 | warning$1(false, '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);
|
2046 | }
|
2047 |
|
2048 | var element = createElement.apply(this, arguments);
|
2049 |
|
2050 |
|
2051 | if (element == null) {
|
2052 | return element;
|
2053 | }
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 | if (validType) {
|
2061 | for (var i = 2; i < arguments.length; i++) {
|
2062 | validateChildKeys(arguments[i], type);
|
2063 | }
|
2064 | }
|
2065 |
|
2066 | if (type === REACT_FRAGMENT_TYPE) {
|
2067 | validateFragmentProps(element);
|
2068 | } else {
|
2069 | validatePropTypes(element);
|
2070 | }
|
2071 |
|
2072 | return element;
|
2073 | }
|
2074 | function createFactoryWithValidation(type) {
|
2075 | var validatedFactory = createElementWithValidation.bind(null, type);
|
2076 | validatedFactory.type = type;
|
2077 |
|
2078 | {
|
2079 | Object.defineProperty(validatedFactory, 'type', {
|
2080 | enumerable: false,
|
2081 | get: function () {
|
2082 | lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
2083 | Object.defineProperty(this, 'type', {
|
2084 | value: type
|
2085 | });
|
2086 | return type;
|
2087 | }
|
2088 | });
|
2089 | }
|
2090 |
|
2091 | return validatedFactory;
|
2092 | }
|
2093 | function cloneElementWithValidation(element, props, children) {
|
2094 | var newElement = cloneElement.apply(this, arguments);
|
2095 |
|
2096 | for (var i = 2; i < arguments.length; i++) {
|
2097 | validateChildKeys(arguments[i], newElement.type);
|
2098 | }
|
2099 |
|
2100 | validatePropTypes(newElement);
|
2101 | return newElement;
|
2102 | }
|
2103 |
|
2104 | var hasBadMapPolyfill;
|
2105 |
|
2106 | {
|
2107 | hasBadMapPolyfill = false;
|
2108 |
|
2109 | try {
|
2110 | var frozenObject = Object.freeze({});
|
2111 | var testMap = new Map([[frozenObject, null]]);
|
2112 | var testSet = new Set([frozenObject]);
|
2113 |
|
2114 |
|
2115 |
|
2116 | testMap.set(0, 0);
|
2117 | testSet.add(0);
|
2118 | } catch (e) {
|
2119 |
|
2120 | hasBadMapPolyfill = true;
|
2121 | }
|
2122 | }
|
2123 |
|
2124 | function createFundamentalComponent(impl) {
|
2125 |
|
2126 |
|
2127 |
|
2128 | if (true && !hasBadMapPolyfill) {
|
2129 | Object.freeze(impl);
|
2130 | }
|
2131 |
|
2132 | var fundamantalComponent = {
|
2133 | $$typeof: REACT_FUNDAMENTAL_TYPE,
|
2134 | impl: impl
|
2135 | };
|
2136 |
|
2137 | {
|
2138 | Object.freeze(fundamantalComponent);
|
2139 | }
|
2140 |
|
2141 | return fundamantalComponent;
|
2142 | }
|
2143 |
|
2144 | function createEventResponder(displayName, responderConfig) {
|
2145 | var getInitialState = responderConfig.getInitialState,
|
2146 | onEvent = responderConfig.onEvent,
|
2147 | onMount = responderConfig.onMount,
|
2148 | onUnmount = responderConfig.onUnmount,
|
2149 | onRootEvent = responderConfig.onRootEvent,
|
2150 | rootEventTypes = responderConfig.rootEventTypes,
|
2151 | targetEventTypes = responderConfig.targetEventTypes,
|
2152 | targetPortalPropagation = responderConfig.targetPortalPropagation;
|
2153 | var eventResponder = {
|
2154 | $$typeof: REACT_RESPONDER_TYPE,
|
2155 | displayName: displayName,
|
2156 | getInitialState: getInitialState || null,
|
2157 | onEvent: onEvent || null,
|
2158 | onMount: onMount || null,
|
2159 | onRootEvent: onRootEvent || null,
|
2160 | onUnmount: onUnmount || null,
|
2161 | rootEventTypes: rootEventTypes || null,
|
2162 | targetEventTypes: targetEventTypes || null,
|
2163 | targetPortalPropagation: targetPortalPropagation || false
|
2164 | };
|
2165 |
|
2166 |
|
2167 |
|
2168 | if (true && !hasBadMapPolyfill) {
|
2169 | Object.freeze(eventResponder);
|
2170 | }
|
2171 |
|
2172 | return eventResponder;
|
2173 | }
|
2174 |
|
2175 | function createScope(fn) {
|
2176 | var scopeComponent = {
|
2177 | $$typeof: REACT_SCOPE_TYPE,
|
2178 | fn: fn
|
2179 | };
|
2180 |
|
2181 | {
|
2182 | Object.freeze(scopeComponent);
|
2183 | }
|
2184 |
|
2185 | return scopeComponent;
|
2186 | }
|
2187 |
|
2188 |
|
2189 |
|
2190 |
|
2191 |
|
2192 |
|
2193 |
|
2194 |
|
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 |
|
2208 |
|
2209 |
|
2210 |
|
2211 |
|
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 |
|
2219 |
|
2220 |
|
2221 |
|
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 | var enableFlareAPI = false;
|
2227 |
|
2228 | var enableFundamentalAPI = false;
|
2229 |
|
2230 | var enableScopeAPI = false;
|
2231 |
|
2232 | var enableJSXTransformAPI = false;
|
2233 |
|
2234 |
|
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 |
|
2240 |
|
2241 |
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 |
|
2249 |
|
2250 |
|
2251 |
|
2252 | var React = {
|
2253 | Children: {
|
2254 | map: mapChildren,
|
2255 | forEach: forEachChildren,
|
2256 | count: countChildren,
|
2257 | toArray: toArray,
|
2258 | only: onlyChild
|
2259 | },
|
2260 | createRef: createRef,
|
2261 | Component: Component,
|
2262 | PureComponent: PureComponent,
|
2263 | createContext: createContext,
|
2264 | forwardRef: forwardRef,
|
2265 | lazy: lazy,
|
2266 | memo: memo,
|
2267 | useCallback: useCallback,
|
2268 | useContext: useContext,
|
2269 | useEffect: useEffect,
|
2270 | useImperativeHandle: useImperativeHandle,
|
2271 | useDebugValue: useDebugValue,
|
2272 | useLayoutEffect: useLayoutEffect,
|
2273 | useMemo: useMemo,
|
2274 | useReducer: useReducer,
|
2275 | useRef: useRef,
|
2276 | useState: useState,
|
2277 | Fragment: REACT_FRAGMENT_TYPE,
|
2278 | Profiler: REACT_PROFILER_TYPE,
|
2279 | StrictMode: REACT_STRICT_MODE_TYPE,
|
2280 | Suspense: REACT_SUSPENSE_TYPE,
|
2281 | unstable_SuspenseList: REACT_SUSPENSE_LIST_TYPE,
|
2282 | createElement: createElementWithValidation,
|
2283 | cloneElement: cloneElementWithValidation,
|
2284 | createFactory: createFactoryWithValidation,
|
2285 | isValidElement: isValidElement,
|
2286 | version: ReactVersion,
|
2287 | unstable_withSuspenseConfig: withSuspenseConfig,
|
2288 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
2289 | };
|
2290 |
|
2291 | if (enableFlareAPI) {
|
2292 | React.unstable_useResponder = useResponder;
|
2293 | React.unstable_createResponder = createEventResponder;
|
2294 | }
|
2295 |
|
2296 | if (enableFundamentalAPI) {
|
2297 | React.unstable_createFundamental = createFundamentalComponent;
|
2298 | }
|
2299 |
|
2300 | if (enableScopeAPI) {
|
2301 | React.unstable_createScope = createScope;
|
2302 | }
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 | if (enableJSXTransformAPI) {
|
2309 | {
|
2310 | React.jsxDEV = jsxWithValidation;
|
2311 | React.jsx = jsxWithValidationDynamic;
|
2312 | React.jsxs = jsxWithValidationStatic;
|
2313 | }
|
2314 | }
|
2315 |
|
2316 |
|
2317 |
|
2318 | var React$2 = Object.freeze({
|
2319 | default: React
|
2320 | });
|
2321 |
|
2322 | var React$3 = ( React$2 && React ) || React$2;
|
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 | var react = React$3.default || React$3;
|
2329 |
|
2330 | module.exports = react;
|
2331 | })();
|
2332 | }
|