1 | (function webpackUniversalModuleDefinition(root, factory) {
|
2 | if(typeof exports === 'object' && typeof module === 'object')
|
3 | module.exports = factory();
|
4 | else if(typeof define === 'function' && define.amd)
|
5 | define("react-route-hook", [], factory);
|
6 | else if(typeof exports === 'object')
|
7 | exports["react-route-hook"] = factory();
|
8 | else
|
9 | root["react-route-hook"] = factory();
|
10 | })(typeof self !== 'undefined' ? self : this, function() {
|
11 | return (function(modules) {
|
12 |
|
13 | var installedModules = {};
|
14 |
|
15 |
|
16 | function __webpack_require__(moduleId) {
|
17 |
|
18 |
|
19 | if(installedModules[moduleId]) {
|
20 | return installedModules[moduleId].exports;
|
21 | }
|
22 |
|
23 | var module = installedModules[moduleId] = {
|
24 | i: moduleId,
|
25 | l: false,
|
26 | exports: {}
|
27 | };
|
28 |
|
29 |
|
30 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31 |
|
32 |
|
33 | module.l = true;
|
34 |
|
35 |
|
36 | return module.exports;
|
37 | }
|
38 |
|
39 |
|
40 |
|
41 | __webpack_require__.m = modules;
|
42 |
|
43 |
|
44 | __webpack_require__.c = installedModules;
|
45 |
|
46 |
|
47 | __webpack_require__.d = function(exports, name, getter) {
|
48 | if(!__webpack_require__.o(exports, name)) {
|
49 | Object.defineProperty(exports, name, {
|
50 | configurable: false,
|
51 | enumerable: true,
|
52 | get: getter
|
53 | /******/ });
|
54 | /******/ }
|
55 | /******/ };
|
56 | /******/
|
57 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
58 | /******/ __webpack_require__.n = function(module) {
|
59 | var getter = module && module.__esModule ?
|
60 | function getDefault() { return module['default']; } :
|
61 | function getModuleExports() { return module; };
|
62 | __webpack_require__.d(getter, 'a', getter);
|
63 | return getter;
|
64 | };
|
65 |
|
66 |
|
67 | __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
68 |
|
69 |
|
70 | __webpack_require__.p = "";
|
71 |
|
72 |
|
73 | return __webpack_require__(__webpack_require__.s = 15);
|
74 | })
|
75 |
|
76 | ([
|
77 |
|
78 | (function(module, exports) {
|
79 |
|
80 |
|
81 | var process = module.exports = {};
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 | var cachedSetTimeout;
|
89 | var cachedClearTimeout;
|
90 |
|
91 | function defaultSetTimout() {
|
92 | throw new Error('setTimeout has not been defined');
|
93 | }
|
94 | function defaultClearTimeout () {
|
95 | throw new Error('clearTimeout has not been defined');
|
96 | }
|
97 | (function () {
|
98 | try {
|
99 | if (typeof setTimeout === 'function') {
|
100 | cachedSetTimeout = setTimeout;
|
101 | } else {
|
102 | cachedSetTimeout = defaultSetTimout;
|
103 | }
|
104 | } catch (e) {
|
105 | cachedSetTimeout = defaultSetTimout;
|
106 | }
|
107 | try {
|
108 | if (typeof clearTimeout === 'function') {
|
109 | cachedClearTimeout = clearTimeout;
|
110 | } else {
|
111 | cachedClearTimeout = defaultClearTimeout;
|
112 | }
|
113 | } catch (e) {
|
114 | cachedClearTimeout = defaultClearTimeout;
|
115 | }
|
116 | } ())
|
117 | function runTimeout(fun) {
|
118 | if (cachedSetTimeout === setTimeout) {
|
119 |
|
120 | return setTimeout(fun, 0);
|
121 | }
|
122 |
|
123 | if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
124 | cachedSetTimeout = setTimeout;
|
125 | return setTimeout(fun, 0);
|
126 | }
|
127 | try {
|
128 |
|
129 | return cachedSetTimeout(fun, 0);
|
130 | } catch(e){
|
131 | try {
|
132 |
|
133 | return cachedSetTimeout.call(null, fun, 0);
|
134 | } catch(e){
|
135 |
|
136 | return cachedSetTimeout.call(this, fun, 0);
|
137 | }
|
138 | }
|
139 |
|
140 |
|
141 | }
|
142 | function runClearTimeout(marker) {
|
143 | if (cachedClearTimeout === clearTimeout) {
|
144 |
|
145 | return clearTimeout(marker);
|
146 | }
|
147 |
|
148 | if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
149 | cachedClearTimeout = clearTimeout;
|
150 | return clearTimeout(marker);
|
151 | }
|
152 | try {
|
153 |
|
154 | return cachedClearTimeout(marker);
|
155 | } catch (e){
|
156 | try {
|
157 |
|
158 | return cachedClearTimeout.call(null, marker);
|
159 | } catch (e){
|
160 |
|
161 |
|
162 | return cachedClearTimeout.call(this, marker);
|
163 | }
|
164 | }
|
165 |
|
166 |
|
167 |
|
168 | }
|
169 | var queue = [];
|
170 | var draining = false;
|
171 | var currentQueue;
|
172 | var queueIndex = -1;
|
173 |
|
174 | function cleanUpNextTick() {
|
175 | if (!draining || !currentQueue) {
|
176 | return;
|
177 | }
|
178 | draining = false;
|
179 | if (currentQueue.length) {
|
180 | queue = currentQueue.concat(queue);
|
181 | } else {
|
182 | queueIndex = -1;
|
183 | }
|
184 | if (queue.length) {
|
185 | drainQueue();
|
186 | }
|
187 | }
|
188 |
|
189 | function drainQueue() {
|
190 | if (draining) {
|
191 | return;
|
192 | }
|
193 | var timeout = runTimeout(cleanUpNextTick);
|
194 | draining = true;
|
195 |
|
196 | var len = queue.length;
|
197 | while(len) {
|
198 | currentQueue = queue;
|
199 | queue = [];
|
200 | while (++queueIndex < len) {
|
201 | if (currentQueue) {
|
202 | currentQueue[queueIndex].run();
|
203 | }
|
204 | }
|
205 | queueIndex = -1;
|
206 | len = queue.length;
|
207 | }
|
208 | currentQueue = null;
|
209 | draining = false;
|
210 | runClearTimeout(timeout);
|
211 | }
|
212 |
|
213 | process.nextTick = function (fun) {
|
214 | var args = new Array(arguments.length - 1);
|
215 | if (arguments.length > 1) {
|
216 | for (var i = 1; i < arguments.length; i++) {
|
217 | args[i - 1] = arguments[i];
|
218 | }
|
219 | }
|
220 | queue.push(new Item(fun, args));
|
221 | if (queue.length === 1 && !draining) {
|
222 | runTimeout(drainQueue);
|
223 | }
|
224 | };
|
225 |
|
226 |
|
227 | function Item(fun, array) {
|
228 | this.fun = fun;
|
229 | this.array = array;
|
230 | }
|
231 | Item.prototype.run = function () {
|
232 | this.fun.apply(null, this.array);
|
233 | };
|
234 | process.title = 'browser';
|
235 | process.browser = true;
|
236 | process.env = {};
|
237 | process.argv = [];
|
238 | process.version = '';
|
239 | process.versions = {};
|
240 |
|
241 | function noop() {}
|
242 |
|
243 | process.on = noop;
|
244 | process.addListener = noop;
|
245 | process.once = noop;
|
246 | process.off = noop;
|
247 | process.removeListener = noop;
|
248 | process.removeAllListeners = noop;
|
249 | process.emit = noop;
|
250 | process.prependListener = noop;
|
251 | process.prependOnceListener = noop;
|
252 |
|
253 | process.listeners = function (name) { return [] }
|
254 |
|
255 | process.binding = function (name) {
|
256 | throw new Error('process.binding is not supported');
|
257 | };
|
258 |
|
259 | process.cwd = function () { return '/' };
|
260 | process.chdir = function (dir) {
|
261 | throw new Error('process.chdir is not supported');
|
262 | };
|
263 | process.umask = function() { return 0; };
|
264 |
|
265 |
|
266 | }),
|
267 |
|
268 | (function(module, exports, __webpack_require__) {
|
269 |
|
270 | "use strict";
|
271 | (function(process) {
|
272 |
|
273 | if (process.env.NODE_ENV === 'production') {
|
274 | module.exports = __webpack_require__(17);
|
275 | } else {
|
276 | module.exports = __webpack_require__(18);
|
277 | }
|
278 |
|
279 | }.call(exports, __webpack_require__(0)))
|
280 |
|
281 | }),
|
282 |
|
283 | (function(module, exports, __webpack_require__) {
|
284 |
|
285 | (function(process) { |
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 | if (process.env.NODE_ENV !== 'production') {
|
293 | var ReactIs = __webpack_require__(11);
|
294 |
|
295 |
|
296 |
|
297 | var throwOnDirectAccess = true;
|
298 | module.exports = __webpack_require__(23)(ReactIs.isElement, throwOnDirectAccess);
|
299 | } else {
|
300 |
|
301 |
|
302 | module.exports = __webpack_require__(24)();
|
303 | }
|
304 |
|
305 | }.call(exports, __webpack_require__(0)))
|
306 |
|
307 | }),
|
308 |
|
309 | (function(module, exports, __webpack_require__) {
|
310 |
|
311 | "use strict";
|
312 | (function(process) { |
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 | var __DEV__ = process.env.NODE_ENV !== 'production';
|
329 |
|
330 | var warning = function() {};
|
331 |
|
332 | if (__DEV__) {
|
333 | var printWarning = function printWarning(format, args) {
|
334 | var len = arguments.length;
|
335 | args = new Array(len > 1 ? len - 1 : 0);
|
336 | for (var key = 1; key < len; key++) {
|
337 | args[key - 1] = arguments[key];
|
338 | }
|
339 | var argIndex = 0;
|
340 | var message = 'Warning: ' +
|
341 | format.replace(/%s/g, function() {
|
342 | return args[argIndex++];
|
343 | });
|
344 | if (typeof console !== 'undefined') {
|
345 | console.error(message);
|
346 | }
|
347 | try {
|
348 |
|
349 |
|
350 |
|
351 | throw new Error(message);
|
352 | } catch (x) {}
|
353 | }
|
354 |
|
355 | warning = function(condition, format, args) {
|
356 | var len = arguments.length;
|
357 | args = new Array(len > 2 ? len - 2 : 0);
|
358 | for (var key = 2; key < len; key++) {
|
359 | args[key - 2] = arguments[key];
|
360 | }
|
361 | if (format === undefined) {
|
362 | throw new Error(
|
363 | '`warning(condition, format, ...args)` requires a warning ' +
|
364 | 'message argument'
|
365 | );
|
366 | }
|
367 | if (!condition) {
|
368 | printWarning.apply(null, [format].concat(args));
|
369 | }
|
370 | };
|
371 | }
|
372 |
|
373 | module.exports = warning;
|
374 |
|
375 | }.call(exports, __webpack_require__(0)))
|
376 |
|
377 | }),
|
378 |
|
379 | (function(module, exports, __webpack_require__) {
|
380 |
|
381 | "use strict";
|
382 | (function(process) { |
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 | var invariant = function(condition, format, a, b, c, d, e, f) {
|
403 | if (process.env.NODE_ENV !== 'production') {
|
404 | if (format === undefined) {
|
405 | throw new Error('invariant requires an error message argument');
|
406 | }
|
407 | }
|
408 |
|
409 | if (!condition) {
|
410 | var error;
|
411 | if (format === undefined) {
|
412 | error = new Error(
|
413 | 'Minified exception occurred; use the non-minified dev environment ' +
|
414 | 'for the full error message and additional helpful warnings.'
|
415 | );
|
416 | } else {
|
417 | var args = [a, b, c, d, e, f];
|
418 | var argIndex = 0;
|
419 | error = new Error(
|
420 | format.replace(/%s/g, function() { return args[argIndex++]; })
|
421 | );
|
422 | error.name = 'Invariant Violation';
|
423 | }
|
424 |
|
425 | error.framesToPop = 1;
|
426 | throw error;
|
427 | }
|
428 | };
|
429 |
|
430 | module.exports = invariant;
|
431 |
|
432 | }.call(exports, __webpack_require__(0)))
|
433 |
|
434 | }),
|
435 |
|
436 | (function(module, exports, __webpack_require__) {
|
437 |
|
438 | "use strict";
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
448 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
449 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
450 |
|
451 | function toObject(val) {
|
452 | if (val === null || val === undefined) {
|
453 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
454 | }
|
455 |
|
456 | return Object(val);
|
457 | }
|
458 |
|
459 | function shouldUseNative() {
|
460 | try {
|
461 | if (!Object.assign) {
|
462 | return false;
|
463 | }
|
464 |
|
465 |
|
466 |
|
467 |
|
468 | var test1 = new String('abc');
|
469 | test1[5] = 'de';
|
470 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
471 | return false;
|
472 | }
|
473 |
|
474 |
|
475 | var test2 = {};
|
476 | for (var i = 0; i < 10; i++) {
|
477 | test2['_' + String.fromCharCode(i)] = i;
|
478 | }
|
479 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
480 | return test2[n];
|
481 | });
|
482 | if (order2.join('') !== '0123456789') {
|
483 | return false;
|
484 | }
|
485 |
|
486 |
|
487 | var test3 = {};
|
488 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
489 | test3[letter] = letter;
|
490 | });
|
491 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
492 | 'abcdefghijklmnopqrst') {
|
493 | return false;
|
494 | }
|
495 |
|
496 | return true;
|
497 | } catch (err) {
|
498 |
|
499 | return false;
|
500 | }
|
501 | }
|
502 |
|
503 | module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
504 | var from;
|
505 | var to = toObject(target);
|
506 | var symbols;
|
507 |
|
508 | for (var s = 1; s < arguments.length; s++) {
|
509 | from = Object(arguments[s]);
|
510 |
|
511 | for (var key in from) {
|
512 | if (hasOwnProperty.call(from, key)) {
|
513 | to[key] = from[key];
|
514 | }
|
515 | }
|
516 |
|
517 | if (getOwnPropertySymbols) {
|
518 | symbols = getOwnPropertySymbols(from);
|
519 | for (var i = 0; i < symbols.length; i++) {
|
520 | if (propIsEnumerable.call(from, symbols[i])) {
|
521 | to[symbols[i]] = from[symbols[i]];
|
522 | }
|
523 | }
|
524 | }
|
525 | }
|
526 |
|
527 | return to;
|
528 | };
|
529 |
|
530 |
|
531 | }),
|
532 |
|
533 | (function(module, exports, __webpack_require__) {
|
534 |
|
535 | "use strict";
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
546 |
|
547 | module.exports = ReactPropTypesSecret;
|
548 |
|
549 |
|
550 | }),
|
551 |
|
552 | (function(module, __webpack_exports__, __webpack_require__) {
|
553 |
|
554 | "use strict";
|
555 | (function(process) {
|
556 |
|
557 | __webpack_require__.d(__webpack_exports__, "b", function() { return createMemoryHistory; });
|
558 | __webpack_require__.d(__webpack_exports__, "a", function() { return createLocation; });
|
559 | __webpack_require__.d(__webpack_exports__, "d", function() { return locationsAreEqual; });
|
560 |
|
561 | __webpack_require__.d(__webpack_exports__, "c", function() { return createPath; });
|
562 | var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(25);
|
563 | var __WEBPACK_IMPORTED_MODULE_1_resolve_pathname__ = __webpack_require__(26);
|
564 | var __WEBPACK_IMPORTED_MODULE_2_value_equal__ = __webpack_require__(27);
|
565 | var __WEBPACK_IMPORTED_MODULE_3_tiny_warning__ = __webpack_require__(28);
|
566 | var __WEBPACK_IMPORTED_MODULE_4_tiny_invariant__ = __webpack_require__(29);
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 | function addLeadingSlash(path) {
|
574 | return path.charAt(0) === '/' ? path : '/' + path;
|
575 | }
|
576 | function stripLeadingSlash(path) {
|
577 | return path.charAt(0) === '/' ? path.substr(1) : path;
|
578 | }
|
579 | function hasBasename(path, prefix) {
|
580 | return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path);
|
581 | }
|
582 | function stripBasename(path, prefix) {
|
583 | return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
584 | }
|
585 | function stripTrailingSlash(path) {
|
586 | return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
587 | }
|
588 | function parsePath(path) {
|
589 | var pathname = path || '/';
|
590 | var search = '';
|
591 | var hash = '';
|
592 | var hashIndex = pathname.indexOf('#');
|
593 |
|
594 | if (hashIndex !== -1) {
|
595 | hash = pathname.substr(hashIndex);
|
596 | pathname = pathname.substr(0, hashIndex);
|
597 | }
|
598 |
|
599 | var searchIndex = pathname.indexOf('?');
|
600 |
|
601 | if (searchIndex !== -1) {
|
602 | search = pathname.substr(searchIndex);
|
603 | pathname = pathname.substr(0, searchIndex);
|
604 | }
|
605 |
|
606 | return {
|
607 | pathname: pathname,
|
608 | search: search === '?' ? '' : search,
|
609 | hash: hash === '#' ? '' : hash
|
610 | };
|
611 | }
|
612 | function createPath(location) {
|
613 | var pathname = location.pathname,
|
614 | search = location.search,
|
615 | hash = location.hash;
|
616 | var path = pathname || '/';
|
617 | if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
618 | if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
619 | return path;
|
620 | }
|
621 |
|
622 | function createLocation(path, state, key, currentLocation) {
|
623 | var location;
|
624 |
|
625 | if (typeof path === 'string') {
|
626 |
|
627 | location = parsePath(path);
|
628 | location.state = state;
|
629 | } else {
|
630 |
|
631 | location = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" ])({}, path);
|
632 | if (location.pathname === undefined) location.pathname = '';
|
633 |
|
634 | if (location.search) {
|
635 | if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
636 | } else {
|
637 | location.search = '';
|
638 | }
|
639 |
|
640 | if (location.hash) {
|
641 | if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
642 | } else {
|
643 | location.hash = '';
|
644 | }
|
645 |
|
646 | if (state !== undefined && location.state === undefined) location.state = state;
|
647 | }
|
648 |
|
649 | try {
|
650 | location.pathname = decodeURI(location.pathname);
|
651 | } catch (e) {
|
652 | if (e instanceof URIError) {
|
653 | throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
654 | } else {
|
655 | throw e;
|
656 | }
|
657 | }
|
658 |
|
659 | if (key) location.key = key;
|
660 |
|
661 | if (currentLocation) {
|
662 |
|
663 | if (!location.pathname) {
|
664 | location.pathname = currentLocation.pathname;
|
665 | } else if (location.pathname.charAt(0) !== '/') {
|
666 | location.pathname = Object(__WEBPACK_IMPORTED_MODULE_1_resolve_pathname__["a" ])(location.pathname, currentLocation.pathname);
|
667 | }
|
668 | } else {
|
669 |
|
670 | if (!location.pathname) {
|
671 | location.pathname = '/';
|
672 | }
|
673 | }
|
674 |
|
675 | return location;
|
676 | }
|
677 | function locationsAreEqual(a, b) {
|
678 | return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && Object(__WEBPACK_IMPORTED_MODULE_2_value_equal__["a" ])(a.state, b.state);
|
679 | }
|
680 |
|
681 | function createTransitionManager() {
|
682 | var prompt = null;
|
683 |
|
684 | function setPrompt(nextPrompt) {
|
685 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(prompt == null, 'A history supports only one prompt at a time') : void 0;
|
686 | prompt = nextPrompt;
|
687 | return function () {
|
688 | if (prompt === nextPrompt) prompt = null;
|
689 | };
|
690 | }
|
691 |
|
692 | function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
693 |
|
694 |
|
695 |
|
696 | if (prompt != null) {
|
697 | var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
698 |
|
699 | if (typeof result === 'string') {
|
700 | if (typeof getUserConfirmation === 'function') {
|
701 | getUserConfirmation(result, callback);
|
702 | } else {
|
703 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
|
704 | callback(true);
|
705 | }
|
706 | } else {
|
707 |
|
708 | callback(result !== false);
|
709 | }
|
710 | } else {
|
711 | callback(true);
|
712 | }
|
713 | }
|
714 |
|
715 | var listeners = [];
|
716 |
|
717 | function appendListener(fn) {
|
718 | var isActive = true;
|
719 |
|
720 | function listener() {
|
721 | if (isActive) fn.apply(void 0, arguments);
|
722 | }
|
723 |
|
724 | listeners.push(listener);
|
725 | return function () {
|
726 | isActive = false;
|
727 | listeners = listeners.filter(function (item) {
|
728 | return item !== listener;
|
729 | });
|
730 | };
|
731 | }
|
732 |
|
733 | function notifyListeners() {
|
734 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
735 | args[_key] = arguments[_key];
|
736 | }
|
737 |
|
738 | listeners.forEach(function (listener) {
|
739 | return listener.apply(void 0, args);
|
740 | });
|
741 | }
|
742 |
|
743 | return {
|
744 | setPrompt: setPrompt,
|
745 | confirmTransitionTo: confirmTransitionTo,
|
746 | appendListener: appendListener,
|
747 | notifyListeners: notifyListeners
|
748 | };
|
749 | }
|
750 |
|
751 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
752 | function getConfirmation(message, callback) {
|
753 | callback(window.confirm(message));
|
754 | }
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | function supportsHistory() {
|
764 | var ua = window.navigator.userAgent;
|
765 | if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
766 | return window.history && 'pushState' in window.history;
|
767 | }
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 | function supportsPopStateOnHashChange() {
|
774 | return window.navigator.userAgent.indexOf('Trident') === -1;
|
775 | }
|
776 |
|
777 |
|
778 |
|
779 |
|
780 | function supportsGoWithoutReloadUsingHash() {
|
781 | return window.navigator.userAgent.indexOf('Firefox') === -1;
|
782 | }
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 | function isExtraneousPopstateEvent(event) {
|
790 | event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
791 | }
|
792 |
|
793 | var PopStateEvent = 'popstate';
|
794 | var HashChangeEvent = 'hashchange';
|
795 |
|
796 | function getHistoryState() {
|
797 | try {
|
798 | return window.history.state || {};
|
799 | } catch (e) {
|
800 |
|
801 |
|
802 | return {};
|
803 | }
|
804 | }
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 | function createBrowserHistory(props) {
|
812 | if (props === void 0) {
|
813 | props = {};
|
814 | }
|
815 |
|
816 | !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" ])(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" ])(false) : void 0;
|
817 | var globalHistory = window.history;
|
818 | var canUseHistory = supportsHistory();
|
819 | var needsHashChangeListener = !supportsPopStateOnHashChange();
|
820 | var _props = props,
|
821 | _props$forceRefresh = _props.forceRefresh,
|
822 | forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
823 | _props$getUserConfirm = _props.getUserConfirmation,
|
824 | getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
825 | _props$keyLength = _props.keyLength,
|
826 | keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
827 | var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
828 |
|
829 | function getDOMLocation(historyState) {
|
830 | var _ref = historyState || {},
|
831 | key = _ref.key,
|
832 | state = _ref.state;
|
833 |
|
834 | var _window$location = window.location,
|
835 | pathname = _window$location.pathname,
|
836 | search = _window$location.search,
|
837 | hash = _window$location.hash;
|
838 | var path = pathname + search + hash;
|
839 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
|
840 | if (basename) path = stripBasename(path, basename);
|
841 | return createLocation(path, state, key);
|
842 | }
|
843 |
|
844 | function createKey() {
|
845 | return Math.random().toString(36).substr(2, keyLength);
|
846 | }
|
847 |
|
848 | var transitionManager = createTransitionManager();
|
849 |
|
850 | function setState(nextState) {
|
851 | Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" ])(history, nextState);
|
852 |
|
853 | history.length = globalHistory.length;
|
854 | transitionManager.notifyListeners(history.location, history.action);
|
855 | }
|
856 |
|
857 | function handlePopState(event) {
|
858 |
|
859 | if (isExtraneousPopstateEvent(event)) return;
|
860 | handlePop(getDOMLocation(event.state));
|
861 | }
|
862 |
|
863 | function handleHashChange() {
|
864 | handlePop(getDOMLocation(getHistoryState()));
|
865 | }
|
866 |
|
867 | var forceNextPop = false;
|
868 |
|
869 | function handlePop(location) {
|
870 | if (forceNextPop) {
|
871 | forceNextPop = false;
|
872 | setState();
|
873 | } else {
|
874 | var action = 'POP';
|
875 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
876 | if (ok) {
|
877 | setState({
|
878 | action: action,
|
879 | location: location
|
880 | });
|
881 | } else {
|
882 | revertPop(location);
|
883 | }
|
884 | });
|
885 | }
|
886 | }
|
887 |
|
888 | function revertPop(fromLocation) {
|
889 | var toLocation = history.location;
|
890 |
|
891 |
|
892 |
|
893 | var toIndex = allKeys.indexOf(toLocation.key);
|
894 | if (toIndex === -1) toIndex = 0;
|
895 | var fromIndex = allKeys.indexOf(fromLocation.key);
|
896 | if (fromIndex === -1) fromIndex = 0;
|
897 | var delta = toIndex - fromIndex;
|
898 |
|
899 | if (delta) {
|
900 | forceNextPop = true;
|
901 | go(delta);
|
902 | }
|
903 | }
|
904 |
|
905 | var initialLocation = getDOMLocation(getHistoryState());
|
906 | var allKeys = [initialLocation.key];
|
907 |
|
908 | function createHref(location) {
|
909 | return basename + createPath(location);
|
910 | }
|
911 |
|
912 | function push(path, state) {
|
913 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
914 | var action = 'PUSH';
|
915 | var location = createLocation(path, state, createKey(), history.location);
|
916 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
917 | if (!ok) return;
|
918 | var href = createHref(location);
|
919 | var key = location.key,
|
920 | state = location.state;
|
921 |
|
922 | if (canUseHistory) {
|
923 | globalHistory.pushState({
|
924 | key: key,
|
925 | state: state
|
926 | }, null, href);
|
927 |
|
928 | if (forceRefresh) {
|
929 | window.location.href = href;
|
930 | } else {
|
931 | var prevIndex = allKeys.indexOf(history.location.key);
|
932 | var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
|
933 | nextKeys.push(location.key);
|
934 | allKeys = nextKeys;
|
935 | setState({
|
936 | action: action,
|
937 | location: location
|
938 | });
|
939 | }
|
940 | } else {
|
941 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
|
942 | window.location.href = href;
|
943 | }
|
944 | });
|
945 | }
|
946 |
|
947 | function replace(path, state) {
|
948 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
949 | var action = 'REPLACE';
|
950 | var location = createLocation(path, state, createKey(), history.location);
|
951 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
952 | if (!ok) return;
|
953 | var href = createHref(location);
|
954 | var key = location.key,
|
955 | state = location.state;
|
956 |
|
957 | if (canUseHistory) {
|
958 | globalHistory.replaceState({
|
959 | key: key,
|
960 | state: state
|
961 | }, null, href);
|
962 |
|
963 | if (forceRefresh) {
|
964 | window.location.replace(href);
|
965 | } else {
|
966 | var prevIndex = allKeys.indexOf(history.location.key);
|
967 | if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
968 | setState({
|
969 | action: action,
|
970 | location: location
|
971 | });
|
972 | }
|
973 | } else {
|
974 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
|
975 | window.location.replace(href);
|
976 | }
|
977 | });
|
978 | }
|
979 |
|
980 | function go(n) {
|
981 | globalHistory.go(n);
|
982 | }
|
983 |
|
984 | function goBack() {
|
985 | go(-1);
|
986 | }
|
987 |
|
988 | function goForward() {
|
989 | go(1);
|
990 | }
|
991 |
|
992 | var listenerCount = 0;
|
993 |
|
994 | function checkDOMListeners(delta) {
|
995 | listenerCount += delta;
|
996 |
|
997 | if (listenerCount === 1 && delta === 1) {
|
998 | window.addEventListener(PopStateEvent, handlePopState);
|
999 | if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
1000 | } else if (listenerCount === 0) {
|
1001 | window.removeEventListener(PopStateEvent, handlePopState);
|
1002 | if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
1003 | }
|
1004 | }
|
1005 |
|
1006 | var isBlocked = false;
|
1007 |
|
1008 | function block(prompt) {
|
1009 | if (prompt === void 0) {
|
1010 | prompt = false;
|
1011 | }
|
1012 |
|
1013 | var unblock = transitionManager.setPrompt(prompt);
|
1014 |
|
1015 | if (!isBlocked) {
|
1016 | checkDOMListeners(1);
|
1017 | isBlocked = true;
|
1018 | }
|
1019 |
|
1020 | return function () {
|
1021 | if (isBlocked) {
|
1022 | isBlocked = false;
|
1023 | checkDOMListeners(-1);
|
1024 | }
|
1025 |
|
1026 | return unblock();
|
1027 | };
|
1028 | }
|
1029 |
|
1030 | function listen(listener) {
|
1031 | var unlisten = transitionManager.appendListener(listener);
|
1032 | checkDOMListeners(1);
|
1033 | return function () {
|
1034 | checkDOMListeners(-1);
|
1035 | unlisten();
|
1036 | };
|
1037 | }
|
1038 |
|
1039 | var history = {
|
1040 | length: globalHistory.length,
|
1041 | action: 'POP',
|
1042 | location: initialLocation,
|
1043 | createHref: createHref,
|
1044 | push: push,
|
1045 | replace: replace,
|
1046 | go: go,
|
1047 | goBack: goBack,
|
1048 | goForward: goForward,
|
1049 | block: block,
|
1050 | listen: listen
|
1051 | };
|
1052 | return history;
|
1053 | }
|
1054 |
|
1055 | var HashChangeEvent$1 = 'hashchange';
|
1056 | var HashPathCoders = {
|
1057 | hashbang: {
|
1058 | encodePath: function encodePath(path) {
|
1059 | return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
|
1060 | },
|
1061 | decodePath: function decodePath(path) {
|
1062 | return path.charAt(0) === '!' ? path.substr(1) : path;
|
1063 | }
|
1064 | },
|
1065 | noslash: {
|
1066 | encodePath: stripLeadingSlash,
|
1067 | decodePath: addLeadingSlash
|
1068 | },
|
1069 | slash: {
|
1070 | encodePath: addLeadingSlash,
|
1071 | decodePath: addLeadingSlash
|
1072 | }
|
1073 | };
|
1074 |
|
1075 | function getHashPath() {
|
1076 |
|
1077 |
|
1078 | var href = window.location.href;
|
1079 | var hashIndex = href.indexOf('#');
|
1080 | return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
|
1081 | }
|
1082 |
|
1083 | function pushHashPath(path) {
|
1084 | window.location.hash = path;
|
1085 | }
|
1086 |
|
1087 | function replaceHashPath(path) {
|
1088 | var hashIndex = window.location.href.indexOf('#');
|
1089 | window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
|
1090 | }
|
1091 |
|
1092 | function createHashHistory(props) {
|
1093 | if (props === void 0) {
|
1094 | props = {};
|
1095 | }
|
1096 |
|
1097 | !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" ])(false, 'Hash history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" ])(false) : void 0;
|
1098 | var globalHistory = window.history;
|
1099 | var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
1100 | var _props = props,
|
1101 | _props$getUserConfirm = _props.getUserConfirmation,
|
1102 | getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
1103 | _props$hashType = _props.hashType,
|
1104 | hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
|
1105 | var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
1106 | var _HashPathCoders$hashT = HashPathCoders[hashType],
|
1107 | encodePath = _HashPathCoders$hashT.encodePath,
|
1108 | decodePath = _HashPathCoders$hashT.decodePath;
|
1109 |
|
1110 | function getDOMLocation() {
|
1111 | var path = decodePath(getHashPath());
|
1112 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
|
1113 | if (basename) path = stripBasename(path, basename);
|
1114 | return createLocation(path);
|
1115 | }
|
1116 |
|
1117 | var transitionManager = createTransitionManager();
|
1118 |
|
1119 | function setState(nextState) {
|
1120 | Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" ])(history, nextState);
|
1121 |
|
1122 | history.length = globalHistory.length;
|
1123 | transitionManager.notifyListeners(history.location, history.action);
|
1124 | }
|
1125 |
|
1126 | var forceNextPop = false;
|
1127 | var ignorePath = null;
|
1128 |
|
1129 | function handleHashChange() {
|
1130 | var path = getHashPath();
|
1131 | var encodedPath = encodePath(path);
|
1132 |
|
1133 | if (path !== encodedPath) {
|
1134 |
|
1135 | replaceHashPath(encodedPath);
|
1136 | } else {
|
1137 | var location = getDOMLocation();
|
1138 | var prevLocation = history.location;
|
1139 | if (!forceNextPop && locationsAreEqual(prevLocation, location)) return;
|
1140 |
|
1141 | if (ignorePath === createPath(location)) return;
|
1142 |
|
1143 | ignorePath = null;
|
1144 | handlePop(location);
|
1145 | }
|
1146 | }
|
1147 |
|
1148 | function handlePop(location) {
|
1149 | if (forceNextPop) {
|
1150 | forceNextPop = false;
|
1151 | setState();
|
1152 | } else {
|
1153 | var action = 'POP';
|
1154 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1155 | if (ok) {
|
1156 | setState({
|
1157 | action: action,
|
1158 | location: location
|
1159 | });
|
1160 | } else {
|
1161 | revertPop(location);
|
1162 | }
|
1163 | });
|
1164 | }
|
1165 | }
|
1166 |
|
1167 | function revertPop(fromLocation) {
|
1168 | var toLocation = history.location;
|
1169 |
|
1170 |
|
1171 |
|
1172 | var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
1173 | if (toIndex === -1) toIndex = 0;
|
1174 | var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
1175 | if (fromIndex === -1) fromIndex = 0;
|
1176 | var delta = toIndex - fromIndex;
|
1177 |
|
1178 | if (delta) {
|
1179 | forceNextPop = true;
|
1180 | go(delta);
|
1181 | }
|
1182 | }
|
1183 |
|
1184 |
|
1185 | var path = getHashPath();
|
1186 | var encodedPath = encodePath(path);
|
1187 | if (path !== encodedPath) replaceHashPath(encodedPath);
|
1188 | var initialLocation = getDOMLocation();
|
1189 | var allPaths = [createPath(initialLocation)];
|
1190 |
|
1191 | function createHref(location) {
|
1192 | return '#' + encodePath(basename + createPath(location));
|
1193 | }
|
1194 |
|
1195 | function push(path, state) {
|
1196 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
|
1197 | var action = 'PUSH';
|
1198 | var location = createLocation(path, undefined, undefined, history.location);
|
1199 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1200 | if (!ok) return;
|
1201 | var path = createPath(location);
|
1202 | var encodedPath = encodePath(basename + path);
|
1203 | var hashChanged = getHashPath() !== encodedPath;
|
1204 |
|
1205 | if (hashChanged) {
|
1206 |
|
1207 |
|
1208 |
|
1209 | ignorePath = path;
|
1210 | pushHashPath(encodedPath);
|
1211 | var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
1212 | var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
|
1213 | nextPaths.push(path);
|
1214 | allPaths = nextPaths;
|
1215 | setState({
|
1216 | action: action,
|
1217 | location: location
|
1218 | });
|
1219 | } else {
|
1220 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;
|
1221 | setState();
|
1222 | }
|
1223 | });
|
1224 | }
|
1225 |
|
1226 | function replace(path, state) {
|
1227 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
|
1228 | var action = 'REPLACE';
|
1229 | var location = createLocation(path, undefined, undefined, history.location);
|
1230 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1231 | if (!ok) return;
|
1232 | var path = createPath(location);
|
1233 | var encodedPath = encodePath(basename + path);
|
1234 | var hashChanged = getHashPath() !== encodedPath;
|
1235 |
|
1236 | if (hashChanged) {
|
1237 |
|
1238 |
|
1239 |
|
1240 | ignorePath = path;
|
1241 | replaceHashPath(encodedPath);
|
1242 | }
|
1243 |
|
1244 | var prevIndex = allPaths.indexOf(createPath(history.location));
|
1245 | if (prevIndex !== -1) allPaths[prevIndex] = path;
|
1246 | setState({
|
1247 | action: action,
|
1248 | location: location
|
1249 | });
|
1250 | });
|
1251 | }
|
1252 |
|
1253 | function go(n) {
|
1254 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
|
1255 | globalHistory.go(n);
|
1256 | }
|
1257 |
|
1258 | function goBack() {
|
1259 | go(-1);
|
1260 | }
|
1261 |
|
1262 | function goForward() {
|
1263 | go(1);
|
1264 | }
|
1265 |
|
1266 | var listenerCount = 0;
|
1267 |
|
1268 | function checkDOMListeners(delta) {
|
1269 | listenerCount += delta;
|
1270 |
|
1271 | if (listenerCount === 1 && delta === 1) {
|
1272 | window.addEventListener(HashChangeEvent$1, handleHashChange);
|
1273 | } else if (listenerCount === 0) {
|
1274 | window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
1275 | }
|
1276 | }
|
1277 |
|
1278 | var isBlocked = false;
|
1279 |
|
1280 | function block(prompt) {
|
1281 | if (prompt === void 0) {
|
1282 | prompt = false;
|
1283 | }
|
1284 |
|
1285 | var unblock = transitionManager.setPrompt(prompt);
|
1286 |
|
1287 | if (!isBlocked) {
|
1288 | checkDOMListeners(1);
|
1289 | isBlocked = true;
|
1290 | }
|
1291 |
|
1292 | return function () {
|
1293 | if (isBlocked) {
|
1294 | isBlocked = false;
|
1295 | checkDOMListeners(-1);
|
1296 | }
|
1297 |
|
1298 | return unblock();
|
1299 | };
|
1300 | }
|
1301 |
|
1302 | function listen(listener) {
|
1303 | var unlisten = transitionManager.appendListener(listener);
|
1304 | checkDOMListeners(1);
|
1305 | return function () {
|
1306 | checkDOMListeners(-1);
|
1307 | unlisten();
|
1308 | };
|
1309 | }
|
1310 |
|
1311 | var history = {
|
1312 | length: globalHistory.length,
|
1313 | action: 'POP',
|
1314 | location: initialLocation,
|
1315 | createHref: createHref,
|
1316 | push: push,
|
1317 | replace: replace,
|
1318 | go: go,
|
1319 | goBack: goBack,
|
1320 | goForward: goForward,
|
1321 | block: block,
|
1322 | listen: listen
|
1323 | };
|
1324 | return history;
|
1325 | }
|
1326 |
|
1327 | function clamp(n, lowerBound, upperBound) {
|
1328 | return Math.min(Math.max(n, lowerBound), upperBound);
|
1329 | }
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 | function createMemoryHistory(props) {
|
1336 | if (props === void 0) {
|
1337 | props = {};
|
1338 | }
|
1339 |
|
1340 | var _props = props,
|
1341 | getUserConfirmation = _props.getUserConfirmation,
|
1342 | _props$initialEntries = _props.initialEntries,
|
1343 | initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
|
1344 | _props$initialIndex = _props.initialIndex,
|
1345 | initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
1346 | _props$keyLength = _props.keyLength,
|
1347 | keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
1348 | var transitionManager = createTransitionManager();
|
1349 |
|
1350 | function setState(nextState) {
|
1351 | Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" ])(history, nextState);
|
1352 |
|
1353 | history.length = history.entries.length;
|
1354 | transitionManager.notifyListeners(history.location, history.action);
|
1355 | }
|
1356 |
|
1357 | function createKey() {
|
1358 | return Math.random().toString(36).substr(2, keyLength);
|
1359 | }
|
1360 |
|
1361 | var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
1362 | var entries = initialEntries.map(function (entry) {
|
1363 | return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
|
1364 | });
|
1365 |
|
1366 | var createHref = createPath;
|
1367 |
|
1368 | function push(path, state) {
|
1369 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
1370 | var action = 'PUSH';
|
1371 | var location = createLocation(path, state, createKey(), history.location);
|
1372 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1373 | if (!ok) return;
|
1374 | var prevIndex = history.index;
|
1375 | var nextIndex = prevIndex + 1;
|
1376 | var nextEntries = history.entries.slice(0);
|
1377 |
|
1378 | if (nextEntries.length > nextIndex) {
|
1379 | nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
1380 | } else {
|
1381 | nextEntries.push(location);
|
1382 | }
|
1383 |
|
1384 | setState({
|
1385 | action: action,
|
1386 | location: location,
|
1387 | index: nextIndex,
|
1388 | entries: nextEntries
|
1389 | });
|
1390 | });
|
1391 | }
|
1392 |
|
1393 | function replace(path, state) {
|
1394 | process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" ])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
|
1395 | var action = 'REPLACE';
|
1396 | var location = createLocation(path, state, createKey(), history.location);
|
1397 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1398 | if (!ok) return;
|
1399 | history.entries[history.index] = location;
|
1400 | setState({
|
1401 | action: action,
|
1402 | location: location
|
1403 | });
|
1404 | });
|
1405 | }
|
1406 |
|
1407 | function go(n) {
|
1408 | var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
|
1409 | var action = 'POP';
|
1410 | var location = history.entries[nextIndex];
|
1411 | transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1412 | if (ok) {
|
1413 | setState({
|
1414 | action: action,
|
1415 | location: location,
|
1416 | index: nextIndex
|
1417 | });
|
1418 | } else {
|
1419 |
|
1420 |
|
1421 | setState();
|
1422 | }
|
1423 | });
|
1424 | }
|
1425 |
|
1426 | function goBack() {
|
1427 | go(-1);
|
1428 | }
|
1429 |
|
1430 | function goForward() {
|
1431 | go(1);
|
1432 | }
|
1433 |
|
1434 | function canGo(n) {
|
1435 | var nextIndex = history.index + n;
|
1436 | return nextIndex >= 0 && nextIndex < history.entries.length;
|
1437 | }
|
1438 |
|
1439 | function block(prompt) {
|
1440 | if (prompt === void 0) {
|
1441 | prompt = false;
|
1442 | }
|
1443 |
|
1444 | return transitionManager.setPrompt(prompt);
|
1445 | }
|
1446 |
|
1447 | function listen(listener) {
|
1448 | return transitionManager.appendListener(listener);
|
1449 | }
|
1450 |
|
1451 | var history = {
|
1452 | length: entries.length,
|
1453 | action: 'POP',
|
1454 | location: entries[index],
|
1455 | index: index,
|
1456 | entries: entries,
|
1457 | createHref: createHref,
|
1458 | push: push,
|
1459 | replace: replace,
|
1460 | go: go,
|
1461 | goBack: goBack,
|
1462 | goForward: goForward,
|
1463 | canGo: canGo,
|
1464 | block: block,
|
1465 | listen: listen
|
1466 | };
|
1467 | return history;
|
1468 | }
|
1469 |
|
1470 |
|
1471 |
|
1472 | }.call(__webpack_exports__, __webpack_require__(0)))
|
1473 |
|
1474 | }),
|
1475 |
|
1476 | (function(module, __webpack_exports__, __webpack_require__) {
|
1477 |
|
1478 | "use strict";
|
1479 | var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(3);
|
1480 | var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
1481 | var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4);
|
1482 | var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
1483 | var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
1484 | var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
1485 | var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
1486 | var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
1487 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
1488 |
|
1489 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1490 |
|
1491 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1492 |
|
1493 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
1494 |
|
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 | var Router = function (_React$Component) {
|
1505 | _inherits(Router, _React$Component);
|
1506 |
|
1507 | function Router() {
|
1508 | var _temp, _this, _ret;
|
1509 |
|
1510 | _classCallCheck(this, Router);
|
1511 |
|
1512 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
1513 | args[_key] = arguments[_key];
|
1514 | }
|
1515 |
|
1516 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
1517 | match: _this.computeMatch(_this.props.history.location.pathname)
|
1518 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
1519 | }
|
1520 |
|
1521 | Router.prototype.getChildContext = function getChildContext() {
|
1522 | return {
|
1523 | router: _extends({}, this.context.router, {
|
1524 | history: this.props.history,
|
1525 | route: {
|
1526 | location: this.props.history.location,
|
1527 | match: this.state.match
|
1528 | }
|
1529 | })
|
1530 | };
|
1531 | };
|
1532 |
|
1533 | Router.prototype.computeMatch = function computeMatch(pathname) {
|
1534 | return {
|
1535 | path: "/",
|
1536 | url: "/",
|
1537 | params: {},
|
1538 | isExact: pathname === "/"
|
1539 | };
|
1540 | };
|
1541 |
|
1542 | Router.prototype.componentWillMount = function componentWillMount() {
|
1543 | var _this2 = this;
|
1544 |
|
1545 | var _props = this.props,
|
1546 | children = _props.children,
|
1547 | history = _props.history;
|
1548 |
|
1549 |
|
1550 | __WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, "A <Router> may have only one child element");
|
1551 |
|
1552 |
|
1553 |
|
1554 |
|
1555 | this.unlisten = history.listen(function () {
|
1556 | _this2.setState({
|
1557 | match: _this2.computeMatch(history.location.pathname)
|
1558 | });
|
1559 | });
|
1560 | };
|
1561 |
|
1562 | Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
1563 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, "You cannot change <Router history>");
|
1564 | };
|
1565 |
|
1566 | Router.prototype.componentWillUnmount = function componentWillUnmount() {
|
1567 | this.unlisten();
|
1568 | };
|
1569 |
|
1570 | Router.prototype.render = function render() {
|
1571 | var children = this.props.children;
|
1572 |
|
1573 | return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null;
|
1574 | };
|
1575 |
|
1576 | return Router;
|
1577 | }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
1578 |
|
1579 | Router.propTypes = {
|
1580 | history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
1581 | children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
|
1582 | };
|
1583 | Router.contextTypes = {
|
1584 | router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
1585 | };
|
1586 | Router.childContextTypes = {
|
1587 | router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
1588 | };
|
1589 |
|
1590 |
|
1591 | __webpack_exports__["a"] = (Router);
|
1592 |
|
1593 | }),
|
1594 |
|
1595 | (function(module, __webpack_exports__, __webpack_require__) {
|
1596 |
|
1597 | "use strict";
|
1598 | var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(13);
|
1599 | var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
|
1600 |
|
1601 |
|
1602 | var patternCache = {};
|
1603 | var cacheLimit = 10000;
|
1604 | var cacheCount = 0;
|
1605 |
|
1606 | var compilePath = function compilePath(pattern, options) {
|
1607 | var cacheKey = "" + options.end + options.strict + options.sensitive;
|
1608 | var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
1609 |
|
1610 | if (cache[pattern]) return cache[pattern];
|
1611 |
|
1612 | var keys = [];
|
1613 | var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options);
|
1614 | var compiledPattern = { re: re, keys: keys };
|
1615 |
|
1616 | if (cacheCount < cacheLimit) {
|
1617 | cache[pattern] = compiledPattern;
|
1618 | cacheCount++;
|
1619 | }
|
1620 |
|
1621 | return compiledPattern;
|
1622 | };
|
1623 |
|
1624 |
|
1625 |
|
1626 |
|
1627 | var matchPath = function matchPath(pathname) {
|
1628 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1629 | var parent = arguments[2];
|
1630 |
|
1631 | if (typeof options === "string") options = { path: options };
|
1632 |
|
1633 | var _options = options,
|
1634 | path = _options.path,
|
1635 | _options$exact = _options.exact,
|
1636 | exact = _options$exact === undefined ? false : _options$exact,
|
1637 | _options$strict = _options.strict,
|
1638 | strict = _options$strict === undefined ? false : _options$strict,
|
1639 | _options$sensitive = _options.sensitive,
|
1640 | sensitive = _options$sensitive === undefined ? false : _options$sensitive;
|
1641 |
|
1642 |
|
1643 | if (path == null) return parent;
|
1644 |
|
1645 | var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
|
1646 | re = _compilePath.re,
|
1647 | keys = _compilePath.keys;
|
1648 |
|
1649 | var match = re.exec(pathname);
|
1650 |
|
1651 | if (!match) return null;
|
1652 |
|
1653 | var url = match[0],
|
1654 | values = match.slice(1);
|
1655 |
|
1656 | var isExact = pathname === url;
|
1657 |
|
1658 | if (exact && !isExact) return null;
|
1659 |
|
1660 | return {
|
1661 | path: path,
|
1662 | url: path === "/" && url === "" ? "/" : url,
|
1663 | isExact: isExact,
|
1664 | params: keys.reduce(function (memo, key, index) {
|
1665 | memo[key.name] = values[index];
|
1666 | return memo;
|
1667 | }, {})
|
1668 | };
|
1669 | };
|
1670 |
|
1671 | __webpack_exports__["a"] = (matchPath);
|
1672 |
|
1673 | }),
|
1674 |
|
1675 | (function(module, exports, __webpack_require__) {
|
1676 |
|
1677 | "use strict";
|
1678 | (function(process) { |
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 | var printWarning = function() {};
|
1688 |
|
1689 | if (process.env.NODE_ENV !== 'production') {
|
1690 | var ReactPropTypesSecret = __webpack_require__(6);
|
1691 | var loggedTypeFailures = {};
|
1692 | var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
1693 |
|
1694 | printWarning = function(text) {
|
1695 | var message = 'Warning: ' + text;
|
1696 | if (typeof console !== 'undefined') {
|
1697 | console.error(message);
|
1698 | }
|
1699 | try {
|
1700 |
|
1701 |
|
1702 |
|
1703 | throw new Error(message);
|
1704 | } catch (x) {}
|
1705 | };
|
1706 | }
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
1720 | if (process.env.NODE_ENV !== 'production') {
|
1721 | for (var typeSpecName in typeSpecs) {
|
1722 | if (has(typeSpecs, typeSpecName)) {
|
1723 | var error;
|
1724 |
|
1725 |
|
1726 |
|
1727 | try {
|
1728 |
|
1729 |
|
1730 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
1731 | var err = Error(
|
1732 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
1733 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
1734 | );
|
1735 | err.name = 'Invariant Violation';
|
1736 | throw err;
|
1737 | }
|
1738 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
1739 | } catch (ex) {
|
1740 | error = ex;
|
1741 | }
|
1742 | if (error && !(error instanceof Error)) {
|
1743 | printWarning(
|
1744 | (componentName || 'React class') + ': type specification of ' +
|
1745 | location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
1746 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
1747 | 'You may have forgotten to pass an argument to the type checker ' +
|
1748 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
1749 | 'shape all require an argument).'
|
1750 | );
|
1751 | }
|
1752 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
1753 |
|
1754 |
|
1755 | loggedTypeFailures[error.message] = true;
|
1756 |
|
1757 | var stack = getStack ? getStack() : '';
|
1758 |
|
1759 | printWarning(
|
1760 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
1761 | );
|
1762 | }
|
1763 | }
|
1764 | }
|
1765 | }
|
1766 | }
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 | checkPropTypes.resetWarningCache = function() {
|
1774 | if (process.env.NODE_ENV !== 'production') {
|
1775 | loggedTypeFailures = {};
|
1776 | }
|
1777 | }
|
1778 |
|
1779 | module.exports = checkPropTypes;
|
1780 |
|
1781 | }.call(exports, __webpack_require__(0)))
|
1782 |
|
1783 | }),
|
1784 |
|
1785 | (function(module, exports, __webpack_require__) {
|
1786 |
|
1787 | "use strict";
|
1788 | (function(process) {
|
1789 |
|
1790 | if (process.env.NODE_ENV === 'production') {
|
1791 | module.exports = __webpack_require__(21);
|
1792 | } else {
|
1793 | module.exports = __webpack_require__(22);
|
1794 | }
|
1795 |
|
1796 | }.call(exports, __webpack_require__(0)))
|
1797 |
|
1798 | }),
|
1799 |
|
1800 | (function(module, __webpack_exports__, __webpack_require__) {
|
1801 |
|
1802 | "use strict";
|
1803 | var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(13);
|
1804 | var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
|
1805 |
|
1806 |
|
1807 | var patternCache = {};
|
1808 | var cacheLimit = 10000;
|
1809 | var cacheCount = 0;
|
1810 |
|
1811 | var compileGenerator = function compileGenerator(pattern) {
|
1812 | var cacheKey = pattern;
|
1813 | var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
|
1814 |
|
1815 | if (cache[pattern]) return cache[pattern];
|
1816 |
|
1817 | var compiledGenerator = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a.compile(pattern);
|
1818 |
|
1819 | if (cacheCount < cacheLimit) {
|
1820 | cache[pattern] = compiledGenerator;
|
1821 | cacheCount++;
|
1822 | }
|
1823 |
|
1824 | return compiledGenerator;
|
1825 | };
|
1826 |
|
1827 |
|
1828 |
|
1829 |
|
1830 | var generatePath = function generatePath() {
|
1831 | var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
|
1832 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1833 |
|
1834 | if (pattern === "/") {
|
1835 | return pattern;
|
1836 | }
|
1837 | var generator = compileGenerator(pattern);
|
1838 | return generator(params, { pretty: true });
|
1839 | };
|
1840 |
|
1841 | __webpack_exports__["a"] = (generatePath);
|
1842 |
|
1843 | }),
|
1844 |
|
1845 | (function(module, exports, __webpack_require__) {
|
1846 |
|
1847 | var isarray = __webpack_require__(32)
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 | module.exports = pathToRegexp
|
1853 | module.exports.parse = parse
|
1854 | module.exports.compile = compile
|
1855 | module.exports.tokensToFunction = tokensToFunction
|
1856 | module.exports.tokensToRegExp = tokensToRegExp
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 | var PATH_REGEXP = new RegExp([
|
1864 |
|
1865 |
|
1866 | '(\\\\.)',
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 | '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
1874 | ].join('|'), 'g')
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 | function parse (str, options) {
|
1884 | var tokens = []
|
1885 | var key = 0
|
1886 | var index = 0
|
1887 | var path = ''
|
1888 | var defaultDelimiter = options && options.delimiter || '/'
|
1889 | var res
|
1890 |
|
1891 | while ((res = PATH_REGEXP.exec(str)) != null) {
|
1892 | var m = res[0]
|
1893 | var escaped = res[1]
|
1894 | var offset = res.index
|
1895 | path += str.slice(index, offset)
|
1896 | index = offset + m.length
|
1897 |
|
1898 |
|
1899 | if (escaped) {
|
1900 | path += escaped[1]
|
1901 | continue
|
1902 | }
|
1903 |
|
1904 | var next = str[index]
|
1905 | var prefix = res[2]
|
1906 | var name = res[3]
|
1907 | var capture = res[4]
|
1908 | var group = res[5]
|
1909 | var modifier = res[6]
|
1910 | var asterisk = res[7]
|
1911 |
|
1912 |
|
1913 | if (path) {
|
1914 | tokens.push(path)
|
1915 | path = ''
|
1916 | }
|
1917 |
|
1918 | var partial = prefix != null && next != null && next !== prefix
|
1919 | var repeat = modifier === '+' || modifier === '*'
|
1920 | var optional = modifier === '?' || modifier === '*'
|
1921 | var delimiter = res[2] || defaultDelimiter
|
1922 | var pattern = capture || group
|
1923 |
|
1924 | tokens.push({
|
1925 | name: name || key++,
|
1926 | prefix: prefix || '',
|
1927 | delimiter: delimiter,
|
1928 | optional: optional,
|
1929 | repeat: repeat,
|
1930 | partial: partial,
|
1931 | asterisk: !!asterisk,
|
1932 | pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
1933 | })
|
1934 | }
|
1935 |
|
1936 |
|
1937 | if (index < str.length) {
|
1938 | path += str.substr(index)
|
1939 | }
|
1940 |
|
1941 |
|
1942 | if (path) {
|
1943 | tokens.push(path)
|
1944 | }
|
1945 |
|
1946 | return tokens
|
1947 | }
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 | function compile (str, options) {
|
1957 | return tokensToFunction(parse(str, options))
|
1958 | }
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 | function encodeURIComponentPretty (str) {
|
1967 | return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
1968 | return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
1969 | })
|
1970 | }
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 | function encodeAsterisk (str) {
|
1979 | return encodeURI(str).replace(/[?#]/g, function (c) {
|
1980 | return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
1981 | })
|
1982 | }
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 | function tokensToFunction (tokens) {
|
1988 |
|
1989 | var matches = new Array(tokens.length)
|
1990 |
|
1991 |
|
1992 | for (var i = 0; i < tokens.length; i++) {
|
1993 | if (typeof tokens[i] === 'object') {
|
1994 | matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
|
1995 | }
|
1996 | }
|
1997 |
|
1998 | return function (obj, opts) {
|
1999 | var path = ''
|
2000 | var data = obj || {}
|
2001 | var options = opts || {}
|
2002 | var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
2003 |
|
2004 | for (var i = 0; i < tokens.length; i++) {
|
2005 | var token = tokens[i]
|
2006 |
|
2007 | if (typeof token === 'string') {
|
2008 | path += token
|
2009 |
|
2010 | continue
|
2011 | }
|
2012 |
|
2013 | var value = data[token.name]
|
2014 | var segment
|
2015 |
|
2016 | if (value == null) {
|
2017 | if (token.optional) {
|
2018 |
|
2019 | if (token.partial) {
|
2020 | path += token.prefix
|
2021 | }
|
2022 |
|
2023 | continue
|
2024 | } else {
|
2025 | throw new TypeError('Expected "' + token.name + '" to be defined')
|
2026 | }
|
2027 | }
|
2028 |
|
2029 | if (isarray(value)) {
|
2030 | if (!token.repeat) {
|
2031 | throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
2032 | }
|
2033 |
|
2034 | if (value.length === 0) {
|
2035 | if (token.optional) {
|
2036 | continue
|
2037 | } else {
|
2038 | throw new TypeError('Expected "' + token.name + '" to not be empty')
|
2039 | }
|
2040 | }
|
2041 |
|
2042 | for (var j = 0; j < value.length; j++) {
|
2043 | segment = encode(value[j])
|
2044 |
|
2045 | if (!matches[i].test(segment)) {
|
2046 | throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
|
2047 | }
|
2048 |
|
2049 | path += (j === 0 ? token.prefix : token.delimiter) + segment
|
2050 | }
|
2051 |
|
2052 | continue
|
2053 | }
|
2054 |
|
2055 | segment = token.asterisk ? encodeAsterisk(value) : encode(value)
|
2056 |
|
2057 | if (!matches[i].test(segment)) {
|
2058 | throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
2059 | }
|
2060 |
|
2061 | path += token.prefix + segment
|
2062 | }
|
2063 |
|
2064 | return path
|
2065 | }
|
2066 | }
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 | function escapeString (str) {
|
2075 | return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
2076 | }
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 |
|
2084 | function escapeGroup (group) {
|
2085 | return group.replace(/([=!:$\/()])/g, '\\$1')
|
2086 | }
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 |
|
2094 |
|
2095 | function attachKeys (re, keys) {
|
2096 | re.keys = keys
|
2097 | return re
|
2098 | }
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 | function flags (options) {
|
2107 | return options.sensitive ? '' : 'i'
|
2108 | }
|
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 | function regexpToRegexp (path, keys) {
|
2118 |
|
2119 | var groups = path.source.match(/\((?!\?)/g)
|
2120 |
|
2121 | if (groups) {
|
2122 | for (var i = 0; i < groups.length; i++) {
|
2123 | keys.push({
|
2124 | name: i,
|
2125 | prefix: null,
|
2126 | delimiter: null,
|
2127 | optional: false,
|
2128 | repeat: false,
|
2129 | partial: false,
|
2130 | asterisk: false,
|
2131 | pattern: null
|
2132 | })
|
2133 | }
|
2134 | }
|
2135 |
|
2136 | return attachKeys(path, keys)
|
2137 | }
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 | function arrayToRegexp (path, keys, options) {
|
2148 | var parts = []
|
2149 |
|
2150 | for (var i = 0; i < path.length; i++) {
|
2151 | parts.push(pathToRegexp(path[i], keys, options).source)
|
2152 | }
|
2153 |
|
2154 | var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
|
2155 |
|
2156 | return attachKeys(regexp, keys)
|
2157 | }
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 | function stringToRegexp (path, keys, options) {
|
2168 | return tokensToRegExp(parse(path, options), keys, options)
|
2169 | }
|
2170 |
|
2171 |
|
2172 |
|
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 | function tokensToRegExp (tokens, keys, options) {
|
2180 | if (!isarray(keys)) {
|
2181 | options = (keys || options)
|
2182 | keys = []
|
2183 | }
|
2184 |
|
2185 | options = options || {}
|
2186 |
|
2187 | var strict = options.strict
|
2188 | var end = options.end !== false
|
2189 | var route = ''
|
2190 |
|
2191 |
|
2192 | for (var i = 0; i < tokens.length; i++) {
|
2193 | var token = tokens[i]
|
2194 |
|
2195 | if (typeof token === 'string') {
|
2196 | route += escapeString(token)
|
2197 | } else {
|
2198 | var prefix = escapeString(token.prefix)
|
2199 | var capture = '(?:' + token.pattern + ')'
|
2200 |
|
2201 | keys.push(token)
|
2202 |
|
2203 | if (token.repeat) {
|
2204 | capture += '(?:' + prefix + capture + ')*'
|
2205 | }
|
2206 |
|
2207 | if (token.optional) {
|
2208 | if (!token.partial) {
|
2209 | capture = '(?:' + prefix + '(' + capture + '))?'
|
2210 | } else {
|
2211 | capture = prefix + '(' + capture + ')?'
|
2212 | }
|
2213 | } else {
|
2214 | capture = prefix + '(' + capture + ')'
|
2215 | }
|
2216 |
|
2217 | route += capture
|
2218 | }
|
2219 | }
|
2220 |
|
2221 | var delimiter = escapeString(options.delimiter || '/')
|
2222 | var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
|
2223 |
|
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 | if (!strict) {
|
2229 | route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
2230 | }
|
2231 |
|
2232 | if (end) {
|
2233 | route += '$'
|
2234 | } else {
|
2235 |
|
2236 |
|
2237 | route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
2238 | }
|
2239 |
|
2240 | return attachKeys(new RegExp('^' + route, flags(options)), keys)
|
2241 | }
|
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 |
|
2249 |
|
2250 |
|
2251 |
|
2252 |
|
2253 |
|
2254 |
|
2255 | function pathToRegexp (path, keys, options) {
|
2256 | if (!isarray(keys)) {
|
2257 | options = (keys || options)
|
2258 | keys = []
|
2259 | }
|
2260 |
|
2261 | options = options || {}
|
2262 |
|
2263 | if (path instanceof RegExp) {
|
2264 | return regexpToRegexp(path, (keys))
|
2265 | }
|
2266 |
|
2267 | if (isarray(path)) {
|
2268 | return arrayToRegexp( (path), (keys), options)
|
2269 | }
|
2270 |
|
2271 | return stringToRegexp( (path), (keys), options)
|
2272 | }
|
2273 |
|
2274 |
|
2275 | }),
|
2276 |
|
2277 | (function(module, __webpack_exports__, __webpack_require__) {
|
2278 |
|
2279 | "use strict";
|
2280 | var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(3);
|
2281 | var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
2282 | var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4);
|
2283 | var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
2284 | var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
2285 | var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
2286 | var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
2287 | var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
2288 | var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(9);
|
2289 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
2290 |
|
2291 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2292 |
|
2293 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
2294 |
|
2295 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
2296 |
|
2297 |
|
2298 |
|
2299 |
|
2300 |
|
2301 |
|
2302 |
|
2303 | var isEmptyChildren = function isEmptyChildren(children) {
|
2304 | return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0;
|
2305 | };
|
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 | var Route = function (_React$Component) {
|
2312 | _inherits(Route, _React$Component);
|
2313 |
|
2314 | function Route() {
|
2315 | var _temp, _this, _ret;
|
2316 |
|
2317 | _classCallCheck(this, Route);
|
2318 |
|
2319 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
2320 | args[_key] = arguments[_key];
|
2321 | }
|
2322 |
|
2323 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
|
2324 | match: _this.computeMatch(_this.props, _this.context.router)
|
2325 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
2326 | }
|
2327 |
|
2328 | Route.prototype.getChildContext = function getChildContext() {
|
2329 | return {
|
2330 | router: _extends({}, this.context.router, {
|
2331 | route: {
|
2332 | location: this.props.location || this.context.router.route.location,
|
2333 | match: this.state.match
|
2334 | }
|
2335 | })
|
2336 | };
|
2337 | };
|
2338 |
|
2339 | Route.prototype.computeMatch = function computeMatch(_ref, router) {
|
2340 | var computedMatch = _ref.computedMatch,
|
2341 | location = _ref.location,
|
2342 | path = _ref.path,
|
2343 | strict = _ref.strict,
|
2344 | exact = _ref.exact,
|
2345 | sensitive = _ref.sensitive;
|
2346 |
|
2347 | if (computedMatch) return computedMatch;
|
2348 |
|
2349 | __WEBPACK_IMPORTED_MODULE_1_invariant___default()(router, "You should not use <Route> or withRouter() outside a <Router>");
|
2350 |
|
2351 | var route = router.route;
|
2352 |
|
2353 | var pathname = (location || route.location).pathname;
|
2354 |
|
2355 | return Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" ])(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
|
2356 | };
|
2357 |
|
2358 | Route.prototype.componentWillMount = function componentWillMount() {
|
2359 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
|
2360 |
|
2361 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
|
2362 |
|
2363 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
|
2364 | };
|
2365 |
|
2366 | Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
|
2367 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
|
2368 |
|
2369 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
|
2370 |
|
2371 | this.setState({
|
2372 | match: this.computeMatch(nextProps, nextContext.router)
|
2373 | });
|
2374 | };
|
2375 |
|
2376 | Route.prototype.render = function render() {
|
2377 | var match = this.state.match;
|
2378 | var _props = this.props,
|
2379 | children = _props.children,
|
2380 | component = _props.component,
|
2381 | render = _props.render;
|
2382 | var _context$router = this.context.router,
|
2383 | history = _context$router.history,
|
2384 | route = _context$router.route,
|
2385 | staticContext = _context$router.staticContext;
|
2386 |
|
2387 | var location = this.props.location || route.location;
|
2388 | var props = { match: match, location: location, history: history, staticContext: staticContext };
|
2389 |
|
2390 | if (component) return match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : null;
|
2391 |
|
2392 | if (render) return match ? render(props) : null;
|
2393 |
|
2394 | if (typeof children === "function") return children(props);
|
2395 |
|
2396 | if (children && !isEmptyChildren(children)) return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children);
|
2397 |
|
2398 | return null;
|
2399 | };
|
2400 |
|
2401 | return Route;
|
2402 | }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
2403 |
|
2404 | Route.propTypes = {
|
2405 | computedMatch: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
|
2406 | path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
|
2407 | exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
2408 | strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
2409 | sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
|
2410 | component: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
|
2411 | render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
|
2412 | children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),
|
2413 | location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
2414 | };
|
2415 | Route.contextTypes = {
|
2416 | router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({
|
2417 | history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
2418 | route: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
2419 | staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
|
2420 | })
|
2421 | };
|
2422 | Route.childContextTypes = {
|
2423 | router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
2424 | };
|
2425 |
|
2426 |
|
2427 | __webpack_exports__["a"] = (Route);
|
2428 |
|
2429 | }),
|
2430 |
|
2431 | (function(module, exports, __webpack_require__) {
|
2432 |
|
2433 | "use strict";
|
2434 |
|
2435 |
|
2436 | Object.defineProperty(exports, "__esModule", {
|
2437 | value: true
|
2438 | });
|
2439 |
|
2440 | var _RouteHook = __webpack_require__(16);
|
2441 |
|
2442 | var _RouteHook2 = _interopRequireDefault(_RouteHook);
|
2443 |
|
2444 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2445 |
|
2446 | exports.default = _RouteHook2.default;
|
2447 |
|
2448 | }),
|
2449 |
|
2450 | (function(module, exports, __webpack_require__) {
|
2451 |
|
2452 | "use strict";
|
2453 |
|
2454 |
|
2455 | Object.defineProperty(exports, "__esModule", {
|
2456 | value: true
|
2457 | });
|
2458 |
|
2459 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
2460 |
|
2461 | var _react = __webpack_require__(1);
|
2462 |
|
2463 | var _react2 = _interopRequireDefault(_react);
|
2464 |
|
2465 | var _reactRouter = __webpack_require__(19);
|
2466 |
|
2467 | var _propTypes = __webpack_require__(2);
|
2468 |
|
2469 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
2470 |
|
2471 | var _HigherComponent = __webpack_require__(37);
|
2472 |
|
2473 | var _HigherComponent2 = _interopRequireDefault(_HigherComponent);
|
2474 |
|
2475 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2476 |
|
2477 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
2478 |
|
2479 | var RouteHook = function RouteHook(_ref) {
|
2480 | var path = _ref.path,
|
2481 | exact = _ref.exact,
|
2482 | strict = _ref.strict,
|
2483 | rest = _objectWithoutProperties(_ref, ['path', 'exact', 'strict']);
|
2484 |
|
2485 | return _react2.default.createElement(_reactRouter.Route, {
|
2486 | path: path,
|
2487 | exact: exact,
|
2488 | strict: strict,
|
2489 | render: function render(routerProps) {
|
2490 | return _react2.default.createElement(_HigherComponent2.default, _extends({ routerProps: routerProps }, rest));
|
2491 | }
|
2492 | });
|
2493 | };
|
2494 |
|
2495 | RouteHook.propTypes = {
|
2496 | path: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired,
|
2497 | exact: _propTypes2.default.bool,
|
2498 | strict: _propTypes2.default.bool
|
2499 |
|
2500 | };
|
2501 |
|
2502 | RouteHook.defaultProps = {
|
2503 | exact: false,
|
2504 | strict: false
|
2505 | };
|
2506 |
|
2507 | exports.default = RouteHook;
|
2508 |
|
2509 | }),
|
2510 |
|
2511 | (function(module, exports, __webpack_require__) {
|
2512 |
|
2513 | "use strict";
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 | var k=__webpack_require__(5),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.concurrent_mode"):60111,y=n?Symbol.for("react.forward_ref"):60112,z=n?Symbol.for("react.suspense"):60113,aa=n?Symbol.for("react.memo"):
|
2524 | 60115,ba=n?Symbol.for("react.lazy"):60116,A="function"===typeof Symbol&&Symbol.iterator;function ca(a,b,d,c,e,g,h,f){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[d,c,e,g,h,f],m=0;a=Error(b.replace(/%s/g,function(){return l[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
|
2525 | function B(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);ca(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D={};
|
2526 | function E(a,b,d){this.props=a;this.context=b;this.refs=D;this.updater=d||C}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?B("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,d){this.props=a;this.context=b;this.refs=D;this.updater=d||C}var H=G.prototype=new F;
|
2527 | H.constructor=G;k(H,E.prototype);H.isPureReactComponent=!0;var I={current:null},J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};
|
2528 | function M(a,b,d){var c=void 0,e={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,c)&&!L.hasOwnProperty(c)&&(e[c]=b[c]);var f=arguments.length-2;if(1===f)e.children=d;else if(1<f){for(var l=Array(f),m=0;m<f;m++)l[m]=arguments[m+2];e.children=l}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===e[c]&&(e[c]=f[c]);return{$$typeof:p,type:a,key:g,ref:h,props:e,_owner:J.current}}
|
2529 | function da(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function N(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var O=/\/+/g,P=[];function Q(a,b,d,c){if(P.length){var e=P.pop();e.result=a;e.keyPrefix=b;e.func=d;e.context=c;e.count=0;return e}return{result:a,keyPrefix:b,func:d,context:c,count:0}}
|
2530 | function R(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>P.length&&P.push(a)}
|
2531 | function S(a,b,d,c){var e=typeof a;if("undefined"===e||"boolean"===e)a=null;var g=!1;if(null===a)g=!0;else switch(e){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case p:case q:g=!0}}if(g)return d(c,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){e=a[h];var f=b+T(e,h);g+=S(e,f,d,c)}else if(null===a||"object"!==typeof a?f=null:(f=A&&a[A]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),h=
|
2532 | 0;!(e=a.next()).done;)e=e.value,f=b+T(e,h++),g+=S(e,f,d,c);else"object"===e&&(d=""+a,B("31","[object Object]"===d?"object with keys {"+Object.keys(a).join(", ")+"}":d,""));return g}function U(a,b,d){return null==a?0:S(a,"",b,d)}function T(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ea(a,b){a.func.call(a.context,b,a.count++)}
|
2533 | function fa(a,b,d){var c=a.result,e=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?V(a,c,d,function(a){return a}):null!=a&&(N(a)&&(a=da(a,e+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+d)),c.push(a))}function V(a,b,d,c,e){var g="";null!=d&&(g=(""+d).replace(O,"$&/")+"/");b=Q(b,g,c,e);U(a,fa,b);R(b)}function W(){var a=I.current;null===a?B("321"):void 0;return a}
|
2534 | var X={Children:{map:function(a,b,d){if(null==a)return a;var c=[];V(a,c,null,b,d);return c},forEach:function(a,b,d){if(null==a)return a;b=Q(null,null,b,d);U(a,ea,b);R(b)},count:function(a){return U(a,function(){return null},null)},toArray:function(a){var b=[];V(a,b,null,function(a){return a});return b},only:function(a){N(a)?void 0:B("143");return a}},createRef:function(){return{current:null}},Component:E,PureComponent:G,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
|
2535 | _currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:y,render:a}},lazy:function(a){return{$$typeof:ba,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:aa,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return W().useCallback(a,b)},useContext:function(a,b){return W().useContext(a,b)},useEffect:function(a,b){return W().useEffect(a,b)},useImperativeHandle:function(a,
|
2536 | b,d){return W().useImperativeHandle(a,b,d)},useDebugValue:function(){},useLayoutEffect:function(a,b){return W().useLayoutEffect(a,b)},useMemo:function(a,b){return W().useMemo(a,b)},useReducer:function(a,b,d){return W().useReducer(a,b,d)},useRef:function(a){return W().useRef(a)},useState:function(a){return W().useState(a)},Fragment:r,StrictMode:t,Suspense:z,createElement:M,cloneElement:function(a,b,d){null===a||void 0===a?B("267",a):void 0;var c=void 0,e=k({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=
|
2537 | b){void 0!==b.ref&&(h=b.ref,f=J.current);void 0!==b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)K.call(b,c)&&!L.hasOwnProperty(c)&&(e[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)e.children=d;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];e.children=l}return{$$typeof:p,type:a.type,key:g,ref:h,props:e,_owner:f}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.8.6",
|
2538 | unstable_ConcurrentMode:x,unstable_Profiler:u,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:I,ReactCurrentOwner:J,assign:k}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
|
2539 |
|
2540 |
|
2541 | }),
|
2542 |
|
2543 | (function(module, exports, __webpack_require__) {
|
2544 |
|
2545 | "use strict";
|
2546 | (function(process) { |
2547 |
|
2548 |
|
2549 |
|
2550 |
|
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 | if (process.env.NODE_ENV !== "production") {
|
2560 | (function() {
|
2561 | 'use strict';
|
2562 |
|
2563 | var _assign = __webpack_require__(5);
|
2564 | var checkPropTypes = __webpack_require__(10);
|
2565 |
|
2566 |
|
2567 |
|
2568 | var ReactVersion = '16.8.6';
|
2569 |
|
2570 |
|
2571 |
|
2572 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
2573 |
|
2574 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
2575 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
2576 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
2577 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
2578 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
2579 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
2580 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
2581 |
|
2582 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
2583 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
2584 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
2585 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
2586 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
2587 |
|
2588 | var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
2589 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
2590 |
|
2591 | function getIteratorFn(maybeIterable) {
|
2592 | if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
2593 | return null;
|
2594 | }
|
2595 | var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
2596 | if (typeof maybeIterator === 'function') {
|
2597 | return maybeIterator;
|
2598 | }
|
2599 | return null;
|
2600 | }
|
2601 |
|
2602 |
|
2603 |
|
2604 |
|
2605 |
|
2606 |
|
2607 |
|
2608 |
|
2609 |
|
2610 |
|
2611 |
|
2612 |
|
2613 | var validateFormat = function () {};
|
2614 |
|
2615 | {
|
2616 | validateFormat = function (format) {
|
2617 | if (format === undefined) {
|
2618 | throw new Error('invariant requires an error message argument');
|
2619 | }
|
2620 | };
|
2621 | }
|
2622 |
|
2623 | function invariant(condition, format, a, b, c, d, e, f) {
|
2624 | validateFormat(format);
|
2625 |
|
2626 | if (!condition) {
|
2627 | var error = void 0;
|
2628 | if (format === undefined) {
|
2629 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
2630 | } else {
|
2631 | var args = [a, b, c, d, e, f];
|
2632 | var argIndex = 0;
|
2633 | error = new Error(format.replace(/%s/g, function () {
|
2634 | return args[argIndex++];
|
2635 | }));
|
2636 | error.name = 'Invariant Violation';
|
2637 | }
|
2638 |
|
2639 | error.framesToPop = 1;
|
2640 | throw error;
|
2641 | }
|
2642 | }
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 | var lowPriorityWarning = function () {};
|
2662 |
|
2663 | {
|
2664 | var printWarning = function (format) {
|
2665 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
2666 | args[_key - 1] = arguments[_key];
|
2667 | }
|
2668 |
|
2669 | var argIndex = 0;
|
2670 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
2671 | return args[argIndex++];
|
2672 | });
|
2673 | if (typeof console !== 'undefined') {
|
2674 | console.warn(message);
|
2675 | }
|
2676 | try {
|
2677 |
|
2678 |
|
2679 |
|
2680 | throw new Error(message);
|
2681 | } catch (x) {}
|
2682 | };
|
2683 |
|
2684 | lowPriorityWarning = function (condition, format) {
|
2685 | if (format === undefined) {
|
2686 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
2687 | }
|
2688 | if (!condition) {
|
2689 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
2690 | args[_key2 - 2] = arguments[_key2];
|
2691 | }
|
2692 |
|
2693 | printWarning.apply(undefined, [format].concat(args));
|
2694 | }
|
2695 | };
|
2696 | }
|
2697 |
|
2698 | var lowPriorityWarning$1 = lowPriorityWarning;
|
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 | var warningWithoutStack = function () {};
|
2708 |
|
2709 | {
|
2710 | warningWithoutStack = function (condition, format) {
|
2711 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
2712 | args[_key - 2] = arguments[_key];
|
2713 | }
|
2714 |
|
2715 | if (format === undefined) {
|
2716 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
2717 | }
|
2718 | if (args.length > 8) {
|
2719 |
|
2720 | throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
2721 | }
|
2722 | if (condition) {
|
2723 | return;
|
2724 | }
|
2725 | if (typeof console !== 'undefined') {
|
2726 | var argsWithFormat = args.map(function (item) {
|
2727 | return '' + item;
|
2728 | });
|
2729 | argsWithFormat.unshift('Warning: ' + format);
|
2730 |
|
2731 |
|
2732 |
|
2733 | Function.prototype.apply.call(console.error, console, argsWithFormat);
|
2734 | }
|
2735 | try {
|
2736 |
|
2737 |
|
2738 |
|
2739 | var argIndex = 0;
|
2740 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
2741 | return args[argIndex++];
|
2742 | });
|
2743 | throw new Error(message);
|
2744 | } catch (x) {}
|
2745 | };
|
2746 | }
|
2747 |
|
2748 | var warningWithoutStack$1 = warningWithoutStack;
|
2749 |
|
2750 | var didWarnStateUpdateForUnmountedComponent = {};
|
2751 |
|
2752 | function warnNoop(publicInstance, callerName) {
|
2753 | {
|
2754 | var _constructor = publicInstance.constructor;
|
2755 | var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
2756 | var warningKey = componentName + '.' + callerName;
|
2757 | if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
2758 | return;
|
2759 | }
|
2760 | 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);
|
2761 | didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
2762 | }
|
2763 | }
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 | var ReactNoopUpdateQueue = {
|
2769 | |
2770 |
|
2771 |
|
2772 |
|
2773 |
|
2774 |
|
2775 |
|
2776 | isMounted: function (publicInstance) {
|
2777 | return false;
|
2778 | },
|
2779 |
|
2780 | |
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 |
|
2786 |
|
2787 |
|
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 | enqueueForceUpdate: function (publicInstance, callback, callerName) {
|
2796 | warnNoop(publicInstance, 'forceUpdate');
|
2797 | },
|
2798 |
|
2799 | |
2800 |
|
2801 |
|
2802 |
|
2803 |
|
2804 |
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 | enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
|
2813 | warnNoop(publicInstance, 'replaceState');
|
2814 | },
|
2815 |
|
2816 | |
2817 |
|
2818 |
|
2819 |
|
2820 |
|
2821 |
|
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 |
|
2828 | enqueueSetState: function (publicInstance, partialState, callback, callerName) {
|
2829 | warnNoop(publicInstance, 'setState');
|
2830 | }
|
2831 | };
|
2832 |
|
2833 | var emptyObject = {};
|
2834 | {
|
2835 | Object.freeze(emptyObject);
|
2836 | }
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 | function Component(props, context, updater) {
|
2842 | this.props = props;
|
2843 | this.context = context;
|
2844 |
|
2845 | this.refs = emptyObject;
|
2846 |
|
2847 |
|
2848 | this.updater = updater || ReactNoopUpdateQueue;
|
2849 | }
|
2850 |
|
2851 | Component.prototype.isReactComponent = {};
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 |
|
2858 |
|
2859 |
|
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 |
|
2872 |
|
2873 |
|
2874 |
|
2875 |
|
2876 |
|
2877 |
|
2878 | Component.prototype.setState = function (partialState, callback) {
|
2879 | !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
|
2880 | this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
2881 | };
|
2882 |
|
2883 |
|
2884 |
|
2885 |
|
2886 |
|
2887 |
|
2888 |
|
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 | Component.prototype.forceUpdate = function (callback) {
|
2898 | this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
2899 | };
|
2900 |
|
2901 |
|
2902 |
|
2903 |
|
2904 |
|
2905 |
|
2906 | {
|
2907 | var deprecatedAPIs = {
|
2908 | isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
|
2909 | replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
|
2910 | };
|
2911 | var defineDeprecationWarning = function (methodName, info) {
|
2912 | Object.defineProperty(Component.prototype, methodName, {
|
2913 | get: function () {
|
2914 | lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
2915 | return undefined;
|
2916 | }
|
2917 | });
|
2918 | };
|
2919 | for (var fnName in deprecatedAPIs) {
|
2920 | if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
2921 | defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
2922 | }
|
2923 | }
|
2924 | }
|
2925 |
|
2926 | function ComponentDummy() {}
|
2927 | ComponentDummy.prototype = Component.prototype;
|
2928 |
|
2929 |
|
2930 |
|
2931 |
|
2932 | function PureComponent(props, context, updater) {
|
2933 | this.props = props;
|
2934 | this.context = context;
|
2935 |
|
2936 | this.refs = emptyObject;
|
2937 | this.updater = updater || ReactNoopUpdateQueue;
|
2938 | }
|
2939 |
|
2940 | var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
2941 | pureComponentPrototype.constructor = PureComponent;
|
2942 |
|
2943 | _assign(pureComponentPrototype, Component.prototype);
|
2944 | pureComponentPrototype.isPureReactComponent = true;
|
2945 |
|
2946 |
|
2947 | function createRef() {
|
2948 | var refObject = {
|
2949 | current: null
|
2950 | };
|
2951 | {
|
2952 | Object.seal(refObject);
|
2953 | }
|
2954 | return refObject;
|
2955 | }
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 | var ReactCurrentDispatcher = {
|
2961 | |
2962 |
|
2963 |
|
2964 |
|
2965 | current: null
|
2966 | };
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 |
|
2973 |
|
2974 | var ReactCurrentOwner = {
|
2975 | |
2976 |
|
2977 |
|
2978 |
|
2979 | current: null
|
2980 | };
|
2981 |
|
2982 | var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
|
2983 |
|
2984 | var describeComponentFrame = function (name, source, ownerName) {
|
2985 | var sourceInfo = '';
|
2986 | if (source) {
|
2987 | var path = source.fileName;
|
2988 | var fileName = path.replace(BEFORE_SLASH_RE, '');
|
2989 | {
|
2990 |
|
2991 |
|
2992 | if (/^index\./.test(fileName)) {
|
2993 | var match = path.match(BEFORE_SLASH_RE);
|
2994 | if (match) {
|
2995 | var pathBeforeSlash = match[1];
|
2996 | if (pathBeforeSlash) {
|
2997 | var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
|
2998 | fileName = folderName + '/' + fileName;
|
2999 | }
|
3000 | }
|
3001 | }
|
3002 | }
|
3003 | sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
|
3004 | } else if (ownerName) {
|
3005 | sourceInfo = ' (created by ' + ownerName + ')';
|
3006 | }
|
3007 | return '\n in ' + (name || 'Unknown') + sourceInfo;
|
3008 | };
|
3009 |
|
3010 | var Resolved = 1;
|
3011 |
|
3012 |
|
3013 | function refineResolvedLazyComponent(lazyComponent) {
|
3014 | return lazyComponent._status === Resolved ? lazyComponent._result : null;
|
3015 | }
|
3016 |
|
3017 | function getWrappedName(outerType, innerType, wrapperName) {
|
3018 | var functionName = innerType.displayName || innerType.name || '';
|
3019 | return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
|
3020 | }
|
3021 |
|
3022 | function getComponentName(type) {
|
3023 | if (type == null) {
|
3024 |
|
3025 | return null;
|
3026 | }
|
3027 | {
|
3028 | if (typeof type.tag === 'number') {
|
3029 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
3030 | }
|
3031 | }
|
3032 | if (typeof type === 'function') {
|
3033 | return type.displayName || type.name || null;
|
3034 | }
|
3035 | if (typeof type === 'string') {
|
3036 | return type;
|
3037 | }
|
3038 | switch (type) {
|
3039 | case REACT_CONCURRENT_MODE_TYPE:
|
3040 | return 'ConcurrentMode';
|
3041 | case REACT_FRAGMENT_TYPE:
|
3042 | return 'Fragment';
|
3043 | case REACT_PORTAL_TYPE:
|
3044 | return 'Portal';
|
3045 | case REACT_PROFILER_TYPE:
|
3046 | return 'Profiler';
|
3047 | case REACT_STRICT_MODE_TYPE:
|
3048 | return 'StrictMode';
|
3049 | case REACT_SUSPENSE_TYPE:
|
3050 | return 'Suspense';
|
3051 | }
|
3052 | if (typeof type === 'object') {
|
3053 | switch (type.$$typeof) {
|
3054 | case REACT_CONTEXT_TYPE:
|
3055 | return 'Context.Consumer';
|
3056 | case REACT_PROVIDER_TYPE:
|
3057 | return 'Context.Provider';
|
3058 | case REACT_FORWARD_REF_TYPE:
|
3059 | return getWrappedName(type, type.render, 'ForwardRef');
|
3060 | case REACT_MEMO_TYPE:
|
3061 | return getComponentName(type.type);
|
3062 | case REACT_LAZY_TYPE:
|
3063 | {
|
3064 | var thenable = type;
|
3065 | var resolvedThenable = refineResolvedLazyComponent(thenable);
|
3066 | if (resolvedThenable) {
|
3067 | return getComponentName(resolvedThenable);
|
3068 | }
|
3069 | }
|
3070 | }
|
3071 | }
|
3072 | return null;
|
3073 | }
|
3074 |
|
3075 | var ReactDebugCurrentFrame = {};
|
3076 |
|
3077 | var currentlyValidatingElement = null;
|
3078 |
|
3079 | function setCurrentlyValidatingElement(element) {
|
3080 | {
|
3081 | currentlyValidatingElement = element;
|
3082 | }
|
3083 | }
|
3084 |
|
3085 | {
|
3086 |
|
3087 | ReactDebugCurrentFrame.getCurrentStack = null;
|
3088 |
|
3089 | ReactDebugCurrentFrame.getStackAddendum = function () {
|
3090 | var stack = '';
|
3091 |
|
3092 |
|
3093 | if (currentlyValidatingElement) {
|
3094 | var name = getComponentName(currentlyValidatingElement.type);
|
3095 | var owner = currentlyValidatingElement._owner;
|
3096 | stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
|
3097 | }
|
3098 |
|
3099 |
|
3100 | var impl = ReactDebugCurrentFrame.getCurrentStack;
|
3101 | if (impl) {
|
3102 | stack += impl() || '';
|
3103 | }
|
3104 |
|
3105 | return stack;
|
3106 | };
|
3107 | }
|
3108 |
|
3109 | var ReactSharedInternals = {
|
3110 | ReactCurrentDispatcher: ReactCurrentDispatcher,
|
3111 | ReactCurrentOwner: ReactCurrentOwner,
|
3112 |
|
3113 | assign: _assign
|
3114 | };
|
3115 |
|
3116 | {
|
3117 | _assign(ReactSharedInternals, {
|
3118 |
|
3119 | ReactDebugCurrentFrame: ReactDebugCurrentFrame,
|
3120 |
|
3121 |
|
3122 | ReactComponentTreeHook: {}
|
3123 | });
|
3124 | }
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 | var warning = warningWithoutStack$1;
|
3134 |
|
3135 | {
|
3136 | warning = function (condition, format) {
|
3137 | if (condition) {
|
3138 | return;
|
3139 | }
|
3140 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
3141 | var stack = ReactDebugCurrentFrame.getStackAddendum();
|
3142 |
|
3143 |
|
3144 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
3145 | args[_key - 2] = arguments[_key];
|
3146 | }
|
3147 |
|
3148 | warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
|
3149 | };
|
3150 | }
|
3151 |
|
3152 | var warning$1 = warning;
|
3153 |
|
3154 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
3155 |
|
3156 | var RESERVED_PROPS = {
|
3157 | key: true,
|
3158 | ref: true,
|
3159 | __self: true,
|
3160 | __source: true
|
3161 | };
|
3162 |
|
3163 | var specialPropKeyWarningShown = void 0;
|
3164 | var specialPropRefWarningShown = void 0;
|
3165 |
|
3166 | function hasValidRef(config) {
|
3167 | {
|
3168 | if (hasOwnProperty.call(config, 'ref')) {
|
3169 | var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
3170 | if (getter && getter.isReactWarning) {
|
3171 | return false;
|
3172 | }
|
3173 | }
|
3174 | }
|
3175 | return config.ref !== undefined;
|
3176 | }
|
3177 |
|
3178 | function hasValidKey(config) {
|
3179 | {
|
3180 | if (hasOwnProperty.call(config, 'key')) {
|
3181 | var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
3182 | if (getter && getter.isReactWarning) {
|
3183 | return false;
|
3184 | }
|
3185 | }
|
3186 | }
|
3187 | return config.key !== undefined;
|
3188 | }
|
3189 |
|
3190 | function defineKeyPropWarningGetter(props, displayName) {
|
3191 | var warnAboutAccessingKey = function () {
|
3192 | if (!specialPropKeyWarningShown) {
|
3193 | specialPropKeyWarningShown = true;
|
3194 | 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);
|
3195 | }
|
3196 | };
|
3197 | warnAboutAccessingKey.isReactWarning = true;
|
3198 | Object.defineProperty(props, 'key', {
|
3199 | get: warnAboutAccessingKey,
|
3200 | configurable: true
|
3201 | });
|
3202 | }
|
3203 |
|
3204 | function defineRefPropWarningGetter(props, displayName) {
|
3205 | var warnAboutAccessingRef = function () {
|
3206 | if (!specialPropRefWarningShown) {
|
3207 | specialPropRefWarningShown = true;
|
3208 | 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);
|
3209 | }
|
3210 | };
|
3211 | warnAboutAccessingRef.isReactWarning = true;
|
3212 | Object.defineProperty(props, 'ref', {
|
3213 | get: warnAboutAccessingRef,
|
3214 | configurable: true
|
3215 | });
|
3216 | }
|
3217 |
|
3218 | /**
|
3219 | * Factory method to create a new React element. This no longer adheres to
|
3220 | * the class pattern, so do not use new to call it. Also, no instanceof check
|
3221 | * will work. Instead test $$typeof field against Symbol.for('react.element') to check
|
3222 | * if something is a React Element.
|
3223 | *
|
3224 | * @param {*} type
|
3225 | * @param {*} key
|
3226 | * @param {string|object} ref
|
3227 | * @param {*} self A *temporary* helper to detect places where `this` is
|
3228 | * different from the `owner` when React.createElement is called, so that we
|
3229 | * can warn. We want to get rid of owner and replace string `ref`s with arrow
|
3230 | * functions, and as long as `this` and owner are the same, there will be no
|
3231 | * change in behavior.
|
3232 | * @param {*} source An annotation object (added by a transpiler or otherwise)
|
3233 | * indicating filename, line number, and/or other information.
|
3234 | * @param {*} owner
|
3235 | * @param {*} props
|
3236 | * @internal
|
3237 | */
|
3238 | var ReactElement = function (type, key, ref, self, source, owner, props) {
|
3239 | var element = {
|
3240 |
|
3241 | $$typeof: REACT_ELEMENT_TYPE,
|
3242 |
|
3243 |
|
3244 | type: type,
|
3245 | key: key,
|
3246 | ref: ref,
|
3247 | props: props,
|
3248 |
|
3249 |
|
3250 | _owner: owner
|
3251 | };
|
3252 |
|
3253 | {
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 | element._store = {};
|
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 | Object.defineProperty(element._store, 'validated', {
|
3265 | configurable: false,
|
3266 | enumerable: false,
|
3267 | writable: true,
|
3268 | value: false
|
3269 | });
|
3270 |
|
3271 | Object.defineProperty(element, '_self', {
|
3272 | configurable: false,
|
3273 | enumerable: false,
|
3274 | writable: false,
|
3275 | value: self
|
3276 | });
|
3277 |
|
3278 |
|
3279 | Object.defineProperty(element, '_source', {
|
3280 | configurable: false,
|
3281 | enumerable: false,
|
3282 | writable: false,
|
3283 | value: source
|
3284 | });
|
3285 | if (Object.freeze) {
|
3286 | Object.freeze(element.props);
|
3287 | Object.freeze(element);
|
3288 | }
|
3289 | }
|
3290 |
|
3291 | return element;
|
3292 | };
|
3293 |
|
3294 |
|
3295 |
|
3296 |
|
3297 |
|
3298 | function createElement(type, config, children) {
|
3299 | var propName = void 0;
|
3300 |
|
3301 |
|
3302 | var props = {};
|
3303 |
|
3304 | var key = null;
|
3305 | var ref = null;
|
3306 | var self = null;
|
3307 | var source = null;
|
3308 |
|
3309 | if (config != null) {
|
3310 | if (hasValidRef(config)) {
|
3311 | ref = config.ref;
|
3312 | }
|
3313 | if (hasValidKey(config)) {
|
3314 | key = '' + config.key;
|
3315 | }
|
3316 |
|
3317 | self = config.__self === undefined ? null : config.__self;
|
3318 | source = config.__source === undefined ? null : config.__source;
|
3319 |
|
3320 | for (propName in config) {
|
3321 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
3322 | props[propName] = config[propName];
|
3323 | }
|
3324 | }
|
3325 | }
|
3326 |
|
3327 |
|
3328 |
|
3329 | var childrenLength = arguments.length - 2;
|
3330 | if (childrenLength === 1) {
|
3331 | props.children = children;
|
3332 | } else if (childrenLength > 1) {
|
3333 | var childArray = Array(childrenLength);
|
3334 | for (var i = 0; i < childrenLength; i++) {
|
3335 | childArray[i] = arguments[i + 2];
|
3336 | }
|
3337 | {
|
3338 | if (Object.freeze) {
|
3339 | Object.freeze(childArray);
|
3340 | }
|
3341 | }
|
3342 | props.children = childArray;
|
3343 | }
|
3344 |
|
3345 |
|
3346 | if (type && type.defaultProps) {
|
3347 | var defaultProps = type.defaultProps;
|
3348 | for (propName in defaultProps) {
|
3349 | if (props[propName] === undefined) {
|
3350 | props[propName] = defaultProps[propName];
|
3351 | }
|
3352 | }
|
3353 | }
|
3354 | {
|
3355 | if (key || ref) {
|
3356 | var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
3357 | if (key) {
|
3358 | defineKeyPropWarningGetter(props, displayName);
|
3359 | }
|
3360 | if (ref) {
|
3361 | defineRefPropWarningGetter(props, displayName);
|
3362 | }
|
3363 | }
|
3364 | }
|
3365 | return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
3366 | }
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 | function cloneAndReplaceKey(oldElement, newKey) {
|
3375 | var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
3376 |
|
3377 | return newElement;
|
3378 | }
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 | function cloneElement(element, config, children) {
|
3385 | !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
|
3386 |
|
3387 | var propName = void 0;
|
3388 |
|
3389 |
|
3390 | var props = _assign({}, element.props);
|
3391 |
|
3392 |
|
3393 | var key = element.key;
|
3394 | var ref = element.ref;
|
3395 |
|
3396 | var self = element._self;
|
3397 |
|
3398 |
|
3399 |
|
3400 | var source = element._source;
|
3401 |
|
3402 |
|
3403 | var owner = element._owner;
|
3404 |
|
3405 | if (config != null) {
|
3406 | if (hasValidRef(config)) {
|
3407 |
|
3408 | ref = config.ref;
|
3409 | owner = ReactCurrentOwner.current;
|
3410 | }
|
3411 | if (hasValidKey(config)) {
|
3412 | key = '' + config.key;
|
3413 | }
|
3414 |
|
3415 |
|
3416 | var defaultProps = void 0;
|
3417 | if (element.type && element.type.defaultProps) {
|
3418 | defaultProps = element.type.defaultProps;
|
3419 | }
|
3420 | for (propName in config) {
|
3421 | if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
3422 | if (config[propName] === undefined && defaultProps !== undefined) {
|
3423 |
|
3424 | props[propName] = defaultProps[propName];
|
3425 | } else {
|
3426 | props[propName] = config[propName];
|
3427 | }
|
3428 | }
|
3429 | }
|
3430 | }
|
3431 |
|
3432 |
|
3433 |
|
3434 | var childrenLength = arguments.length - 2;
|
3435 | if (childrenLength === 1) {
|
3436 | props.children = children;
|
3437 | } else if (childrenLength > 1) {
|
3438 | var childArray = Array(childrenLength);
|
3439 | for (var i = 0; i < childrenLength; i++) {
|
3440 | childArray[i] = arguments[i + 2];
|
3441 | }
|
3442 | props.children = childArray;
|
3443 | }
|
3444 |
|
3445 | return ReactElement(element.type, key, ref, self, source, owner, props);
|
3446 | }
|
3447 |
|
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 | function isValidElement(object) {
|
3456 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
3457 | }
|
3458 |
|
3459 | var SEPARATOR = '.';
|
3460 | var SUBSEPARATOR = ':';
|
3461 |
|
3462 |
|
3463 |
|
3464 |
|
3465 |
|
3466 |
|
3467 |
|
3468 | function escape(key) {
|
3469 | var escapeRegex = /[=:]/g;
|
3470 | var escaperLookup = {
|
3471 | '=': '=0',
|
3472 | ':': '=2'
|
3473 | };
|
3474 | var escapedString = ('' + key).replace(escapeRegex, function (match) {
|
3475 | return escaperLookup[match];
|
3476 | });
|
3477 |
|
3478 | return '$' + escapedString;
|
3479 | }
|
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 | var didWarnAboutMaps = false;
|
3487 |
|
3488 | var userProvidedKeyEscapeRegex = /\/+/g;
|
3489 | function escapeUserProvidedKey(text) {
|
3490 | return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
3491 | }
|
3492 |
|
3493 | var POOL_SIZE = 10;
|
3494 | var traverseContextPool = [];
|
3495 | function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
|
3496 | if (traverseContextPool.length) {
|
3497 | var traverseContext = traverseContextPool.pop();
|
3498 | traverseContext.result = mapResult;
|
3499 | traverseContext.keyPrefix = keyPrefix;
|
3500 | traverseContext.func = mapFunction;
|
3501 | traverseContext.context = mapContext;
|
3502 | traverseContext.count = 0;
|
3503 | return traverseContext;
|
3504 | } else {
|
3505 | return {
|
3506 | result: mapResult,
|
3507 | keyPrefix: keyPrefix,
|
3508 | func: mapFunction,
|
3509 | context: mapContext,
|
3510 | count: 0
|
3511 | };
|
3512 | }
|
3513 | }
|
3514 |
|
3515 | function releaseTraverseContext(traverseContext) {
|
3516 | traverseContext.result = null;
|
3517 | traverseContext.keyPrefix = null;
|
3518 | traverseContext.func = null;
|
3519 | traverseContext.context = null;
|
3520 | traverseContext.count = 0;
|
3521 | if (traverseContextPool.length < POOL_SIZE) {
|
3522 | traverseContextPool.push(traverseContext);
|
3523 | }
|
3524 | }
|
3525 |
|
3526 |
|
3527 |
|
3528 |
|
3529 |
|
3530 |
|
3531 |
|
3532 |
|
3533 |
|
3534 | function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
|
3535 | var type = typeof children;
|
3536 |
|
3537 | if (type === 'undefined' || type === 'boolean') {
|
3538 |
|
3539 | children = null;
|
3540 | }
|
3541 |
|
3542 | var invokeCallback = false;
|
3543 |
|
3544 | if (children === null) {
|
3545 | invokeCallback = true;
|
3546 | } else {
|
3547 | switch (type) {
|
3548 | case 'string':
|
3549 | case 'number':
|
3550 | invokeCallback = true;
|
3551 | break;
|
3552 | case 'object':
|
3553 | switch (children.$$typeof) {
|
3554 | case REACT_ELEMENT_TYPE:
|
3555 | case REACT_PORTAL_TYPE:
|
3556 | invokeCallback = true;
|
3557 | }
|
3558 | }
|
3559 | }
|
3560 |
|
3561 | if (invokeCallback) {
|
3562 | callback(traverseContext, children,
|
3563 |
|
3564 |
|
3565 | nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
|
3566 | return 1;
|
3567 | }
|
3568 |
|
3569 | var child = void 0;
|
3570 | var nextName = void 0;
|
3571 | var subtreeCount = 0;
|
3572 | var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
3573 |
|
3574 | if (Array.isArray(children)) {
|
3575 | for (var i = 0; i < children.length; i++) {
|
3576 | child = children[i];
|
3577 | nextName = nextNamePrefix + getComponentKey(child, i);
|
3578 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
3579 | }
|
3580 | } else {
|
3581 | var iteratorFn = getIteratorFn(children);
|
3582 | if (typeof iteratorFn === 'function') {
|
3583 | {
|
3584 |
|
3585 | if (iteratorFn === children.entries) {
|
3586 | !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;
|
3587 | didWarnAboutMaps = true;
|
3588 | }
|
3589 | }
|
3590 |
|
3591 | var iterator = iteratorFn.call(children);
|
3592 | var step = void 0;
|
3593 | var ii = 0;
|
3594 | while (!(step = iterator.next()).done) {
|
3595 | child = step.value;
|
3596 | nextName = nextNamePrefix + getComponentKey(child, ii++);
|
3597 | subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
|
3598 | }
|
3599 | } else if (type === 'object') {
|
3600 | var addendum = '';
|
3601 | {
|
3602 | addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
|
3603 | }
|
3604 | var childrenString = '' + children;
|
3605 | invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
|
3606 | }
|
3607 | }
|
3608 |
|
3609 | return subtreeCount;
|
3610 | }
|
3611 |
|
3612 |
|
3613 |
|
3614 |
|
3615 |
|
3616 |
|
3617 |
|
3618 |
|
3619 |
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 | function traverseAllChildren(children, callback, traverseContext) {
|
3629 | if (children == null) {
|
3630 | return 0;
|
3631 | }
|
3632 |
|
3633 | return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
3634 | }
|
3635 |
|
3636 |
|
3637 |
|
3638 |
|
3639 |
|
3640 |
|
3641 |
|
3642 |
|
3643 | function getComponentKey(component, index) {
|
3644 |
|
3645 |
|
3646 | if (typeof component === 'object' && component !== null && component.key != null) {
|
3647 |
|
3648 | return escape(component.key);
|
3649 | }
|
3650 |
|
3651 | return index.toString(36);
|
3652 | }
|
3653 |
|
3654 | function forEachSingleChild(bookKeeping, child, name) {
|
3655 | var func = bookKeeping.func,
|
3656 | context = bookKeeping.context;
|
3657 |
|
3658 | func.call(context, child, bookKeeping.count++);
|
3659 | }
|
3660 |
|
3661 |
|
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 | function forEachChildren(children, forEachFunc, forEachContext) {
|
3674 | if (children == null) {
|
3675 | return children;
|
3676 | }
|
3677 | var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
|
3678 | traverseAllChildren(children, forEachSingleChild, traverseContext);
|
3679 | releaseTraverseContext(traverseContext);
|
3680 | }
|
3681 |
|
3682 | function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
3683 | var result = bookKeeping.result,
|
3684 | keyPrefix = bookKeeping.keyPrefix,
|
3685 | func = bookKeeping.func,
|
3686 | context = bookKeeping.context;
|
3687 |
|
3688 |
|
3689 | var mappedChild = func.call(context, child, bookKeeping.count++);
|
3690 | if (Array.isArray(mappedChild)) {
|
3691 | mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
|
3692 | return c;
|
3693 | });
|
3694 | } else if (mappedChild != null) {
|
3695 | if (isValidElement(mappedChild)) {
|
3696 | mappedChild = cloneAndReplaceKey(mappedChild,
|
3697 |
|
3698 |
|
3699 | keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
|
3700 | }
|
3701 | result.push(mappedChild);
|
3702 | }
|
3703 | }
|
3704 |
|
3705 | function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
3706 | var escapedPrefix = '';
|
3707 | if (prefix != null) {
|
3708 | escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
3709 | }
|
3710 | var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
|
3711 | traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
3712 | releaseTraverseContext(traverseContext);
|
3713 | }
|
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 |
|
3726 |
|
3727 |
|
3728 | function mapChildren(children, func, context) {
|
3729 | if (children == null) {
|
3730 | return children;
|
3731 | }
|
3732 | var result = [];
|
3733 | mapIntoWithKeyPrefixInternal(children, result, null, func, context);
|
3734 | return result;
|
3735 | }
|
3736 |
|
3737 |
|
3738 |
|
3739 |
|
3740 |
|
3741 |
|
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 | function countChildren(children) {
|
3747 | return traverseAllChildren(children, function () {
|
3748 | return null;
|
3749 | }, null);
|
3750 | }
|
3751 |
|
3752 |
|
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 | function toArray(children) {
|
3759 | var result = [];
|
3760 | mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
|
3761 | return child;
|
3762 | });
|
3763 | return result;
|
3764 | }
|
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 |
|
3770 |
|
3771 |
|
3772 |
|
3773 |
|
3774 |
|
3775 |
|
3776 |
|
3777 |
|
3778 |
|
3779 |
|
3780 | function onlyChild(children) {
|
3781 | !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
|
3782 | return children;
|
3783 | }
|
3784 |
|
3785 | function createContext(defaultValue, calculateChangedBits) {
|
3786 | if (calculateChangedBits === undefined) {
|
3787 | calculateChangedBits = null;
|
3788 | } else {
|
3789 | {
|
3790 | !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
|
3791 | }
|
3792 | }
|
3793 |
|
3794 | var context = {
|
3795 | $$typeof: REACT_CONTEXT_TYPE,
|
3796 | _calculateChangedBits: calculateChangedBits,
|
3797 |
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 | _currentValue: defaultValue,
|
3803 | _currentValue2: defaultValue,
|
3804 |
|
3805 |
|
3806 | _threadCount: 0,
|
3807 |
|
3808 | Provider: null,
|
3809 | Consumer: null
|
3810 | };
|
3811 |
|
3812 | context.Provider = {
|
3813 | $$typeof: REACT_PROVIDER_TYPE,
|
3814 | _context: context
|
3815 | };
|
3816 |
|
3817 | var hasWarnedAboutUsingNestedContextConsumers = false;
|
3818 | var hasWarnedAboutUsingConsumerProvider = false;
|
3819 |
|
3820 | {
|
3821 |
|
3822 |
|
3823 |
|
3824 | var Consumer = {
|
3825 | $$typeof: REACT_CONTEXT_TYPE,
|
3826 | _context: context,
|
3827 | _calculateChangedBits: context._calculateChangedBits
|
3828 | };
|
3829 |
|
3830 | Object.defineProperties(Consumer, {
|
3831 | Provider: {
|
3832 | get: function () {
|
3833 | if (!hasWarnedAboutUsingConsumerProvider) {
|
3834 | hasWarnedAboutUsingConsumerProvider = true;
|
3835 | 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?');
|
3836 | }
|
3837 | return context.Provider;
|
3838 | },
|
3839 | set: function (_Provider) {
|
3840 | context.Provider = _Provider;
|
3841 | }
|
3842 | },
|
3843 | _currentValue: {
|
3844 | get: function () {
|
3845 | return context._currentValue;
|
3846 | },
|
3847 | set: function (_currentValue) {
|
3848 | context._currentValue = _currentValue;
|
3849 | }
|
3850 | },
|
3851 | _currentValue2: {
|
3852 | get: function () {
|
3853 | return context._currentValue2;
|
3854 | },
|
3855 | set: function (_currentValue2) {
|
3856 | context._currentValue2 = _currentValue2;
|
3857 | }
|
3858 | },
|
3859 | _threadCount: {
|
3860 | get: function () {
|
3861 | return context._threadCount;
|
3862 | },
|
3863 | set: function (_threadCount) {
|
3864 | context._threadCount = _threadCount;
|
3865 | }
|
3866 | },
|
3867 | Consumer: {
|
3868 | get: function () {
|
3869 | if (!hasWarnedAboutUsingNestedContextConsumers) {
|
3870 | hasWarnedAboutUsingNestedContextConsumers = true;
|
3871 | 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?');
|
3872 | }
|
3873 | return context.Consumer;
|
3874 | }
|
3875 | }
|
3876 | });
|
3877 |
|
3878 | context.Consumer = Consumer;
|
3879 | }
|
3880 |
|
3881 | {
|
3882 | context._currentRenderer = null;
|
3883 | context._currentRenderer2 = null;
|
3884 | }
|
3885 |
|
3886 | return context;
|
3887 | }
|
3888 |
|
3889 | function lazy(ctor) {
|
3890 | var lazyType = {
|
3891 | $$typeof: REACT_LAZY_TYPE,
|
3892 | _ctor: ctor,
|
3893 |
|
3894 | _status: -1,
|
3895 | _result: null
|
3896 | };
|
3897 |
|
3898 | {
|
3899 |
|
3900 | var defaultProps = void 0;
|
3901 | var propTypes = void 0;
|
3902 | Object.defineProperties(lazyType, {
|
3903 | defaultProps: {
|
3904 | configurable: true,
|
3905 | get: function () {
|
3906 | return defaultProps;
|
3907 | },
|
3908 | set: function (newDefaultProps) {
|
3909 | 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.');
|
3910 | defaultProps = newDefaultProps;
|
3911 |
|
3912 | Object.defineProperty(lazyType, 'defaultProps', {
|
3913 | enumerable: true
|
3914 | });
|
3915 | }
|
3916 | },
|
3917 | propTypes: {
|
3918 | configurable: true,
|
3919 | get: function () {
|
3920 | return propTypes;
|
3921 | },
|
3922 | set: function (newPropTypes) {
|
3923 | 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.');
|
3924 | propTypes = newPropTypes;
|
3925 |
|
3926 | Object.defineProperty(lazyType, 'propTypes', {
|
3927 | enumerable: true
|
3928 | });
|
3929 | }
|
3930 | }
|
3931 | });
|
3932 | }
|
3933 |
|
3934 | return lazyType;
|
3935 | }
|
3936 |
|
3937 | function forwardRef(render) {
|
3938 | {
|
3939 | if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
3940 | warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
3941 | } else if (typeof render !== 'function') {
|
3942 | warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
3943 | } else {
|
3944 | !(
|
3945 |
|
3946 | 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;
|
3947 | }
|
3948 |
|
3949 | if (render != null) {
|
3950 | !(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;
|
3951 | }
|
3952 | }
|
3953 |
|
3954 | return {
|
3955 | $$typeof: REACT_FORWARD_REF_TYPE,
|
3956 | render: render
|
3957 | };
|
3958 | }
|
3959 |
|
3960 | function isValidElementType(type) {
|
3961 | return typeof type === 'string' || typeof type === 'function' ||
|
3962 |
|
3963 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_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);
|
3964 | }
|
3965 |
|
3966 | function memo(type, compare) {
|
3967 | {
|
3968 | if (!isValidElementType(type)) {
|
3969 | warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
3970 | }
|
3971 | }
|
3972 | return {
|
3973 | $$typeof: REACT_MEMO_TYPE,
|
3974 | type: type,
|
3975 | compare: compare === undefined ? null : compare
|
3976 | };
|
3977 | }
|
3978 |
|
3979 | function resolveDispatcher() {
|
3980 | var dispatcher = ReactCurrentDispatcher.current;
|
3981 | !(dispatcher !== null) ? invariant(false, '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.') : void 0;
|
3982 | return dispatcher;
|
3983 | }
|
3984 |
|
3985 | function useContext(Context, unstable_observedBits) {
|
3986 | var dispatcher = resolveDispatcher();
|
3987 | {
|
3988 | !(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;
|
3989 |
|
3990 |
|
3991 | if (Context._context !== undefined) {
|
3992 | var realContext = Context._context;
|
3993 |
|
3994 |
|
3995 | if (realContext.Consumer === Context) {
|
3996 | 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?');
|
3997 | } else if (realContext.Provider === Context) {
|
3998 | warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
3999 | }
|
4000 | }
|
4001 | }
|
4002 | return dispatcher.useContext(Context, unstable_observedBits);
|
4003 | }
|
4004 |
|
4005 | function useState(initialState) {
|
4006 | var dispatcher = resolveDispatcher();
|
4007 | return dispatcher.useState(initialState);
|
4008 | }
|
4009 |
|
4010 | function useReducer(reducer, initialArg, init) {
|
4011 | var dispatcher = resolveDispatcher();
|
4012 | return dispatcher.useReducer(reducer, initialArg, init);
|
4013 | }
|
4014 |
|
4015 | function useRef(initialValue) {
|
4016 | var dispatcher = resolveDispatcher();
|
4017 | return dispatcher.useRef(initialValue);
|
4018 | }
|
4019 |
|
4020 | function useEffect(create, inputs) {
|
4021 | var dispatcher = resolveDispatcher();
|
4022 | return dispatcher.useEffect(create, inputs);
|
4023 | }
|
4024 |
|
4025 | function useLayoutEffect(create, inputs) {
|
4026 | var dispatcher = resolveDispatcher();
|
4027 | return dispatcher.useLayoutEffect(create, inputs);
|
4028 | }
|
4029 |
|
4030 | function useCallback(callback, inputs) {
|
4031 | var dispatcher = resolveDispatcher();
|
4032 | return dispatcher.useCallback(callback, inputs);
|
4033 | }
|
4034 |
|
4035 | function useMemo(create, inputs) {
|
4036 | var dispatcher = resolveDispatcher();
|
4037 | return dispatcher.useMemo(create, inputs);
|
4038 | }
|
4039 |
|
4040 | function useImperativeHandle(ref, create, inputs) {
|
4041 | var dispatcher = resolveDispatcher();
|
4042 | return dispatcher.useImperativeHandle(ref, create, inputs);
|
4043 | }
|
4044 |
|
4045 | function useDebugValue(value, formatterFn) {
|
4046 | {
|
4047 | var dispatcher = resolveDispatcher();
|
4048 | return dispatcher.useDebugValue(value, formatterFn);
|
4049 | }
|
4050 | }
|
4051 |
|
4052 |
|
4053 |
|
4054 |
|
4055 |
|
4056 |
|
4057 |
|
4058 |
|
4059 | var propTypesMisspellWarningShown = void 0;
|
4060 |
|
4061 | {
|
4062 | propTypesMisspellWarningShown = false;
|
4063 | }
|
4064 |
|
4065 | function getDeclarationErrorAddendum() {
|
4066 | if (ReactCurrentOwner.current) {
|
4067 | var name = getComponentName(ReactCurrentOwner.current.type);
|
4068 | if (name) {
|
4069 | return '\n\nCheck the render method of `' + name + '`.';
|
4070 | }
|
4071 | }
|
4072 | return '';
|
4073 | }
|
4074 |
|
4075 | function getSourceInfoErrorAddendum(elementProps) {
|
4076 | if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
|
4077 | var source = elementProps.__source;
|
4078 | var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
4079 | var lineNumber = source.lineNumber;
|
4080 | return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
4081 | }
|
4082 | return '';
|
4083 | }
|
4084 |
|
4085 |
|
4086 |
|
4087 |
|
4088 |
|
4089 |
|
4090 | var ownerHasKeyUseWarning = {};
|
4091 |
|
4092 | function getCurrentComponentErrorInfo(parentType) {
|
4093 | var info = getDeclarationErrorAddendum();
|
4094 |
|
4095 | if (!info) {
|
4096 | var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
4097 | if (parentName) {
|
4098 | info = '\n\nCheck the top-level render call using <' + parentName + '>.';
|
4099 | }
|
4100 | }
|
4101 | return info;
|
4102 | }
|
4103 |
|
4104 |
|
4105 |
|
4106 |
|
4107 |
|
4108 |
|
4109 |
|
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 | function validateExplicitKey(element, parentType) {
|
4116 | if (!element._store || element._store.validated || element.key != null) {
|
4117 | return;
|
4118 | }
|
4119 | element._store.validated = true;
|
4120 |
|
4121 | var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
4122 | if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
4123 | return;
|
4124 | }
|
4125 | ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
4126 |
|
4127 |
|
4128 |
|
4129 |
|
4130 | var childOwner = '';
|
4131 | if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
4132 |
|
4133 | childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
|
4134 | }
|
4135 |
|
4136 | setCurrentlyValidatingElement(element);
|
4137 | {
|
4138 | 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);
|
4139 | }
|
4140 | setCurrentlyValidatingElement(null);
|
4141 | }
|
4142 |
|
4143 |
|
4144 |
|
4145 |
|
4146 |
|
4147 |
|
4148 |
|
4149 |
|
4150 |
|
4151 |
|
4152 | function validateChildKeys(node, parentType) {
|
4153 | if (typeof node !== 'object') {
|
4154 | return;
|
4155 | }
|
4156 | if (Array.isArray(node)) {
|
4157 | for (var i = 0; i < node.length; i++) {
|
4158 | var child = node[i];
|
4159 | if (isValidElement(child)) {
|
4160 | validateExplicitKey(child, parentType);
|
4161 | }
|
4162 | }
|
4163 | } else if (isValidElement(node)) {
|
4164 |
|
4165 | if (node._store) {
|
4166 | node._store.validated = true;
|
4167 | }
|
4168 | } else if (node) {
|
4169 | var iteratorFn = getIteratorFn(node);
|
4170 | if (typeof iteratorFn === 'function') {
|
4171 |
|
4172 |
|
4173 | if (iteratorFn !== node.entries) {
|
4174 | var iterator = iteratorFn.call(node);
|
4175 | var step = void 0;
|
4176 | while (!(step = iterator.next()).done) {
|
4177 | if (isValidElement(step.value)) {
|
4178 | validateExplicitKey(step.value, parentType);
|
4179 | }
|
4180 | }
|
4181 | }
|
4182 | }
|
4183 | }
|
4184 | }
|
4185 |
|
4186 |
|
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 |
|
4192 | function validatePropTypes(element) {
|
4193 | var type = element.type;
|
4194 | if (type === null || type === undefined || typeof type === 'string') {
|
4195 | return;
|
4196 | }
|
4197 | var name = getComponentName(type);
|
4198 | var propTypes = void 0;
|
4199 | if (typeof type === 'function') {
|
4200 | propTypes = type.propTypes;
|
4201 | } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
4202 |
|
4203 |
|
4204 | type.$$typeof === REACT_MEMO_TYPE)) {
|
4205 | propTypes = type.propTypes;
|
4206 | } else {
|
4207 | return;
|
4208 | }
|
4209 | if (propTypes) {
|
4210 | setCurrentlyValidatingElement(element);
|
4211 | checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
|
4212 | setCurrentlyValidatingElement(null);
|
4213 | } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
4214 | propTypesMisspellWarningShown = true;
|
4215 | warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
|
4216 | }
|
4217 | if (typeof type.getDefaultProps === 'function') {
|
4218 | !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
|
4219 | }
|
4220 | }
|
4221 |
|
4222 |
|
4223 |
|
4224 |
|
4225 |
|
4226 | function validateFragmentProps(fragment) {
|
4227 | setCurrentlyValidatingElement(fragment);
|
4228 |
|
4229 | var keys = Object.keys(fragment.props);
|
4230 | for (var i = 0; i < keys.length; i++) {
|
4231 | var key = keys[i];
|
4232 | if (key !== 'children' && key !== 'key') {
|
4233 | warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
4234 | break;
|
4235 | }
|
4236 | }
|
4237 |
|
4238 | if (fragment.ref !== null) {
|
4239 | warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
|
4240 | }
|
4241 |
|
4242 | setCurrentlyValidatingElement(null);
|
4243 | }
|
4244 |
|
4245 | function createElementWithValidation(type, props, children) {
|
4246 | var validType = isValidElementType(type);
|
4247 |
|
4248 |
|
4249 |
|
4250 | if (!validType) {
|
4251 | var info = '';
|
4252 | if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
4253 | 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.";
|
4254 | }
|
4255 |
|
4256 | var sourceInfo = getSourceInfoErrorAddendum(props);
|
4257 | if (sourceInfo) {
|
4258 | info += sourceInfo;
|
4259 | } else {
|
4260 | info += getDeclarationErrorAddendum();
|
4261 | }
|
4262 |
|
4263 | var typeString = void 0;
|
4264 | if (type === null) {
|
4265 | typeString = 'null';
|
4266 | } else if (Array.isArray(type)) {
|
4267 | typeString = 'array';
|
4268 | } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
4269 | typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
|
4270 | info = ' Did you accidentally export a JSX literal instead of a component?';
|
4271 | } else {
|
4272 | typeString = typeof type;
|
4273 | }
|
4274 |
|
4275 | 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);
|
4276 | }
|
4277 |
|
4278 | var element = createElement.apply(this, arguments);
|
4279 |
|
4280 |
|
4281 |
|
4282 | if (element == null) {
|
4283 | return element;
|
4284 | }
|
4285 |
|
4286 |
|
4287 |
|
4288 |
|
4289 |
|
4290 |
|
4291 | if (validType) {
|
4292 | for (var i = 2; i < arguments.length; i++) {
|
4293 | validateChildKeys(arguments[i], type);
|
4294 | }
|
4295 | }
|
4296 |
|
4297 | if (type === REACT_FRAGMENT_TYPE) {
|
4298 | validateFragmentProps(element);
|
4299 | } else {
|
4300 | validatePropTypes(element);
|
4301 | }
|
4302 |
|
4303 | return element;
|
4304 | }
|
4305 |
|
4306 | function createFactoryWithValidation(type) {
|
4307 | var validatedFactory = createElementWithValidation.bind(null, type);
|
4308 | validatedFactory.type = type;
|
4309 |
|
4310 | {
|
4311 | Object.defineProperty(validatedFactory, 'type', {
|
4312 | enumerable: false,
|
4313 | get: function () {
|
4314 | lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
4315 | Object.defineProperty(this, 'type', {
|
4316 | value: type
|
4317 | });
|
4318 | return type;
|
4319 | }
|
4320 | });
|
4321 | }
|
4322 |
|
4323 | return validatedFactory;
|
4324 | }
|
4325 |
|
4326 | function cloneElementWithValidation(element, props, children) {
|
4327 | var newElement = cloneElement.apply(this, arguments);
|
4328 | for (var i = 2; i < arguments.length; i++) {
|
4329 | validateChildKeys(arguments[i], newElement.type);
|
4330 | }
|
4331 | validatePropTypes(newElement);
|
4332 | return newElement;
|
4333 | }
|
4334 |
|
4335 |
|
4336 |
|
4337 |
|
4338 |
|
4339 |
|
4340 |
|
4341 |
|
4342 |
|
4343 |
|
4344 |
|
4345 |
|
4346 |
|
4347 |
|
4348 |
|
4349 |
|
4350 |
|
4351 |
|
4352 |
|
4353 |
|
4354 |
|
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 |
|
4360 |
|
4361 |
|
4362 |
|
4363 |
|
4364 |
|
4365 |
|
4366 |
|
4367 |
|
4368 |
|
4369 |
|
4370 |
|
4371 |
|
4372 | var enableStableConcurrentModeAPIs = false;
|
4373 |
|
4374 | var React = {
|
4375 | Children: {
|
4376 | map: mapChildren,
|
4377 | forEach: forEachChildren,
|
4378 | count: countChildren,
|
4379 | toArray: toArray,
|
4380 | only: onlyChild
|
4381 | },
|
4382 |
|
4383 | createRef: createRef,
|
4384 | Component: Component,
|
4385 | PureComponent: PureComponent,
|
4386 |
|
4387 | createContext: createContext,
|
4388 | forwardRef: forwardRef,
|
4389 | lazy: lazy,
|
4390 | memo: memo,
|
4391 |
|
4392 | useCallback: useCallback,
|
4393 | useContext: useContext,
|
4394 | useEffect: useEffect,
|
4395 | useImperativeHandle: useImperativeHandle,
|
4396 | useDebugValue: useDebugValue,
|
4397 | useLayoutEffect: useLayoutEffect,
|
4398 | useMemo: useMemo,
|
4399 | useReducer: useReducer,
|
4400 | useRef: useRef,
|
4401 | useState: useState,
|
4402 |
|
4403 | Fragment: REACT_FRAGMENT_TYPE,
|
4404 | StrictMode: REACT_STRICT_MODE_TYPE,
|
4405 | Suspense: REACT_SUSPENSE_TYPE,
|
4406 |
|
4407 | createElement: createElementWithValidation,
|
4408 | cloneElement: cloneElementWithValidation,
|
4409 | createFactory: createFactoryWithValidation,
|
4410 | isValidElement: isValidElement,
|
4411 |
|
4412 | version: ReactVersion,
|
4413 |
|
4414 | unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
|
4415 | unstable_Profiler: REACT_PROFILER_TYPE,
|
4416 |
|
4417 | __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
|
4418 | };
|
4419 |
|
4420 |
|
4421 |
|
4422 |
|
4423 |
|
4424 |
|
4425 | if (enableStableConcurrentModeAPIs) {
|
4426 | React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
4427 | React.Profiler = REACT_PROFILER_TYPE;
|
4428 | React.unstable_ConcurrentMode = undefined;
|
4429 | React.unstable_Profiler = undefined;
|
4430 | }
|
4431 |
|
4432 |
|
4433 |
|
4434 | var React$2 = Object.freeze({
|
4435 | default: React
|
4436 | });
|
4437 |
|
4438 | var React$3 = ( React$2 && React ) || React$2;
|
4439 |
|
4440 |
|
4441 |
|
4442 | var react = React$3.default || React$3;
|
4443 |
|
4444 | module.exports = react;
|
4445 | })();
|
4446 | }
|
4447 |
|
4448 | }.call(exports, __webpack_require__(0)))
|
4449 |
|
4450 | }),
|
4451 |
|
4452 | (function(module, __webpack_exports__, __webpack_require__) {
|
4453 |
|
4454 | "use strict";
|
4455 | Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
4456 | var __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__ = __webpack_require__(20);
|
4457 | __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__MemoryRouter__["a"]; });
|
4458 | var __WEBPACK_IMPORTED_MODULE_1__Prompt__ = __webpack_require__(30);
|
4459 | __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_1__Prompt__["a"]; });
|
4460 | var __WEBPACK_IMPORTED_MODULE_2__Redirect__ = __webpack_require__(31);
|
4461 | __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_2__Redirect__["a"]; });
|
4462 | var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(14);
|
4463 | __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_3__Route__["a"]; });
|
4464 | var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(8);
|
4465 | __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_4__Router__["a"]; });
|
4466 | var __WEBPACK_IMPORTED_MODULE_5__StaticRouter__ = __webpack_require__(33);
|
4467 | __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_5__StaticRouter__["a"]; });
|
4468 | var __WEBPACK_IMPORTED_MODULE_6__Switch__ = __webpack_require__(34);
|
4469 | __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_6__Switch__["a"]; });
|
4470 | var __WEBPACK_IMPORTED_MODULE_7__generatePath__ = __webpack_require__(12);
|
4471 | __webpack_require__.d(__webpack_exports__, "generatePath", function() { return __WEBPACK_IMPORTED_MODULE_7__generatePath__["a"]; });
|
4472 | var __WEBPACK_IMPORTED_MODULE_8__matchPath__ = __webpack_require__(9);
|
4473 | __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_8__matchPath__["a"]; });
|
4474 | var __WEBPACK_IMPORTED_MODULE_9__withRouter__ = __webpack_require__(35);
|
4475 | __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__withRouter__["a"]; });
|
4476 |
|
4477 |
|
4478 |
|
4479 |
|
4480 |
|
4481 |
|
4482 |
|
4483 |
|
4484 |
|
4485 |
|
4486 |
|
4487 |
|
4488 |
|
4489 |
|
4490 |
|
4491 |
|
4492 |
|
4493 |
|
4494 |
|
4495 |
|
4496 |
|
4497 | }),
|
4498 |
|
4499 | (function(module, __webpack_exports__, __webpack_require__) {
|
4500 |
|
4501 | "use strict";
|
4502 | var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(3);
|
4503 | var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
4504 | var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(1);
|
4505 | var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
|
4506 | var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(2);
|
4507 | var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__);
|
4508 | var __WEBPACK_IMPORTED_MODULE_3_history__ = __webpack_require__(7);
|
4509 | var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(8);
|
4510 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4511 |
|
4512 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
4513 |
|
4514 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
4515 |
|
4516 |
|
4517 |
|
4518 |
|
4519 |
|
4520 |
|
4521 |
|
4522 |
|
4523 |
|
4524 |
|
4525 |
|
4526 | var MemoryRouter = function (_React$Component) {
|
4527 | _inherits(MemoryRouter, _React$Component);
|
4528 |
|
4529 | function MemoryRouter() {
|
4530 | var _temp, _this, _ret;
|
4531 |
|
4532 | _classCallCheck(this, MemoryRouter);
|
4533 |
|
4534 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
4535 | args[_key] = arguments[_key];
|
4536 | }
|
4537 |
|
4538 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = Object(__WEBPACK_IMPORTED_MODULE_3_history__["b" ])(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
|
4539 | }
|
4540 |
|
4541 | MemoryRouter.prototype.componentWillMount = function componentWillMount() {
|
4542 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
|
4543 | };
|
4544 |
|
4545 | MemoryRouter.prototype.render = function render() {
|
4546 | return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" ], { history: this.history, children: this.props.children });
|
4547 | };
|
4548 |
|
4549 | return MemoryRouter;
|
4550 | }(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);
|
4551 |
|
4552 | MemoryRouter.propTypes = {
|
4553 | initialEntries: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.array,
|
4554 | initialIndex: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,
|
4555 | getUserConfirmation: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func,
|
4556 | keyLength: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number,
|
4557 | children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node
|
4558 | };
|
4559 |
|
4560 |
|
4561 | __webpack_exports__["a"] = (MemoryRouter);
|
4562 |
|
4563 | }),
|
4564 |
|
4565 | (function(module, exports, __webpack_require__) {
|
4566 |
|
4567 | "use strict";
|
4568 |
|
4569 |
|
4570 |
|
4571 |
|
4572 |
|
4573 |
|
4574 |
|
4575 |
|
4576 |
|
4577 | Object.defineProperty(exports,"__esModule",{value:!0});
|
4578 | var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):
|
4579 | 60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;
|
4580 | exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k};
|
4581 | exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f};
|
4582 | exports.isSuspense=function(a){return t(a)===p};
|
4583 |
|
4584 |
|
4585 | }),
|
4586 |
|
4587 | (function(module, exports, __webpack_require__) {
|
4588 |
|
4589 | "use strict";
|
4590 | (function(process) { |
4591 |
|
4592 |
|
4593 |
|
4594 |
|
4595 |
|
4596 |
|
4597 |
|
4598 |
|
4599 |
|
4600 |
|
4601 |
|
4602 |
|
4603 | if (process.env.NODE_ENV !== "production") {
|
4604 | (function() {
|
4605 | 'use strict';
|
4606 |
|
4607 | Object.defineProperty(exports, '__esModule', { value: true });
|
4608 |
|
4609 |
|
4610 |
|
4611 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
4612 |
|
4613 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
4614 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
4615 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
4616 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
4617 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
4618 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
4619 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
4620 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
4621 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
4622 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
4623 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
4624 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
4625 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
4626 |
|
4627 | function isValidElementType(type) {
|
4628 | return typeof type === 'string' || typeof type === 'function' ||
|
4629 |
|
4630 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_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);
|
4631 | }
|
4632 |
|
4633 |
|
4634 |
|
4635 |
|
4636 |
|
4637 |
|
4638 |
|
4639 |
|
4640 |
|
4641 |
|
4642 |
|
4643 |
|
4644 |
|
4645 |
|
4646 |
|
4647 | var lowPriorityWarning = function () {};
|
4648 |
|
4649 | {
|
4650 | var printWarning = function (format) {
|
4651 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
4652 | args[_key - 1] = arguments[_key];
|
4653 | }
|
4654 |
|
4655 | var argIndex = 0;
|
4656 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
4657 | return args[argIndex++];
|
4658 | });
|
4659 | if (typeof console !== 'undefined') {
|
4660 | console.warn(message);
|
4661 | }
|
4662 | try {
|
4663 |
|
4664 |
|
4665 |
|
4666 | throw new Error(message);
|
4667 | } catch (x) {}
|
4668 | };
|
4669 |
|
4670 | lowPriorityWarning = function (condition, format) {
|
4671 | if (format === undefined) {
|
4672 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
4673 | }
|
4674 | if (!condition) {
|
4675 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
4676 | args[_key2 - 2] = arguments[_key2];
|
4677 | }
|
4678 |
|
4679 | printWarning.apply(undefined, [format].concat(args));
|
4680 | }
|
4681 | };
|
4682 | }
|
4683 |
|
4684 | var lowPriorityWarning$1 = lowPriorityWarning;
|
4685 |
|
4686 | function typeOf(object) {
|
4687 | if (typeof object === 'object' && object !== null) {
|
4688 | var $$typeof = object.$$typeof;
|
4689 | switch ($$typeof) {
|
4690 | case REACT_ELEMENT_TYPE:
|
4691 | var type = object.type;
|
4692 |
|
4693 | switch (type) {
|
4694 | case REACT_ASYNC_MODE_TYPE:
|
4695 | case REACT_CONCURRENT_MODE_TYPE:
|
4696 | case REACT_FRAGMENT_TYPE:
|
4697 | case REACT_PROFILER_TYPE:
|
4698 | case REACT_STRICT_MODE_TYPE:
|
4699 | case REACT_SUSPENSE_TYPE:
|
4700 | return type;
|
4701 | default:
|
4702 | var $$typeofType = type && type.$$typeof;
|
4703 |
|
4704 | switch ($$typeofType) {
|
4705 | case REACT_CONTEXT_TYPE:
|
4706 | case REACT_FORWARD_REF_TYPE:
|
4707 | case REACT_PROVIDER_TYPE:
|
4708 | return $$typeofType;
|
4709 | default:
|
4710 | return $$typeof;
|
4711 | }
|
4712 | }
|
4713 | case REACT_LAZY_TYPE:
|
4714 | case REACT_MEMO_TYPE:
|
4715 | case REACT_PORTAL_TYPE:
|
4716 | return $$typeof;
|
4717 | }
|
4718 | }
|
4719 |
|
4720 | return undefined;
|
4721 | }
|
4722 |
|
4723 |
|
4724 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
4725 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
4726 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
4727 | var ContextProvider = REACT_PROVIDER_TYPE;
|
4728 | var Element = REACT_ELEMENT_TYPE;
|
4729 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
4730 | var Fragment = REACT_FRAGMENT_TYPE;
|
4731 | var Lazy = REACT_LAZY_TYPE;
|
4732 | var Memo = REACT_MEMO_TYPE;
|
4733 | var Portal = REACT_PORTAL_TYPE;
|
4734 | var Profiler = REACT_PROFILER_TYPE;
|
4735 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
4736 | var Suspense = REACT_SUSPENSE_TYPE;
|
4737 |
|
4738 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
4739 |
|
4740 |
|
4741 | function isAsyncMode(object) {
|
4742 | {
|
4743 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
4744 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
4745 | lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
4746 | }
|
4747 | }
|
4748 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
4749 | }
|
4750 | function isConcurrentMode(object) {
|
4751 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
4752 | }
|
4753 | function isContextConsumer(object) {
|
4754 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
4755 | }
|
4756 | function isContextProvider(object) {
|
4757 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
4758 | }
|
4759 | function isElement(object) {
|
4760 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
4761 | }
|
4762 | function isForwardRef(object) {
|
4763 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
4764 | }
|
4765 | function isFragment(object) {
|
4766 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
4767 | }
|
4768 | function isLazy(object) {
|
4769 | return typeOf(object) === REACT_LAZY_TYPE;
|
4770 | }
|
4771 | function isMemo(object) {
|
4772 | return typeOf(object) === REACT_MEMO_TYPE;
|
4773 | }
|
4774 | function isPortal(object) {
|
4775 | return typeOf(object) === REACT_PORTAL_TYPE;
|
4776 | }
|
4777 | function isProfiler(object) {
|
4778 | return typeOf(object) === REACT_PROFILER_TYPE;
|
4779 | }
|
4780 | function isStrictMode(object) {
|
4781 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
4782 | }
|
4783 | function isSuspense(object) {
|
4784 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
4785 | }
|
4786 |
|
4787 | exports.typeOf = typeOf;
|
4788 | exports.AsyncMode = AsyncMode;
|
4789 | exports.ConcurrentMode = ConcurrentMode;
|
4790 | exports.ContextConsumer = ContextConsumer;
|
4791 | exports.ContextProvider = ContextProvider;
|
4792 | exports.Element = Element;
|
4793 | exports.ForwardRef = ForwardRef;
|
4794 | exports.Fragment = Fragment;
|
4795 | exports.Lazy = Lazy;
|
4796 | exports.Memo = Memo;
|
4797 | exports.Portal = Portal;
|
4798 | exports.Profiler = Profiler;
|
4799 | exports.StrictMode = StrictMode;
|
4800 | exports.Suspense = Suspense;
|
4801 | exports.isValidElementType = isValidElementType;
|
4802 | exports.isAsyncMode = isAsyncMode;
|
4803 | exports.isConcurrentMode = isConcurrentMode;
|
4804 | exports.isContextConsumer = isContextConsumer;
|
4805 | exports.isContextProvider = isContextProvider;
|
4806 | exports.isElement = isElement;
|
4807 | exports.isForwardRef = isForwardRef;
|
4808 | exports.isFragment = isFragment;
|
4809 | exports.isLazy = isLazy;
|
4810 | exports.isMemo = isMemo;
|
4811 | exports.isPortal = isPortal;
|
4812 | exports.isProfiler = isProfiler;
|
4813 | exports.isStrictMode = isStrictMode;
|
4814 | exports.isSuspense = isSuspense;
|
4815 | })();
|
4816 | }
|
4817 |
|
4818 | }.call(exports, __webpack_require__(0)))
|
4819 |
|
4820 | }),
|
4821 |
|
4822 | (function(module, exports, __webpack_require__) {
|
4823 |
|
4824 | "use strict";
|
4825 | (function(process) { |
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 |
|
4833 |
|
4834 | var ReactIs = __webpack_require__(11);
|
4835 | var assign = __webpack_require__(5);
|
4836 |
|
4837 | var ReactPropTypesSecret = __webpack_require__(6);
|
4838 | var checkPropTypes = __webpack_require__(10);
|
4839 |
|
4840 | var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
4841 | var printWarning = function() {};
|
4842 |
|
4843 | if (process.env.NODE_ENV !== 'production') {
|
4844 | printWarning = function(text) {
|
4845 | var message = 'Warning: ' + text;
|
4846 | if (typeof console !== 'undefined') {
|
4847 | console.error(message);
|
4848 | }
|
4849 | try {
|
4850 |
|
4851 |
|
4852 |
|
4853 | throw new Error(message);
|
4854 | } catch (x) {}
|
4855 | };
|
4856 | }
|
4857 |
|
4858 | function emptyFunctionThatReturnsNull() {
|
4859 | return null;
|
4860 | }
|
4861 |
|
4862 | module.exports = function(isValidElement, throwOnDirectAccess) {
|
4863 |
|
4864 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
4865 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
4866 |
|
4867 | |
4868 |
|
4869 |
|
4870 |
|
4871 |
|
4872 |
|
4873 |
|
4874 |
|
4875 |
|
4876 |
|
4877 |
|
4878 |
|
4879 |
|
4880 |
|
4881 | function getIteratorFn(maybeIterable) {
|
4882 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
4883 | if (typeof iteratorFn === 'function') {
|
4884 | return iteratorFn;
|
4885 | }
|
4886 | }
|
4887 |
|
4888 | |
4889 |
|
4890 |
|
4891 |
|
4892 |
|
4893 |
|
4894 |
|
4895 |
|
4896 |
|
4897 |
|
4898 |
|
4899 |
|
4900 |
|
4901 |
|
4902 |
|
4903 |
|
4904 |
|
4905 |
|
4906 |
|
4907 |
|
4908 |
|
4909 |
|
4910 |
|
4911 |
|
4912 |
|
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 |
|
4921 |
|
4922 |
|
4923 |
|
4924 |
|
4925 |
|
4926 |
|
4927 |
|
4928 |
|
4929 |
|
4930 |
|
4931 |
|
4932 |
|
4933 |
|
4934 |
|
4935 | var ANONYMOUS = '<<anonymous>>';
|
4936 |
|
4937 |
|
4938 |
|
4939 | var ReactPropTypes = {
|
4940 | array: createPrimitiveTypeChecker('array'),
|
4941 | bool: createPrimitiveTypeChecker('boolean'),
|
4942 | func: createPrimitiveTypeChecker('function'),
|
4943 | number: createPrimitiveTypeChecker('number'),
|
4944 | object: createPrimitiveTypeChecker('object'),
|
4945 | string: createPrimitiveTypeChecker('string'),
|
4946 | symbol: createPrimitiveTypeChecker('symbol'),
|
4947 |
|
4948 | any: createAnyTypeChecker(),
|
4949 | arrayOf: createArrayOfTypeChecker,
|
4950 | element: createElementTypeChecker(),
|
4951 | elementType: createElementTypeTypeChecker(),
|
4952 | instanceOf: createInstanceTypeChecker,
|
4953 | node: createNodeChecker(),
|
4954 | objectOf: createObjectOfTypeChecker,
|
4955 | oneOf: createEnumTypeChecker,
|
4956 | oneOfType: createUnionTypeChecker,
|
4957 | shape: createShapeTypeChecker,
|
4958 | exact: createStrictShapeTypeChecker,
|
4959 | };
|
4960 |
|
4961 | |
4962 |
|
4963 |
|
4964 |
|
4965 |
|
4966 | function is(x, y) {
|
4967 |
|
4968 | if (x === y) {
|
4969 |
|
4970 |
|
4971 | return x !== 0 || 1 / x === 1 / y;
|
4972 | } else {
|
4973 |
|
4974 | return x !== x && y !== y;
|
4975 | }
|
4976 | }
|
4977 |
|
4978 |
|
4979 | |
4980 |
|
4981 |
|
4982 |
|
4983 |
|
4984 |
|
4985 |
|
4986 | function PropTypeError(message) {
|
4987 | this.message = message;
|
4988 | this.stack = '';
|
4989 | }
|
4990 |
|
4991 | PropTypeError.prototype = Error.prototype;
|
4992 |
|
4993 | function createChainableTypeChecker(validate) {
|
4994 | if (process.env.NODE_ENV !== 'production') {
|
4995 | var manualPropTypeCallCache = {};
|
4996 | var manualPropTypeWarningCount = 0;
|
4997 | }
|
4998 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
4999 | componentName = componentName || ANONYMOUS;
|
5000 | propFullName = propFullName || propName;
|
5001 |
|
5002 | if (secret !== ReactPropTypesSecret) {
|
5003 | if (throwOnDirectAccess) {
|
5004 |
|
5005 | var err = new Error(
|
5006 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
5007 | 'Use `PropTypes.checkPropTypes()` to call them. ' +
|
5008 | 'Read more at http://fb.me/use-check-prop-types'
|
5009 | );
|
5010 | err.name = 'Invariant Violation';
|
5011 | throw err;
|
5012 | } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
5013 |
|
5014 | var cacheKey = componentName + ':' + propName;
|
5015 | if (
|
5016 | !manualPropTypeCallCache[cacheKey] &&
|
5017 |
|
5018 | manualPropTypeWarningCount < 3
|
5019 | ) {
|
5020 | printWarning(
|
5021 | 'You are manually calling a React.PropTypes validation ' +
|
5022 | 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
5023 | 'and will throw in the standalone `prop-types` package. ' +
|
5024 | 'You may be seeing this warning due to a third-party PropTypes ' +
|
5025 | 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
5026 | );
|
5027 | manualPropTypeCallCache[cacheKey] = true;
|
5028 | manualPropTypeWarningCount++;
|
5029 | }
|
5030 | }
|
5031 | }
|
5032 | if (props[propName] == null) {
|
5033 | if (isRequired) {
|
5034 | if (props[propName] === null) {
|
5035 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
5036 | }
|
5037 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
5038 | }
|
5039 | return null;
|
5040 | } else {
|
5041 | return validate(props, propName, componentName, location, propFullName);
|
5042 | }
|
5043 | }
|
5044 |
|
5045 | var chainedCheckType = checkType.bind(null, false);
|
5046 | chainedCheckType.isRequired = checkType.bind(null, true);
|
5047 |
|
5048 | return chainedCheckType;
|
5049 | }
|
5050 |
|
5051 | function createPrimitiveTypeChecker(expectedType) {
|
5052 | function validate(props, propName, componentName, location, propFullName, secret) {
|
5053 | var propValue = props[propName];
|
5054 | var propType = getPropType(propValue);
|
5055 | if (propType !== expectedType) {
|
5056 |
|
5057 |
|
5058 |
|
5059 | var preciseType = getPreciseType(propValue);
|
5060 |
|
5061 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
5062 | }
|
5063 | return null;
|
5064 | }
|
5065 | return createChainableTypeChecker(validate);
|
5066 | }
|
5067 |
|
5068 | function createAnyTypeChecker() {
|
5069 | return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
5070 | }
|
5071 |
|
5072 | function createArrayOfTypeChecker(typeChecker) {
|
5073 | function validate(props, propName, componentName, location, propFullName) {
|
5074 | if (typeof typeChecker !== 'function') {
|
5075 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
5076 | }
|
5077 | var propValue = props[propName];
|
5078 | if (!Array.isArray(propValue)) {
|
5079 | var propType = getPropType(propValue);
|
5080 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
5081 | }
|
5082 | for (var i = 0; i < propValue.length; i++) {
|
5083 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
5084 | if (error instanceof Error) {
|
5085 | return error;
|
5086 | }
|
5087 | }
|
5088 | return null;
|
5089 | }
|
5090 | return createChainableTypeChecker(validate);
|
5091 | }
|
5092 |
|
5093 | function createElementTypeChecker() {
|
5094 | function validate(props, propName, componentName, location, propFullName) {
|
5095 | var propValue = props[propName];
|
5096 | if (!isValidElement(propValue)) {
|
5097 | var propType = getPropType(propValue);
|
5098 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
5099 | }
|
5100 | return null;
|
5101 | }
|
5102 | return createChainableTypeChecker(validate);
|
5103 | }
|
5104 |
|
5105 | function createElementTypeTypeChecker() {
|
5106 | function validate(props, propName, componentName, location, propFullName) {
|
5107 | var propValue = props[propName];
|
5108 | if (!ReactIs.isValidElementType(propValue)) {
|
5109 | var propType = getPropType(propValue);
|
5110 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
5111 | }
|
5112 | return null;
|
5113 | }
|
5114 | return createChainableTypeChecker(validate);
|
5115 | }
|
5116 |
|
5117 | function createInstanceTypeChecker(expectedClass) {
|
5118 | function validate(props, propName, componentName, location, propFullName) {
|
5119 | if (!(props[propName] instanceof expectedClass)) {
|
5120 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
5121 | var actualClassName = getClassName(props[propName]);
|
5122 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
5123 | }
|
5124 | return null;
|
5125 | }
|
5126 | return createChainableTypeChecker(validate);
|
5127 | }
|
5128 |
|
5129 | function createEnumTypeChecker(expectedValues) {
|
5130 | if (!Array.isArray(expectedValues)) {
|
5131 | if (process.env.NODE_ENV !== 'production') {
|
5132 | if (arguments.length > 1) {
|
5133 | printWarning(
|
5134 | 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
5135 | 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
5136 | );
|
5137 | } else {
|
5138 | printWarning('Invalid argument supplied to oneOf, expected an array.');
|
5139 | }
|
5140 | }
|
5141 | return emptyFunctionThatReturnsNull;
|
5142 | }
|
5143 |
|
5144 | function validate(props, propName, componentName, location, propFullName) {
|
5145 | var propValue = props[propName];
|
5146 | for (var i = 0; i < expectedValues.length; i++) {
|
5147 | if (is(propValue, expectedValues[i])) {
|
5148 | return null;
|
5149 | }
|
5150 | }
|
5151 |
|
5152 | var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
5153 | var type = getPreciseType(value);
|
5154 | if (type === 'symbol') {
|
5155 | return String(value);
|
5156 | }
|
5157 | return value;
|
5158 | });
|
5159 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
5160 | }
|
5161 | return createChainableTypeChecker(validate);
|
5162 | }
|
5163 |
|
5164 | function createObjectOfTypeChecker(typeChecker) {
|
5165 | function validate(props, propName, componentName, location, propFullName) {
|
5166 | if (typeof typeChecker !== 'function') {
|
5167 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
5168 | }
|
5169 | var propValue = props[propName];
|
5170 | var propType = getPropType(propValue);
|
5171 | if (propType !== 'object') {
|
5172 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
5173 | }
|
5174 | for (var key in propValue) {
|
5175 | if (has(propValue, key)) {
|
5176 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
5177 | if (error instanceof Error) {
|
5178 | return error;
|
5179 | }
|
5180 | }
|
5181 | }
|
5182 | return null;
|
5183 | }
|
5184 | return createChainableTypeChecker(validate);
|
5185 | }
|
5186 |
|
5187 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
5188 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
5189 | process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
5190 | return emptyFunctionThatReturnsNull;
|
5191 | }
|
5192 |
|
5193 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
5194 | var checker = arrayOfTypeCheckers[i];
|
5195 | if (typeof checker !== 'function') {
|
5196 | printWarning(
|
5197 | 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
5198 | 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
5199 | );
|
5200 | return emptyFunctionThatReturnsNull;
|
5201 | }
|
5202 | }
|
5203 |
|
5204 | function validate(props, propName, componentName, location, propFullName) {
|
5205 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
5206 | var checker = arrayOfTypeCheckers[i];
|
5207 | if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
5208 | return null;
|
5209 | }
|
5210 | }
|
5211 |
|
5212 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
5213 | }
|
5214 | return createChainableTypeChecker(validate);
|
5215 | }
|
5216 |
|
5217 | function createNodeChecker() {
|
5218 | function validate(props, propName, componentName, location, propFullName) {
|
5219 | if (!isNode(props[propName])) {
|
5220 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
5221 | }
|
5222 | return null;
|
5223 | }
|
5224 | return createChainableTypeChecker(validate);
|
5225 | }
|
5226 |
|
5227 | function createShapeTypeChecker(shapeTypes) {
|
5228 | function validate(props, propName, componentName, location, propFullName) {
|
5229 | var propValue = props[propName];
|
5230 | var propType = getPropType(propValue);
|
5231 | if (propType !== 'object') {
|
5232 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
5233 | }
|
5234 | for (var key in shapeTypes) {
|
5235 | var checker = shapeTypes[key];
|
5236 | if (!checker) {
|
5237 | continue;
|
5238 | }
|
5239 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
5240 | if (error) {
|
5241 | return error;
|
5242 | }
|
5243 | }
|
5244 | return null;
|
5245 | }
|
5246 | return createChainableTypeChecker(validate);
|
5247 | }
|
5248 |
|
5249 | function createStrictShapeTypeChecker(shapeTypes) {
|
5250 | function validate(props, propName, componentName, location, propFullName) {
|
5251 | var propValue = props[propName];
|
5252 | var propType = getPropType(propValue);
|
5253 | if (propType !== 'object') {
|
5254 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
5255 | }
|
5256 |
|
5257 |
|
5258 | var allKeys = assign({}, props[propName], shapeTypes);
|
5259 | for (var key in allKeys) {
|
5260 | var checker = shapeTypes[key];
|
5261 | if (!checker) {
|
5262 | return new PropTypeError(
|
5263 | 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
5264 | '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
5265 | '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
5266 | );
|
5267 | }
|
5268 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
5269 | if (error) {
|
5270 | return error;
|
5271 | }
|
5272 | }
|
5273 | return null;
|
5274 | }
|
5275 |
|
5276 | return createChainableTypeChecker(validate);
|
5277 | }
|
5278 |
|
5279 | function isNode(propValue) {
|
5280 | switch (typeof propValue) {
|
5281 | case 'number':
|
5282 | case 'string':
|
5283 | case 'undefined':
|
5284 | return true;
|
5285 | case 'boolean':
|
5286 | return !propValue;
|
5287 | case 'object':
|
5288 | if (Array.isArray(propValue)) {
|
5289 | return propValue.every(isNode);
|
5290 | }
|
5291 | if (propValue === null || isValidElement(propValue)) {
|
5292 | return true;
|
5293 | }
|
5294 |
|
5295 | var iteratorFn = getIteratorFn(propValue);
|
5296 | if (iteratorFn) {
|
5297 | var iterator = iteratorFn.call(propValue);
|
5298 | var step;
|
5299 | if (iteratorFn !== propValue.entries) {
|
5300 | while (!(step = iterator.next()).done) {
|
5301 | if (!isNode(step.value)) {
|
5302 | return false;
|
5303 | }
|
5304 | }
|
5305 | } else {
|
5306 |
|
5307 | while (!(step = iterator.next()).done) {
|
5308 | var entry = step.value;
|
5309 | if (entry) {
|
5310 | if (!isNode(entry[1])) {
|
5311 | return false;
|
5312 | }
|
5313 | }
|
5314 | }
|
5315 | }
|
5316 | } else {
|
5317 | return false;
|
5318 | }
|
5319 |
|
5320 | return true;
|
5321 | default:
|
5322 | return false;
|
5323 | }
|
5324 | }
|
5325 |
|
5326 | function isSymbol(propType, propValue) {
|
5327 |
|
5328 | if (propType === 'symbol') {
|
5329 | return true;
|
5330 | }
|
5331 |
|
5332 |
|
5333 | if (!propValue) {
|
5334 | return false;
|
5335 | }
|
5336 |
|
5337 |
|
5338 | if (propValue['@@toStringTag'] === 'Symbol') {
|
5339 | return true;
|
5340 | }
|
5341 |
|
5342 |
|
5343 | if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
5344 | return true;
|
5345 | }
|
5346 |
|
5347 | return false;
|
5348 | }
|
5349 |
|
5350 |
|
5351 | function getPropType(propValue) {
|
5352 | var propType = typeof propValue;
|
5353 | if (Array.isArray(propValue)) {
|
5354 | return 'array';
|
5355 | }
|
5356 | if (propValue instanceof RegExp) {
|
5357 |
|
5358 |
|
5359 |
|
5360 | return 'object';
|
5361 | }
|
5362 | if (isSymbol(propType, propValue)) {
|
5363 | return 'symbol';
|
5364 | }
|
5365 | return propType;
|
5366 | }
|
5367 |
|
5368 |
|
5369 |
|
5370 | function getPreciseType(propValue) {
|
5371 | if (typeof propValue === 'undefined' || propValue === null) {
|
5372 | return '' + propValue;
|
5373 | }
|
5374 | var propType = getPropType(propValue);
|
5375 | if (propType === 'object') {
|
5376 | if (propValue instanceof Date) {
|
5377 | return 'date';
|
5378 | } else if (propValue instanceof RegExp) {
|
5379 | return 'regexp';
|
5380 | }
|
5381 | }
|
5382 | return propType;
|
5383 | }
|
5384 |
|
5385 |
|
5386 |
|
5387 | function getPostfixForTypeWarning(value) {
|
5388 | var type = getPreciseType(value);
|
5389 | switch (type) {
|
5390 | case 'array':
|
5391 | case 'object':
|
5392 | return 'an ' + type;
|
5393 | case 'boolean':
|
5394 | case 'date':
|
5395 | case 'regexp':
|
5396 | return 'a ' + type;
|
5397 | default:
|
5398 | return type;
|
5399 | }
|
5400 | }
|
5401 |
|
5402 |
|
5403 | function getClassName(propValue) {
|
5404 | if (!propValue.constructor || !propValue.constructor.name) {
|
5405 | return ANONYMOUS;
|
5406 | }
|
5407 | return propValue.constructor.name;
|
5408 | }
|
5409 |
|
5410 | ReactPropTypes.checkPropTypes = checkPropTypes;
|
5411 | ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
5412 | ReactPropTypes.PropTypes = ReactPropTypes;
|
5413 |
|
5414 | return ReactPropTypes;
|
5415 | };
|
5416 |
|
5417 | }.call(exports, __webpack_require__(0)))
|
5418 |
|
5419 | }),
|
5420 |
|
5421 | (function(module, exports, __webpack_require__) {
|
5422 |
|
5423 | "use strict";
|
5424 |
|
5425 |
|
5426 |
|
5427 |
|
5428 |
|
5429 |
|
5430 |
|
5431 |
|
5432 |
|
5433 | var ReactPropTypesSecret = __webpack_require__(6);
|
5434 |
|
5435 | function emptyFunction() {}
|
5436 | function emptyFunctionWithReset() {}
|
5437 | emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
5438 |
|
5439 | module.exports = function() {
|
5440 | function shim(props, propName, componentName, location, propFullName, secret) {
|
5441 | if (secret === ReactPropTypesSecret) {
|
5442 |
|
5443 | return;
|
5444 | }
|
5445 | var err = new Error(
|
5446 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
5447 | 'Use PropTypes.checkPropTypes() to call them. ' +
|
5448 | 'Read more at http://fb.me/use-check-prop-types'
|
5449 | );
|
5450 | err.name = 'Invariant Violation';
|
5451 | throw err;
|
5452 | };
|
5453 | shim.isRequired = shim;
|
5454 | function getShim() {
|
5455 | return shim;
|
5456 | };
|
5457 |
|
5458 |
|
5459 | var ReactPropTypes = {
|
5460 | array: shim,
|
5461 | bool: shim,
|
5462 | func: shim,
|
5463 | number: shim,
|
5464 | object: shim,
|
5465 | string: shim,
|
5466 | symbol: shim,
|
5467 |
|
5468 | any: shim,
|
5469 | arrayOf: getShim,
|
5470 | element: shim,
|
5471 | elementType: shim,
|
5472 | instanceOf: getShim,
|
5473 | node: shim,
|
5474 | objectOf: getShim,
|
5475 | oneOf: getShim,
|
5476 | oneOfType: getShim,
|
5477 | shape: getShim,
|
5478 | exact: getShim,
|
5479 |
|
5480 | checkPropTypes: emptyFunctionWithReset,
|
5481 | resetWarningCache: emptyFunction
|
5482 | };
|
5483 |
|
5484 | ReactPropTypes.PropTypes = ReactPropTypes;
|
5485 |
|
5486 | return ReactPropTypes;
|
5487 | };
|
5488 |
|
5489 |
|
5490 | }),
|
5491 |
|
5492 | (function(module, __webpack_exports__, __webpack_require__) {
|
5493 |
|
5494 | "use strict";
|
5495 | __webpack_exports__["a"] = _extends;
|
5496 | function _extends() {
|
5497 | _extends = Object.assign || function (target) {
|
5498 | for (var i = 1; i < arguments.length; i++) {
|
5499 | var source = arguments[i];
|
5500 |
|
5501 | for (var key in source) {
|
5502 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
5503 | target[key] = source[key];
|
5504 | }
|
5505 | }
|
5506 | }
|
5507 |
|
5508 | return target;
|
5509 | };
|
5510 |
|
5511 | return _extends.apply(this, arguments);
|
5512 | }
|
5513 |
|
5514 | }),
|
5515 |
|
5516 | (function(module, __webpack_exports__, __webpack_require__) {
|
5517 |
|
5518 | "use strict";
|
5519 | function isAbsolute(pathname) {
|
5520 | return pathname.charAt(0) === '/';
|
5521 | }
|
5522 |
|
5523 |
|
5524 | function spliceOne(list, index) {
|
5525 | for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
5526 | list[i] = list[k];
|
5527 | }
|
5528 |
|
5529 | list.pop();
|
5530 | }
|
5531 |
|
5532 |
|
5533 | function resolvePathname(to) {
|
5534 | var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
5535 |
|
5536 | var toParts = to && to.split('/') || [];
|
5537 | var fromParts = from && from.split('/') || [];
|
5538 |
|
5539 | var isToAbs = to && isAbsolute(to);
|
5540 | var isFromAbs = from && isAbsolute(from);
|
5541 | var mustEndAbs = isToAbs || isFromAbs;
|
5542 |
|
5543 | if (to && isAbsolute(to)) {
|
5544 |
|
5545 | fromParts = toParts;
|
5546 | } else if (toParts.length) {
|
5547 |
|
5548 | fromParts.pop();
|
5549 | fromParts = fromParts.concat(toParts);
|
5550 | }
|
5551 |
|
5552 | if (!fromParts.length) return '/';
|
5553 |
|
5554 | var hasTrailingSlash = void 0;
|
5555 | if (fromParts.length) {
|
5556 | var last = fromParts[fromParts.length - 1];
|
5557 | hasTrailingSlash = last === '.' || last === '..' || last === '';
|
5558 | } else {
|
5559 | hasTrailingSlash = false;
|
5560 | }
|
5561 |
|
5562 | var up = 0;
|
5563 | for (var i = fromParts.length; i >= 0; i--) {
|
5564 | var part = fromParts[i];
|
5565 |
|
5566 | if (part === '.') {
|
5567 | spliceOne(fromParts, i);
|
5568 | } else if (part === '..') {
|
5569 | spliceOne(fromParts, i);
|
5570 | up++;
|
5571 | } else if (up) {
|
5572 | spliceOne(fromParts, i);
|
5573 | up--;
|
5574 | }
|
5575 | }
|
5576 |
|
5577 | if (!mustEndAbs) for (; up--; up) {
|
5578 | fromParts.unshift('..');
|
5579 | }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');
|
5580 |
|
5581 | var result = fromParts.join('/');
|
5582 |
|
5583 | if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
5584 |
|
5585 | return result;
|
5586 | }
|
5587 |
|
5588 | __webpack_exports__["a"] = (resolvePathname);
|
5589 |
|
5590 | }),
|
5591 |
|
5592 | (function(module, __webpack_exports__, __webpack_require__) {
|
5593 |
|
5594 | "use strict";
|
5595 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
5596 |
|
5597 | function valueEqual(a, b) {
|
5598 | if (a === b) return true;
|
5599 |
|
5600 | if (a == null || b == null) return false;
|
5601 |
|
5602 | if (Array.isArray(a)) {
|
5603 | return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
|
5604 | return valueEqual(item, b[index]);
|
5605 | });
|
5606 | }
|
5607 |
|
5608 | var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);
|
5609 | var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);
|
5610 |
|
5611 | if (aType !== bType) return false;
|
5612 |
|
5613 | if (aType === 'object') {
|
5614 | var aValue = a.valueOf();
|
5615 | var bValue = b.valueOf();
|
5616 |
|
5617 | if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
|
5618 |
|
5619 | var aKeys = Object.keys(a);
|
5620 | var bKeys = Object.keys(b);
|
5621 |
|
5622 | if (aKeys.length !== bKeys.length) return false;
|
5623 |
|
5624 | return aKeys.every(function (key) {
|
5625 | return valueEqual(a[key], b[key]);
|
5626 | });
|
5627 | }
|
5628 |
|
5629 | return false;
|
5630 | }
|
5631 |
|
5632 | __webpack_exports__["a"] = (valueEqual);
|
5633 |
|
5634 | }),
|
5635 |
|
5636 | (function(module, __webpack_exports__, __webpack_require__) {
|
5637 |
|
5638 | "use strict";
|
5639 | (function(process) {var isProduction = process.env.NODE_ENV === 'production';
|
5640 | function warning(condition, message) {
|
5641 | if (!isProduction) {
|
5642 | if (condition) {
|
5643 | return;
|
5644 | }
|
5645 |
|
5646 | var text = "Warning: " + message;
|
5647 |
|
5648 | if (typeof console !== 'undefined') {
|
5649 | console.warn(text);
|
5650 | }
|
5651 |
|
5652 | try {
|
5653 | throw Error(text);
|
5654 | } catch (x) {}
|
5655 | }
|
5656 | }
|
5657 |
|
5658 | __webpack_exports__["a"] = (warning);
|
5659 |
|
5660 | }.call(__webpack_exports__, __webpack_require__(0)))
|
5661 |
|
5662 | }),
|
5663 |
|
5664 | (function(module, __webpack_exports__, __webpack_require__) {
|
5665 |
|
5666 | "use strict";
|
5667 | (function(process) {var isProduction = process.env.NODE_ENV === 'production';
|
5668 | var prefix = 'Invariant failed';
|
5669 | function invariant(condition, message) {
|
5670 | if (condition) {
|
5671 | return;
|
5672 | }
|
5673 |
|
5674 | if (isProduction) {
|
5675 | throw new Error(prefix);
|
5676 | } else {
|
5677 | throw new Error(prefix + ": " + (message || ''));
|
5678 | }
|
5679 | }
|
5680 |
|
5681 | __webpack_exports__["a"] = (invariant);
|
5682 |
|
5683 | }.call(__webpack_exports__, __webpack_require__(0)))
|
5684 |
|
5685 | }),
|
5686 |
|
5687 | (function(module, __webpack_exports__, __webpack_require__) {
|
5688 |
|
5689 | "use strict";
|
5690 | var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
5691 | var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
5692 | var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
5693 | var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
5694 | var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(4);
|
5695 | var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
|
5696 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5697 |
|
5698 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5699 |
|
5700 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5701 |
|
5702 |
|
5703 |
|
5704 |
|
5705 |
|
5706 |
|
5707 |
|
5708 |
|
5709 |
|
5710 |
|
5711 | var Prompt = function (_React$Component) {
|
5712 | _inherits(Prompt, _React$Component);
|
5713 |
|
5714 | function Prompt() {
|
5715 | _classCallCheck(this, Prompt);
|
5716 |
|
5717 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
5718 | }
|
5719 |
|
5720 | Prompt.prototype.enable = function enable(message) {
|
5721 | if (this.unblock) this.unblock();
|
5722 |
|
5723 | this.unblock = this.context.router.history.block(message);
|
5724 | };
|
5725 |
|
5726 | Prompt.prototype.disable = function disable() {
|
5727 | if (this.unblock) {
|
5728 | this.unblock();
|
5729 | this.unblock = null;
|
5730 | }
|
5731 | };
|
5732 |
|
5733 | Prompt.prototype.componentWillMount = function componentWillMount() {
|
5734 | __WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, "You should not use <Prompt> outside a <Router>");
|
5735 |
|
5736 | if (this.props.when) this.enable(this.props.message);
|
5737 | };
|
5738 |
|
5739 | Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
5740 | if (nextProps.when) {
|
5741 | if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message);
|
5742 | } else {
|
5743 | this.disable();
|
5744 | }
|
5745 | };
|
5746 |
|
5747 | Prompt.prototype.componentWillUnmount = function componentWillUnmount() {
|
5748 | this.disable();
|
5749 | };
|
5750 |
|
5751 | Prompt.prototype.render = function render() {
|
5752 | return null;
|
5753 | };
|
5754 |
|
5755 | return Prompt;
|
5756 | }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
5757 |
|
5758 | Prompt.propTypes = {
|
5759 | when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
|
5760 | message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired
|
5761 | };
|
5762 | Prompt.defaultProps = {
|
5763 | when: true
|
5764 | };
|
5765 | Prompt.contextTypes = {
|
5766 | router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
5767 | history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
5768 | block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
5769 | }).isRequired
|
5770 | }).isRequired
|
5771 | };
|
5772 |
|
5773 |
|
5774 | __webpack_exports__["a"] = (Prompt);
|
5775 |
|
5776 | }),
|
5777 |
|
5778 | (function(module, __webpack_exports__, __webpack_require__) {
|
5779 |
|
5780 | "use strict";
|
5781 | var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
5782 | var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
5783 | var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
5784 | var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
5785 | var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(3);
|
5786 | var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__);
|
5787 | var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(4);
|
5788 | var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__);
|
5789 | var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(7);
|
5790 | var __WEBPACK_IMPORTED_MODULE_5__generatePath__ = __webpack_require__(12);
|
5791 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
5792 |
|
5793 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5794 |
|
5795 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5796 |
|
5797 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5798 |
|
5799 |
|
5800 |
|
5801 |
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 | var Redirect = function (_React$Component) {
|
5812 | _inherits(Redirect, _React$Component);
|
5813 |
|
5814 | function Redirect() {
|
5815 | _classCallCheck(this, Redirect);
|
5816 |
|
5817 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
5818 | }
|
5819 |
|
5820 | Redirect.prototype.isStatic = function isStatic() {
|
5821 | return this.context.router && this.context.router.staticContext;
|
5822 | };
|
5823 |
|
5824 | Redirect.prototype.componentWillMount = function componentWillMount() {
|
5825 | __WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, "You should not use <Redirect> outside a <Router>");
|
5826 |
|
5827 | if (this.isStatic()) this.perform();
|
5828 | };
|
5829 |
|
5830 | Redirect.prototype.componentDidMount = function componentDidMount() {
|
5831 | if (!this.isStatic()) this.perform();
|
5832 | };
|
5833 |
|
5834 | Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) {
|
5835 | var prevTo = Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" ])(prevProps.to);
|
5836 | var nextTo = Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" ])(this.props.to);
|
5837 |
|
5838 | if (Object(__WEBPACK_IMPORTED_MODULE_4_history__["d" ])(prevTo, nextTo)) {
|
5839 | __WEBPACK_IMPORTED_MODULE_2_warning___default()(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
|
5840 | return;
|
5841 | }
|
5842 |
|
5843 | this.perform();
|
5844 | };
|
5845 |
|
5846 | Redirect.prototype.computeTo = function computeTo(_ref) {
|
5847 | var computedMatch = _ref.computedMatch,
|
5848 | to = _ref.to;
|
5849 |
|
5850 | if (computedMatch) {
|
5851 | if (typeof to === "string") {
|
5852 | return Object(__WEBPACK_IMPORTED_MODULE_5__generatePath__["a" ])(to, computedMatch.params);
|
5853 | } else {
|
5854 | return _extends({}, to, {
|
5855 | pathname: Object(__WEBPACK_IMPORTED_MODULE_5__generatePath__["a" ])(to.pathname, computedMatch.params)
|
5856 | });
|
5857 | }
|
5858 | }
|
5859 |
|
5860 | return to;
|
5861 | };
|
5862 |
|
5863 | Redirect.prototype.perform = function perform() {
|
5864 | var history = this.context.router.history;
|
5865 | var push = this.props.push;
|
5866 |
|
5867 | var to = this.computeTo(this.props);
|
5868 |
|
5869 | if (push) {
|
5870 | history.push(to);
|
5871 | } else {
|
5872 | history.replace(to);
|
5873 | }
|
5874 | };
|
5875 |
|
5876 | Redirect.prototype.render = function render() {
|
5877 | return null;
|
5878 | };
|
5879 |
|
5880 | return Redirect;
|
5881 | }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
5882 |
|
5883 | Redirect.propTypes = {
|
5884 | computedMatch: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object,
|
5885 | push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
|
5886 | from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
|
5887 | to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired
|
5888 | };
|
5889 | Redirect.defaultProps = {
|
5890 | push: false
|
5891 | };
|
5892 | Redirect.contextTypes = {
|
5893 | router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
5894 | history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
5895 | push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
|
5896 | replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
|
5897 | }).isRequired,
|
5898 | staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
|
5899 | }).isRequired
|
5900 | };
|
5901 |
|
5902 |
|
5903 | __webpack_exports__["a"] = (Redirect);
|
5904 |
|
5905 | }),
|
5906 |
|
5907 | (function(module, exports) {
|
5908 |
|
5909 | module.exports = Array.isArray || function (arr) {
|
5910 | return Object.prototype.toString.call(arr) == '[object Array]';
|
5911 | };
|
5912 |
|
5913 |
|
5914 | }),
|
5915 |
|
5916 | (function(module, __webpack_exports__, __webpack_require__) {
|
5917 |
|
5918 | "use strict";
|
5919 | var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(3);
|
5920 | var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__);
|
5921 | var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4);
|
5922 | var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
|
5923 | var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(1);
|
5924 | var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
|
5925 | var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
|
5926 | var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
|
5927 | var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(7);
|
5928 | var __WEBPACK_IMPORTED_MODULE_5__Router__ = __webpack_require__(8);
|
5929 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
5930 |
|
5931 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
5932 |
|
5933 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5934 |
|
5935 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
5936 |
|
5937 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
5938 |
|
5939 |
|
5940 |
|
5941 |
|
5942 |
|
5943 |
|
5944 |
|
5945 |
|
5946 | var addLeadingSlash = function addLeadingSlash(path) {
|
5947 | return path.charAt(0) === "/" ? path : "/" + path;
|
5948 | };
|
5949 |
|
5950 | var addBasename = function addBasename(basename, location) {
|
5951 | if (!basename) return location;
|
5952 |
|
5953 | return _extends({}, location, {
|
5954 | pathname: addLeadingSlash(basename) + location.pathname
|
5955 | });
|
5956 | };
|
5957 |
|
5958 | var stripBasename = function stripBasename(basename, location) {
|
5959 | if (!basename) return location;
|
5960 |
|
5961 | var base = addLeadingSlash(basename);
|
5962 |
|
5963 | if (location.pathname.indexOf(base) !== 0) return location;
|
5964 |
|
5965 | return _extends({}, location, {
|
5966 | pathname: location.pathname.substr(base.length)
|
5967 | });
|
5968 | };
|
5969 |
|
5970 | var createURL = function createURL(location) {
|
5971 | return typeof location === "string" ? location : Object(__WEBPACK_IMPORTED_MODULE_4_history__["c" ])(location);
|
5972 | };
|
5973 |
|
5974 | var staticHandler = function staticHandler(methodName) {
|
5975 | return function () {
|
5976 | __WEBPACK_IMPORTED_MODULE_1_invariant___default()(false, "You cannot %s with <StaticRouter>", methodName);
|
5977 | };
|
5978 | };
|
5979 |
|
5980 | var noop = function noop() {};
|
5981 |
|
5982 |
|
5983 |
|
5984 |
|
5985 |
|
5986 |
|
5987 |
|
5988 |
|
5989 | var StaticRouter = function (_React$Component) {
|
5990 | _inherits(StaticRouter, _React$Component);
|
5991 |
|
5992 | function StaticRouter() {
|
5993 | var _temp, _this, _ret;
|
5994 |
|
5995 | _classCallCheck(this, StaticRouter);
|
5996 |
|
5997 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
5998 | args[_key] = arguments[_key];
|
5999 | }
|
6000 |
|
6001 | return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
|
6002 | return addLeadingSlash(_this.props.basename + createURL(path));
|
6003 | }, _this.handlePush = function (location) {
|
6004 | var _this$props = _this.props,
|
6005 | basename = _this$props.basename,
|
6006 | context = _this$props.context;
|
6007 |
|
6008 | context.action = "PUSH";
|
6009 | context.location = addBasename(basename, Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" ])(location));
|
6010 | context.url = createURL(context.location);
|
6011 | }, _this.handleReplace = function (location) {
|
6012 | var _this$props2 = _this.props,
|
6013 | basename = _this$props2.basename,
|
6014 | context = _this$props2.context;
|
6015 |
|
6016 | context.action = "REPLACE";
|
6017 | context.location = addBasename(basename, Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" ])(location));
|
6018 | context.url = createURL(context.location);
|
6019 | }, _this.handleListen = function () {
|
6020 | return noop;
|
6021 | }, _this.handleBlock = function () {
|
6022 | return noop;
|
6023 | }, _temp), _possibleConstructorReturn(_this, _ret);
|
6024 | }
|
6025 |
|
6026 | StaticRouter.prototype.getChildContext = function getChildContext() {
|
6027 | return {
|
6028 | router: {
|
6029 | staticContext: this.props.context
|
6030 | }
|
6031 | };
|
6032 | };
|
6033 |
|
6034 | StaticRouter.prototype.componentWillMount = function componentWillMount() {
|
6035 | __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
|
6036 | };
|
6037 |
|
6038 | StaticRouter.prototype.render = function render() {
|
6039 | var _props = this.props,
|
6040 | basename = _props.basename,
|
6041 | context = _props.context,
|
6042 | location = _props.location,
|
6043 | props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
|
6044 |
|
6045 | var history = {
|
6046 | createHref: this.createHref,
|
6047 | action: "POP",
|
6048 | location: stripBasename(basename, Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" ])(location)),
|
6049 | push: this.handlePush,
|
6050 | replace: this.handleReplace,
|
6051 | go: staticHandler("go"),
|
6052 | goBack: staticHandler("goBack"),
|
6053 | goForward: staticHandler("goForward"),
|
6054 | listen: this.handleListen,
|
6055 | block: this.handleBlock
|
6056 | };
|
6057 |
|
6058 | return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__Router__["a" ], _extends({}, props, { history: history }));
|
6059 | };
|
6060 |
|
6061 | return StaticRouter;
|
6062 | }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
|
6063 |
|
6064 | StaticRouter.propTypes = {
|
6065 | basename: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
|
6066 | context: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
|
6067 | location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object])
|
6068 | };
|
6069 | StaticRouter.defaultProps = {
|
6070 | basename: "",
|
6071 | location: "/"
|
6072 | };
|
6073 | StaticRouter.childContextTypes = {
|
6074 | router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
|
6075 | };
|
6076 |
|
6077 |
|
6078 | __webpack_exports__["a"] = (StaticRouter);
|
6079 |
|
6080 | }),
|
6081 |
|
6082 | (function(module, __webpack_exports__, __webpack_require__) {
|
6083 |
|
6084 | "use strict";
|
6085 | var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
6086 | var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
6087 | var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
6088 | var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
6089 | var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(3);
|
6090 | var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__);
|
6091 | var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(4);
|
6092 | var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__);
|
6093 | var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(9);
|
6094 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6095 |
|
6096 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
6097 |
|
6098 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
6099 |
|
6100 |
|
6101 |
|
6102 |
|
6103 |
|
6104 |
|
6105 |
|
6106 |
|
6107 |
|
6108 |
|
6109 |
|
6110 | var Switch = function (_React$Component) {
|
6111 | _inherits(Switch, _React$Component);
|
6112 |
|
6113 | function Switch() {
|
6114 | _classCallCheck(this, Switch);
|
6115 |
|
6116 | return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
|
6117 | }
|
6118 |
|
6119 | Switch.prototype.componentWillMount = function componentWillMount() {
|
6120 | __WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, "You should not use <Switch> outside a <Router>");
|
6121 | };
|
6122 |
|
6123 | Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
6124 | __WEBPACK_IMPORTED_MODULE_2_warning___default()(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
|
6125 |
|
6126 | __WEBPACK_IMPORTED_MODULE_2_warning___default()(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
|
6127 | };
|
6128 |
|
6129 | Switch.prototype.render = function render() {
|
6130 | var route = this.context.router.route;
|
6131 | var children = this.props.children;
|
6132 |
|
6133 | var location = this.props.location || route.location;
|
6134 |
|
6135 | var match = void 0,
|
6136 | child = void 0;
|
6137 | __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (element) {
|
6138 | if (match == null && __WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(element)) {
|
6139 | var _element$props = element.props,
|
6140 | pathProp = _element$props.path,
|
6141 | exact = _element$props.exact,
|
6142 | strict = _element$props.strict,
|
6143 | sensitive = _element$props.sensitive,
|
6144 | from = _element$props.from;
|
6145 |
|
6146 | var path = pathProp || from;
|
6147 |
|
6148 | child = element;
|
6149 | match = Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" ])(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
|
6150 | }
|
6151 | });
|
6152 |
|
6153 | return match ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, { location: location, computedMatch: match }) : null;
|
6154 | };
|
6155 |
|
6156 | return Switch;
|
6157 | }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
|
6158 |
|
6159 | Switch.contextTypes = {
|
6160 | router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
|
6161 | route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired
|
6162 | }).isRequired
|
6163 | };
|
6164 | Switch.propTypes = {
|
6165 | children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node,
|
6166 | location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object
|
6167 | };
|
6168 |
|
6169 |
|
6170 | __webpack_exports__["a"] = (Switch);
|
6171 |
|
6172 | }),
|
6173 |
|
6174 | (function(module, __webpack_exports__, __webpack_require__) {
|
6175 |
|
6176 | "use strict";
|
6177 | var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1);
|
6178 | var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
|
6179 | var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(2);
|
6180 | var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__);
|
6181 | var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(36);
|
6182 | var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__);
|
6183 | var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(14);
|
6184 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
6185 |
|
6186 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
6187 |
|
6188 |
|
6189 |
|
6190 |
|
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 | var withRouter = function withRouter(Component) {
|
6197 | var C = function C(props) {
|
6198 | var wrappedComponentRef = props.wrappedComponentRef,
|
6199 | remainingProps = _objectWithoutProperties(props, ["wrappedComponentRef"]);
|
6200 |
|
6201 | return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" ], {
|
6202 | children: function children(routeComponentProps) {
|
6203 | return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component, _extends({}, remainingProps, routeComponentProps, {
|
6204 | ref: wrappedComponentRef
|
6205 | }));
|
6206 | }
|
6207 | });
|
6208 | };
|
6209 |
|
6210 | C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
6211 | C.WrappedComponent = Component;
|
6212 | C.propTypes = {
|
6213 | wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func
|
6214 | };
|
6215 |
|
6216 | return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(C, Component);
|
6217 | };
|
6218 |
|
6219 | __webpack_exports__["a"] = (withRouter);
|
6220 |
|
6221 | }),
|
6222 |
|
6223 | (function(module, exports, __webpack_require__) {
|
6224 |
|
6225 | "use strict";
|
6226 |
|
6227 |
|
6228 |
|
6229 |
|
6230 |
|
6231 |
|
6232 | var REACT_STATICS = {
|
6233 | childContextTypes: true,
|
6234 | contextTypes: true,
|
6235 | defaultProps: true,
|
6236 | displayName: true,
|
6237 | getDefaultProps: true,
|
6238 | getDerivedStateFromProps: true,
|
6239 | mixins: true,
|
6240 | propTypes: true,
|
6241 | type: true
|
6242 | };
|
6243 |
|
6244 | var KNOWN_STATICS = {
|
6245 | name: true,
|
6246 | length: true,
|
6247 | prototype: true,
|
6248 | caller: true,
|
6249 | callee: true,
|
6250 | arguments: true,
|
6251 | arity: true
|
6252 | };
|
6253 |
|
6254 | var defineProperty = Object.defineProperty;
|
6255 | var getOwnPropertyNames = Object.getOwnPropertyNames;
|
6256 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
6257 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
6258 | var getPrototypeOf = Object.getPrototypeOf;
|
6259 | var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
6260 |
|
6261 | function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
6262 | if (typeof sourceComponent !== 'string') {
|
6263 |
|
6264 | if (objectPrototype) {
|
6265 | var inheritedComponent = getPrototypeOf(sourceComponent);
|
6266 | if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
6267 | hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
6268 | }
|
6269 | }
|
6270 |
|
6271 | var keys = getOwnPropertyNames(sourceComponent);
|
6272 |
|
6273 | if (getOwnPropertySymbols) {
|
6274 | keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
6275 | }
|
6276 |
|
6277 | for (var i = 0; i < keys.length; ++i) {
|
6278 | var key = keys[i];
|
6279 | if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
6280 | var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
6281 | try {
|
6282 | defineProperty(targetComponent, key, descriptor);
|
6283 | } catch (e) {}
|
6284 | }
|
6285 | }
|
6286 |
|
6287 | return targetComponent;
|
6288 | }
|
6289 |
|
6290 | return targetComponent;
|
6291 | }
|
6292 |
|
6293 | module.exports = hoistNonReactStatics;
|
6294 |
|
6295 |
|
6296 | }),
|
6297 |
|
6298 | (function(module, exports, __webpack_require__) {
|
6299 |
|
6300 | "use strict";
|
6301 |
|
6302 |
|
6303 | Object.defineProperty(exports, "__esModule", {
|
6304 | value: true
|
6305 | });
|
6306 |
|
6307 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
6308 |
|
6309 | var _react = __webpack_require__(1);
|
6310 |
|
6311 | var _react2 = _interopRequireDefault(_react);
|
6312 |
|
6313 | var _propTypes = __webpack_require__(2);
|
6314 |
|
6315 | var _propTypes2 = _interopRequireDefault(_propTypes);
|
6316 |
|
6317 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
6318 |
|
6319 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
6320 |
|
6321 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
6322 |
|
6323 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
6324 |
|
6325 | var HigherComponent = function (_React$Component) {
|
6326 | _inherits(HigherComponent, _React$Component);
|
6327 |
|
6328 | function HigherComponent() {
|
6329 | _classCallCheck(this, HigherComponent);
|
6330 |
|
6331 | return _possibleConstructorReturn(this, (HigherComponent.__proto__ || Object.getPrototypeOf(HigherComponent)).apply(this, arguments));
|
6332 | }
|
6333 |
|
6334 | _createClass(HigherComponent, [{
|
6335 | key: 'componentDidMount',
|
6336 | value: function componentDidMount() {
|
6337 | this.props.onEnter(this.props.routerProps);
|
6338 | }
|
6339 | }, {
|
6340 | key: 'componentWillReceiveProps',
|
6341 | value: function componentWillReceiveProps(nextProps) {
|
6342 | var _props$routerProps = this.props.routerProps,
|
6343 | location = _props$routerProps.location,
|
6344 | match = _props$routerProps.match;
|
6345 | var _nextProps$routerProp = nextProps.routerProps,
|
6346 | nextLocation = _nextProps$routerProp.location,
|
6347 | nextMatch = _nextProps$routerProp.match;
|
6348 |
|
6349 | if (match.path !== nextMatch.path) {
|
6350 | nextProps.onEnter(nextProps.routerProps);
|
6351 | } else if (location !== nextLocation) {
|
6352 | this.props.onChange(nextProps.routerProps, this.props.routerProps);
|
6353 | }
|
6354 | }
|
6355 | }, {
|
6356 | key: 'componentWillUnmount',
|
6357 | value: function componentWillUnmount() {
|
6358 | this.props.onLeave(this.props.routerProps);
|
6359 | }
|
6360 | }, {
|
6361 | key: 'render',
|
6362 | value: function render() {
|
6363 | var _props = this.props,
|
6364 | Component = _props.component,
|
6365 | Render = _props.render,
|
6366 | routerProps = _props.routerProps;
|
6367 |
|
6368 | if (Component) return _react2.default.createElement(Component, routerProps);
|
6369 | return _react2.default.createElement(Render, routerProps);
|
6370 | }
|
6371 | }]);
|
6372 |
|
6373 | return HigherComponent;
|
6374 | }(_react2.default.Component);
|
6375 |
|
6376 | exports.default = HigherComponent;
|
6377 |
|
6378 |
|
6379 | HigherComponent.propTypes = {
|
6380 | component: _propTypes2.default.func,
|
6381 | render: _propTypes2.default.func,
|
6382 | onEnter: _propTypes2.default.func,
|
6383 | routerProps: _propTypes2.default.shape({
|
6384 | match: _propTypes2.default.object,
|
6385 | history: _propTypes2.default.object,
|
6386 | location: _propTypes2.default.object
|
6387 | }).isRequired,
|
6388 | onChange: _propTypes2.default.func,
|
6389 | onLeave: _propTypes2.default.func
|
6390 | };
|
6391 |
|
6392 | HigherComponent.defaultProps = {
|
6393 | component: null,
|
6394 | render: null,
|
6395 | onEnter: function onEnter() {},
|
6396 | onChange: function onChange() {},
|
6397 | onLeave: function onLeave() {}
|
6398 | };
|
6399 |
|
6400 | })
|
6401 | ]);
|
6402 | });
|
6403 |
|
\ | No newline at end of file |