1 | 'use strict';
|
2 |
|
3 | var _commonjsHelpers = require('./_commonjsHelpers-72d386ba.js');
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | 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?
|
14 | Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
15 | function z(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 t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
|
16 | var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
|
17 | var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
|
18 | var isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};var typeOf=z;
|
19 |
|
20 | var reactIs_production_min = {
|
21 | AsyncMode: AsyncMode,
|
22 | ConcurrentMode: ConcurrentMode,
|
23 | ContextConsumer: ContextConsumer,
|
24 | ContextProvider: ContextProvider,
|
25 | Element: Element,
|
26 | ForwardRef: ForwardRef,
|
27 | Fragment: Fragment,
|
28 | Lazy: Lazy,
|
29 | Memo: Memo,
|
30 | Portal: Portal,
|
31 | Profiler: Profiler,
|
32 | StrictMode: StrictMode,
|
33 | Suspense: Suspense,
|
34 | isAsyncMode: isAsyncMode,
|
35 | isConcurrentMode: isConcurrentMode,
|
36 | isContextConsumer: isContextConsumer,
|
37 | isContextProvider: isContextProvider,
|
38 | isElement: isElement,
|
39 | isForwardRef: isForwardRef,
|
40 | isFragment: isFragment,
|
41 | isLazy: isLazy,
|
42 | isMemo: isMemo,
|
43 | isPortal: isPortal,
|
44 | isProfiler: isProfiler,
|
45 | isStrictMode: isStrictMode,
|
46 | isSuspense: isSuspense,
|
47 | isValidElementType: isValidElementType,
|
48 | typeOf: typeOf
|
49 | };
|
50 |
|
51 | var reactIs_development = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
52 |
|
53 |
|
54 |
|
55 | if (process.env.NODE_ENV !== "production") {
|
56 | (function() {
|
57 |
|
58 |
|
59 |
|
60 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
61 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
62 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
63 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
64 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
65 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
66 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
67 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
68 |
|
69 |
|
70 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
71 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
72 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
73 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
74 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
75 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
76 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
77 | var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
78 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
79 | var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
80 | var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
81 |
|
82 | function isValidElementType(type) {
|
83 | return typeof type === 'string' || typeof type === 'function' ||
|
84 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
85 | }
|
86 |
|
87 | function typeOf(object) {
|
88 | if (typeof object === 'object' && object !== null) {
|
89 | var $$typeof = object.$$typeof;
|
90 |
|
91 | switch ($$typeof) {
|
92 | case REACT_ELEMENT_TYPE:
|
93 | var type = object.type;
|
94 |
|
95 | switch (type) {
|
96 | case REACT_ASYNC_MODE_TYPE:
|
97 | case REACT_CONCURRENT_MODE_TYPE:
|
98 | case REACT_FRAGMENT_TYPE:
|
99 | case REACT_PROFILER_TYPE:
|
100 | case REACT_STRICT_MODE_TYPE:
|
101 | case REACT_SUSPENSE_TYPE:
|
102 | return type;
|
103 |
|
104 | default:
|
105 | var $$typeofType = type && type.$$typeof;
|
106 |
|
107 | switch ($$typeofType) {
|
108 | case REACT_CONTEXT_TYPE:
|
109 | case REACT_FORWARD_REF_TYPE:
|
110 | case REACT_LAZY_TYPE:
|
111 | case REACT_MEMO_TYPE:
|
112 | case REACT_PROVIDER_TYPE:
|
113 | return $$typeofType;
|
114 |
|
115 | default:
|
116 | return $$typeof;
|
117 | }
|
118 |
|
119 | }
|
120 |
|
121 | case REACT_PORTAL_TYPE:
|
122 | return $$typeof;
|
123 | }
|
124 | }
|
125 |
|
126 | return undefined;
|
127 | }
|
128 |
|
129 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
130 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
131 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
132 | var ContextProvider = REACT_PROVIDER_TYPE;
|
133 | var Element = REACT_ELEMENT_TYPE;
|
134 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
135 | var Fragment = REACT_FRAGMENT_TYPE;
|
136 | var Lazy = REACT_LAZY_TYPE;
|
137 | var Memo = REACT_MEMO_TYPE;
|
138 | var Portal = REACT_PORTAL_TYPE;
|
139 | var Profiler = REACT_PROFILER_TYPE;
|
140 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
141 | var Suspense = REACT_SUSPENSE_TYPE;
|
142 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
143 |
|
144 | function isAsyncMode(object) {
|
145 | {
|
146 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
147 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
148 |
|
149 | console['warn']('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.');
|
150 | }
|
151 | }
|
152 |
|
153 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
154 | }
|
155 | function isConcurrentMode(object) {
|
156 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
157 | }
|
158 | function isContextConsumer(object) {
|
159 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
160 | }
|
161 | function isContextProvider(object) {
|
162 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
163 | }
|
164 | function isElement(object) {
|
165 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
166 | }
|
167 | function isForwardRef(object) {
|
168 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
169 | }
|
170 | function isFragment(object) {
|
171 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
172 | }
|
173 | function isLazy(object) {
|
174 | return typeOf(object) === REACT_LAZY_TYPE;
|
175 | }
|
176 | function isMemo(object) {
|
177 | return typeOf(object) === REACT_MEMO_TYPE;
|
178 | }
|
179 | function isPortal(object) {
|
180 | return typeOf(object) === REACT_PORTAL_TYPE;
|
181 | }
|
182 | function isProfiler(object) {
|
183 | return typeOf(object) === REACT_PROFILER_TYPE;
|
184 | }
|
185 | function isStrictMode(object) {
|
186 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
187 | }
|
188 | function isSuspense(object) {
|
189 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
190 | }
|
191 |
|
192 | exports.AsyncMode = AsyncMode;
|
193 | exports.ConcurrentMode = ConcurrentMode;
|
194 | exports.ContextConsumer = ContextConsumer;
|
195 | exports.ContextProvider = ContextProvider;
|
196 | exports.Element = Element;
|
197 | exports.ForwardRef = ForwardRef;
|
198 | exports.Fragment = Fragment;
|
199 | exports.Lazy = Lazy;
|
200 | exports.Memo = Memo;
|
201 | exports.Portal = Portal;
|
202 | exports.Profiler = Profiler;
|
203 | exports.StrictMode = StrictMode;
|
204 | exports.Suspense = Suspense;
|
205 | exports.isAsyncMode = isAsyncMode;
|
206 | exports.isConcurrentMode = isConcurrentMode;
|
207 | exports.isContextConsumer = isContextConsumer;
|
208 | exports.isContextProvider = isContextProvider;
|
209 | exports.isElement = isElement;
|
210 | exports.isForwardRef = isForwardRef;
|
211 | exports.isFragment = isFragment;
|
212 | exports.isLazy = isLazy;
|
213 | exports.isMemo = isMemo;
|
214 | exports.isPortal = isPortal;
|
215 | exports.isProfiler = isProfiler;
|
216 | exports.isStrictMode = isStrictMode;
|
217 | exports.isSuspense = isSuspense;
|
218 | exports.isValidElementType = isValidElementType;
|
219 | exports.typeOf = typeOf;
|
220 | })();
|
221 | }
|
222 | });
|
223 | var reactIs_development_1 = reactIs_development.AsyncMode;
|
224 | var reactIs_development_2 = reactIs_development.ConcurrentMode;
|
225 | var reactIs_development_3 = reactIs_development.ContextConsumer;
|
226 | var reactIs_development_4 = reactIs_development.ContextProvider;
|
227 | var reactIs_development_5 = reactIs_development.Element;
|
228 | var reactIs_development_6 = reactIs_development.ForwardRef;
|
229 | var reactIs_development_7 = reactIs_development.Fragment;
|
230 | var reactIs_development_8 = reactIs_development.Lazy;
|
231 | var reactIs_development_9 = reactIs_development.Memo;
|
232 | var reactIs_development_10 = reactIs_development.Portal;
|
233 | var reactIs_development_11 = reactIs_development.Profiler;
|
234 | var reactIs_development_12 = reactIs_development.StrictMode;
|
235 | var reactIs_development_13 = reactIs_development.Suspense;
|
236 | var reactIs_development_14 = reactIs_development.isAsyncMode;
|
237 | var reactIs_development_15 = reactIs_development.isConcurrentMode;
|
238 | var reactIs_development_16 = reactIs_development.isContextConsumer;
|
239 | var reactIs_development_17 = reactIs_development.isContextProvider;
|
240 | var reactIs_development_18 = reactIs_development.isElement;
|
241 | var reactIs_development_19 = reactIs_development.isForwardRef;
|
242 | var reactIs_development_20 = reactIs_development.isFragment;
|
243 | var reactIs_development_21 = reactIs_development.isLazy;
|
244 | var reactIs_development_22 = reactIs_development.isMemo;
|
245 | var reactIs_development_23 = reactIs_development.isPortal;
|
246 | var reactIs_development_24 = reactIs_development.isProfiler;
|
247 | var reactIs_development_25 = reactIs_development.isStrictMode;
|
248 | var reactIs_development_26 = reactIs_development.isSuspense;
|
249 | var reactIs_development_27 = reactIs_development.isValidElementType;
|
250 | var reactIs_development_28 = reactIs_development.typeOf;
|
251 |
|
252 | var reactIs = _commonjsHelpers.createCommonjsModule(function (module) {
|
253 |
|
254 | if (process.env.NODE_ENV === 'production') {
|
255 | module.exports = reactIs_production_min;
|
256 | } else {
|
257 | module.exports = reactIs_development;
|
258 | }
|
259 | });
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
268 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
269 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
270 |
|
271 | function toObject(val) {
|
272 | if (val === null || val === undefined) {
|
273 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
274 | }
|
275 |
|
276 | return Object(val);
|
277 | }
|
278 |
|
279 | function shouldUseNative() {
|
280 | try {
|
281 | if (!Object.assign) {
|
282 | return false;
|
283 | }
|
284 |
|
285 |
|
286 |
|
287 |
|
288 | var test1 = new String('abc');
|
289 | test1[5] = 'de';
|
290 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
291 | return false;
|
292 | }
|
293 |
|
294 |
|
295 | var test2 = {};
|
296 | for (var i = 0; i < 10; i++) {
|
297 | test2['_' + String.fromCharCode(i)] = i;
|
298 | }
|
299 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
300 | return test2[n];
|
301 | });
|
302 | if (order2.join('') !== '0123456789') {
|
303 | return false;
|
304 | }
|
305 |
|
306 |
|
307 | var test3 = {};
|
308 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
309 | test3[letter] = letter;
|
310 | });
|
311 | if (Object.keys(Object.assign({}, test3)).join('') !==
|
312 | 'abcdefghijklmnopqrst') {
|
313 | return false;
|
314 | }
|
315 |
|
316 | return true;
|
317 | } catch (err) {
|
318 |
|
319 | return false;
|
320 | }
|
321 | }
|
322 |
|
323 | var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
324 | var from;
|
325 | var to = toObject(target);
|
326 | var symbols;
|
327 |
|
328 | for (var s = 1; s < arguments.length; s++) {
|
329 | from = Object(arguments[s]);
|
330 |
|
331 | for (var key in from) {
|
332 | if (hasOwnProperty.call(from, key)) {
|
333 | to[key] = from[key];
|
334 | }
|
335 | }
|
336 |
|
337 | if (getOwnPropertySymbols) {
|
338 | symbols = getOwnPropertySymbols(from);
|
339 | for (var i = 0; i < symbols.length; i++) {
|
340 | if (propIsEnumerable.call(from, symbols[i])) {
|
341 | to[symbols[i]] = from[symbols[i]];
|
342 | }
|
343 | }
|
344 | }
|
345 | }
|
346 |
|
347 | return to;
|
348 | };
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
358 |
|
359 | var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
360 |
|
361 | var printWarning = function() {};
|
362 |
|
363 | if (process.env.NODE_ENV !== 'production') {
|
364 | var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
365 | var loggedTypeFailures = {};
|
366 | var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
367 |
|
368 | printWarning = function(text) {
|
369 | var message = 'Warning: ' + text;
|
370 | if (typeof console !== 'undefined') {
|
371 | console.error(message);
|
372 | }
|
373 | try {
|
374 |
|
375 |
|
376 |
|
377 | throw new Error(message);
|
378 | } catch (x) {}
|
379 | };
|
380 | }
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
394 | if (process.env.NODE_ENV !== 'production') {
|
395 | for (var typeSpecName in typeSpecs) {
|
396 | if (has(typeSpecs, typeSpecName)) {
|
397 | var error;
|
398 |
|
399 |
|
400 |
|
401 | try {
|
402 |
|
403 |
|
404 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
405 | var err = Error(
|
406 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
407 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
408 | );
|
409 | err.name = 'Invariant Violation';
|
410 | throw err;
|
411 | }
|
412 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
413 | } catch (ex) {
|
414 | error = ex;
|
415 | }
|
416 | if (error && !(error instanceof Error)) {
|
417 | printWarning(
|
418 | (componentName || 'React class') + ': type specification of ' +
|
419 | location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
420 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
421 | 'You may have forgotten to pass an argument to the type checker ' +
|
422 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
423 | 'shape all require an argument).'
|
424 | );
|
425 | }
|
426 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
427 |
|
428 |
|
429 | loggedTypeFailures[error.message] = true;
|
430 |
|
431 | var stack = getStack ? getStack() : '';
|
432 |
|
433 | printWarning(
|
434 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
435 | );
|
436 | }
|
437 | }
|
438 | }
|
439 | }
|
440 | }
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 | checkPropTypes.resetWarningCache = function() {
|
448 | if (process.env.NODE_ENV !== 'production') {
|
449 | loggedTypeFailures = {};
|
450 | }
|
451 | };
|
452 |
|
453 | var checkPropTypes_1 = checkPropTypes;
|
454 |
|
455 | var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
456 | var printWarning$1 = function() {};
|
457 |
|
458 | if (process.env.NODE_ENV !== 'production') {
|
459 | printWarning$1 = function(text) {
|
460 | var message = 'Warning: ' + text;
|
461 | if (typeof console !== 'undefined') {
|
462 | console.error(message);
|
463 | }
|
464 | try {
|
465 |
|
466 |
|
467 |
|
468 | throw new Error(message);
|
469 | } catch (x) {}
|
470 | };
|
471 | }
|
472 |
|
473 | function emptyFunctionThatReturnsNull() {
|
474 | return null;
|
475 | }
|
476 |
|
477 | var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
478 |
|
479 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
480 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
481 |
|
482 | |
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 | function getIteratorFn(maybeIterable) {
|
497 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
498 | if (typeof iteratorFn === 'function') {
|
499 | return iteratorFn;
|
500 | }
|
501 | }
|
502 |
|
503 | |
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | var ANONYMOUS = '<<anonymous>>';
|
551 |
|
552 |
|
553 |
|
554 | var ReactPropTypes = {
|
555 | array: createPrimitiveTypeChecker('array'),
|
556 | bool: createPrimitiveTypeChecker('boolean'),
|
557 | func: createPrimitiveTypeChecker('function'),
|
558 | number: createPrimitiveTypeChecker('number'),
|
559 | object: createPrimitiveTypeChecker('object'),
|
560 | string: createPrimitiveTypeChecker('string'),
|
561 | symbol: createPrimitiveTypeChecker('symbol'),
|
562 |
|
563 | any: createAnyTypeChecker(),
|
564 | arrayOf: createArrayOfTypeChecker,
|
565 | element: createElementTypeChecker(),
|
566 | elementType: createElementTypeTypeChecker(),
|
567 | instanceOf: createInstanceTypeChecker,
|
568 | node: createNodeChecker(),
|
569 | objectOf: createObjectOfTypeChecker,
|
570 | oneOf: createEnumTypeChecker,
|
571 | oneOfType: createUnionTypeChecker,
|
572 | shape: createShapeTypeChecker,
|
573 | exact: createStrictShapeTypeChecker,
|
574 | };
|
575 |
|
576 | |
577 |
|
578 |
|
579 |
|
580 |
|
581 | function is(x, y) {
|
582 |
|
583 | if (x === y) {
|
584 |
|
585 |
|
586 | return x !== 0 || 1 / x === 1 / y;
|
587 | } else {
|
588 |
|
589 | return x !== x && y !== y;
|
590 | }
|
591 | }
|
592 |
|
593 |
|
594 | |
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | function PropTypeError(message) {
|
602 | this.message = message;
|
603 | this.stack = '';
|
604 | }
|
605 |
|
606 | PropTypeError.prototype = Error.prototype;
|
607 |
|
608 | function createChainableTypeChecker(validate) {
|
609 | if (process.env.NODE_ENV !== 'production') {
|
610 | var manualPropTypeCallCache = {};
|
611 | var manualPropTypeWarningCount = 0;
|
612 | }
|
613 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
614 | componentName = componentName || ANONYMOUS;
|
615 | propFullName = propFullName || propName;
|
616 |
|
617 | if (secret !== ReactPropTypesSecret_1) {
|
618 | if (throwOnDirectAccess) {
|
619 |
|
620 | var err = new Error(
|
621 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
622 | 'Use `PropTypes.checkPropTypes()` to call them. ' +
|
623 | 'Read more at http://fb.me/use-check-prop-types'
|
624 | );
|
625 | err.name = 'Invariant Violation';
|
626 | throw err;
|
627 | } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
628 |
|
629 | var cacheKey = componentName + ':' + propName;
|
630 | if (
|
631 | !manualPropTypeCallCache[cacheKey] &&
|
632 |
|
633 | manualPropTypeWarningCount < 3
|
634 | ) {
|
635 | printWarning$1(
|
636 | 'You are manually calling a React.PropTypes validation ' +
|
637 | 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
638 | 'and will throw in the standalone `prop-types` package. ' +
|
639 | 'You may be seeing this warning due to a third-party PropTypes ' +
|
640 | 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
641 | );
|
642 | manualPropTypeCallCache[cacheKey] = true;
|
643 | manualPropTypeWarningCount++;
|
644 | }
|
645 | }
|
646 | }
|
647 | if (props[propName] == null) {
|
648 | if (isRequired) {
|
649 | if (props[propName] === null) {
|
650 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
651 | }
|
652 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
653 | }
|
654 | return null;
|
655 | } else {
|
656 | return validate(props, propName, componentName, location, propFullName);
|
657 | }
|
658 | }
|
659 |
|
660 | var chainedCheckType = checkType.bind(null, false);
|
661 | chainedCheckType.isRequired = checkType.bind(null, true);
|
662 |
|
663 | return chainedCheckType;
|
664 | }
|
665 |
|
666 | function createPrimitiveTypeChecker(expectedType) {
|
667 | function validate(props, propName, componentName, location, propFullName, secret) {
|
668 | var propValue = props[propName];
|
669 | var propType = getPropType(propValue);
|
670 | if (propType !== expectedType) {
|
671 |
|
672 |
|
673 |
|
674 | var preciseType = getPreciseType(propValue);
|
675 |
|
676 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
677 | }
|
678 | return null;
|
679 | }
|
680 | return createChainableTypeChecker(validate);
|
681 | }
|
682 |
|
683 | function createAnyTypeChecker() {
|
684 | return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
685 | }
|
686 |
|
687 | function createArrayOfTypeChecker(typeChecker) {
|
688 | function validate(props, propName, componentName, location, propFullName) {
|
689 | if (typeof typeChecker !== 'function') {
|
690 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
691 | }
|
692 | var propValue = props[propName];
|
693 | if (!Array.isArray(propValue)) {
|
694 | var propType = getPropType(propValue);
|
695 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
696 | }
|
697 | for (var i = 0; i < propValue.length; i++) {
|
698 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
|
699 | if (error instanceof Error) {
|
700 | return error;
|
701 | }
|
702 | }
|
703 | return null;
|
704 | }
|
705 | return createChainableTypeChecker(validate);
|
706 | }
|
707 |
|
708 | function createElementTypeChecker() {
|
709 | function validate(props, propName, componentName, location, propFullName) {
|
710 | var propValue = props[propName];
|
711 | if (!isValidElement(propValue)) {
|
712 | var propType = getPropType(propValue);
|
713 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
714 | }
|
715 | return null;
|
716 | }
|
717 | return createChainableTypeChecker(validate);
|
718 | }
|
719 |
|
720 | function createElementTypeTypeChecker() {
|
721 | function validate(props, propName, componentName, location, propFullName) {
|
722 | var propValue = props[propName];
|
723 | if (!reactIs.isValidElementType(propValue)) {
|
724 | var propType = getPropType(propValue);
|
725 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
726 | }
|
727 | return null;
|
728 | }
|
729 | return createChainableTypeChecker(validate);
|
730 | }
|
731 |
|
732 | function createInstanceTypeChecker(expectedClass) {
|
733 | function validate(props, propName, componentName, location, propFullName) {
|
734 | if (!(props[propName] instanceof expectedClass)) {
|
735 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
736 | var actualClassName = getClassName(props[propName]);
|
737 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
738 | }
|
739 | return null;
|
740 | }
|
741 | return createChainableTypeChecker(validate);
|
742 | }
|
743 |
|
744 | function createEnumTypeChecker(expectedValues) {
|
745 | if (!Array.isArray(expectedValues)) {
|
746 | if (process.env.NODE_ENV !== 'production') {
|
747 | if (arguments.length > 1) {
|
748 | printWarning$1(
|
749 | 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
750 | 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
751 | );
|
752 | } else {
|
753 | printWarning$1('Invalid argument supplied to oneOf, expected an array.');
|
754 | }
|
755 | }
|
756 | return emptyFunctionThatReturnsNull;
|
757 | }
|
758 |
|
759 | function validate(props, propName, componentName, location, propFullName) {
|
760 | var propValue = props[propName];
|
761 | for (var i = 0; i < expectedValues.length; i++) {
|
762 | if (is(propValue, expectedValues[i])) {
|
763 | return null;
|
764 | }
|
765 | }
|
766 |
|
767 | var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
768 | var type = getPreciseType(value);
|
769 | if (type === 'symbol') {
|
770 | return String(value);
|
771 | }
|
772 | return value;
|
773 | });
|
774 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
775 | }
|
776 | return createChainableTypeChecker(validate);
|
777 | }
|
778 |
|
779 | function createObjectOfTypeChecker(typeChecker) {
|
780 | function validate(props, propName, componentName, location, propFullName) {
|
781 | if (typeof typeChecker !== 'function') {
|
782 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
783 | }
|
784 | var propValue = props[propName];
|
785 | var propType = getPropType(propValue);
|
786 | if (propType !== 'object') {
|
787 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
788 | }
|
789 | for (var key in propValue) {
|
790 | if (has$1(propValue, key)) {
|
791 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
792 | if (error instanceof Error) {
|
793 | return error;
|
794 | }
|
795 | }
|
796 | }
|
797 | return null;
|
798 | }
|
799 | return createChainableTypeChecker(validate);
|
800 | }
|
801 |
|
802 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
803 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
804 | process.env.NODE_ENV !== 'production' ? printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
805 | return emptyFunctionThatReturnsNull;
|
806 | }
|
807 |
|
808 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
809 | var checker = arrayOfTypeCheckers[i];
|
810 | if (typeof checker !== 'function') {
|
811 | printWarning$1(
|
812 | 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
813 | 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
814 | );
|
815 | return emptyFunctionThatReturnsNull;
|
816 | }
|
817 | }
|
818 |
|
819 | function validate(props, propName, componentName, location, propFullName) {
|
820 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
821 | var checker = arrayOfTypeCheckers[i];
|
822 | if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
|
823 | return null;
|
824 | }
|
825 | }
|
826 |
|
827 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
828 | }
|
829 | return createChainableTypeChecker(validate);
|
830 | }
|
831 |
|
832 | function createNodeChecker() {
|
833 | function validate(props, propName, componentName, location, propFullName) {
|
834 | if (!isNode(props[propName])) {
|
835 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
836 | }
|
837 | return null;
|
838 | }
|
839 | return createChainableTypeChecker(validate);
|
840 | }
|
841 |
|
842 | function createShapeTypeChecker(shapeTypes) {
|
843 | function validate(props, propName, componentName, location, propFullName) {
|
844 | var propValue = props[propName];
|
845 | var propType = getPropType(propValue);
|
846 | if (propType !== 'object') {
|
847 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
848 | }
|
849 | for (var key in shapeTypes) {
|
850 | var checker = shapeTypes[key];
|
851 | if (!checker) {
|
852 | continue;
|
853 | }
|
854 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
855 | if (error) {
|
856 | return error;
|
857 | }
|
858 | }
|
859 | return null;
|
860 | }
|
861 | return createChainableTypeChecker(validate);
|
862 | }
|
863 |
|
864 | function createStrictShapeTypeChecker(shapeTypes) {
|
865 | function validate(props, propName, componentName, location, propFullName) {
|
866 | var propValue = props[propName];
|
867 | var propType = getPropType(propValue);
|
868 | if (propType !== 'object') {
|
869 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
870 | }
|
871 |
|
872 |
|
873 | var allKeys = objectAssign({}, props[propName], shapeTypes);
|
874 | for (var key in allKeys) {
|
875 | var checker = shapeTypes[key];
|
876 | if (!checker) {
|
877 | return new PropTypeError(
|
878 | 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
879 | '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
880 | '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
881 | );
|
882 | }
|
883 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
884 | if (error) {
|
885 | return error;
|
886 | }
|
887 | }
|
888 | return null;
|
889 | }
|
890 |
|
891 | return createChainableTypeChecker(validate);
|
892 | }
|
893 |
|
894 | function isNode(propValue) {
|
895 | switch (typeof propValue) {
|
896 | case 'number':
|
897 | case 'string':
|
898 | case 'undefined':
|
899 | return true;
|
900 | case 'boolean':
|
901 | return !propValue;
|
902 | case 'object':
|
903 | if (Array.isArray(propValue)) {
|
904 | return propValue.every(isNode);
|
905 | }
|
906 | if (propValue === null || isValidElement(propValue)) {
|
907 | return true;
|
908 | }
|
909 |
|
910 | var iteratorFn = getIteratorFn(propValue);
|
911 | if (iteratorFn) {
|
912 | var iterator = iteratorFn.call(propValue);
|
913 | var step;
|
914 | if (iteratorFn !== propValue.entries) {
|
915 | while (!(step = iterator.next()).done) {
|
916 | if (!isNode(step.value)) {
|
917 | return false;
|
918 | }
|
919 | }
|
920 | } else {
|
921 |
|
922 | while (!(step = iterator.next()).done) {
|
923 | var entry = step.value;
|
924 | if (entry) {
|
925 | if (!isNode(entry[1])) {
|
926 | return false;
|
927 | }
|
928 | }
|
929 | }
|
930 | }
|
931 | } else {
|
932 | return false;
|
933 | }
|
934 |
|
935 | return true;
|
936 | default:
|
937 | return false;
|
938 | }
|
939 | }
|
940 |
|
941 | function isSymbol(propType, propValue) {
|
942 |
|
943 | if (propType === 'symbol') {
|
944 | return true;
|
945 | }
|
946 |
|
947 |
|
948 | if (!propValue) {
|
949 | return false;
|
950 | }
|
951 |
|
952 |
|
953 | if (propValue['@@toStringTag'] === 'Symbol') {
|
954 | return true;
|
955 | }
|
956 |
|
957 |
|
958 | if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
959 | return true;
|
960 | }
|
961 |
|
962 | return false;
|
963 | }
|
964 |
|
965 |
|
966 | function getPropType(propValue) {
|
967 | var propType = typeof propValue;
|
968 | if (Array.isArray(propValue)) {
|
969 | return 'array';
|
970 | }
|
971 | if (propValue instanceof RegExp) {
|
972 |
|
973 |
|
974 |
|
975 | return 'object';
|
976 | }
|
977 | if (isSymbol(propType, propValue)) {
|
978 | return 'symbol';
|
979 | }
|
980 | return propType;
|
981 | }
|
982 |
|
983 |
|
984 |
|
985 | function getPreciseType(propValue) {
|
986 | if (typeof propValue === 'undefined' || propValue === null) {
|
987 | return '' + propValue;
|
988 | }
|
989 | var propType = getPropType(propValue);
|
990 | if (propType === 'object') {
|
991 | if (propValue instanceof Date) {
|
992 | return 'date';
|
993 | } else if (propValue instanceof RegExp) {
|
994 | return 'regexp';
|
995 | }
|
996 | }
|
997 | return propType;
|
998 | }
|
999 |
|
1000 |
|
1001 |
|
1002 | function getPostfixForTypeWarning(value) {
|
1003 | var type = getPreciseType(value);
|
1004 | switch (type) {
|
1005 | case 'array':
|
1006 | case 'object':
|
1007 | return 'an ' + type;
|
1008 | case 'boolean':
|
1009 | case 'date':
|
1010 | case 'regexp':
|
1011 | return 'a ' + type;
|
1012 | default:
|
1013 | return type;
|
1014 | }
|
1015 | }
|
1016 |
|
1017 |
|
1018 | function getClassName(propValue) {
|
1019 | if (!propValue.constructor || !propValue.constructor.name) {
|
1020 | return ANONYMOUS;
|
1021 | }
|
1022 | return propValue.constructor.name;
|
1023 | }
|
1024 |
|
1025 | ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
1026 | ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
1027 | ReactPropTypes.PropTypes = ReactPropTypes;
|
1028 |
|
1029 | return ReactPropTypes;
|
1030 | };
|
1031 |
|
1032 | function emptyFunction() {}
|
1033 | function emptyFunctionWithReset() {}
|
1034 | emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
1035 |
|
1036 | var factoryWithThrowingShims = function() {
|
1037 | function shim(props, propName, componentName, location, propFullName, secret) {
|
1038 | if (secret === ReactPropTypesSecret_1) {
|
1039 |
|
1040 | return;
|
1041 | }
|
1042 | var err = new Error(
|
1043 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
1044 | 'Use PropTypes.checkPropTypes() to call them. ' +
|
1045 | 'Read more at http://fb.me/use-check-prop-types'
|
1046 | );
|
1047 | err.name = 'Invariant Violation';
|
1048 | throw err;
|
1049 | } shim.isRequired = shim;
|
1050 | function getShim() {
|
1051 | return shim;
|
1052 | }
|
1053 |
|
1054 | var ReactPropTypes = {
|
1055 | array: shim,
|
1056 | bool: shim,
|
1057 | func: shim,
|
1058 | number: shim,
|
1059 | object: shim,
|
1060 | string: shim,
|
1061 | symbol: shim,
|
1062 |
|
1063 | any: shim,
|
1064 | arrayOf: getShim,
|
1065 | element: shim,
|
1066 | elementType: shim,
|
1067 | instanceOf: getShim,
|
1068 | node: shim,
|
1069 | objectOf: getShim,
|
1070 | oneOf: getShim,
|
1071 | oneOfType: getShim,
|
1072 | shape: getShim,
|
1073 | exact: getShim,
|
1074 |
|
1075 | checkPropTypes: emptyFunctionWithReset,
|
1076 | resetWarningCache: emptyFunction
|
1077 | };
|
1078 |
|
1079 | ReactPropTypes.PropTypes = ReactPropTypes;
|
1080 |
|
1081 | return ReactPropTypes;
|
1082 | };
|
1083 |
|
1084 | var propTypes = _commonjsHelpers.createCommonjsModule(function (module) {
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 | if (process.env.NODE_ENV !== 'production') {
|
1093 | var ReactIs = reactIs;
|
1094 |
|
1095 |
|
1096 |
|
1097 | var throwOnDirectAccess = true;
|
1098 | module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
1099 | } else {
|
1100 |
|
1101 |
|
1102 | module.exports = factoryWithThrowingShims();
|
1103 | }
|
1104 | });
|
1105 |
|
1106 | exports.PropTypes = propTypes;
|
1107 | exports.propTypes = propTypes;
|
1108 |
|