":(v+=">",h=""+a.type+">");a:{m=
35 | f.dangerouslySetInnerHTML;if(null!=m){if(null!=m.__html){m=m.__html;break a}}else if(m=f.children,"string"===typeof m||"number"===typeof m){m=z(m);break a}m=null}null!=m?(f=[],la[b]&&"\n"===m.charAt(0)&&(v+="\n"),v+=m):f=y(f.children);a=a.type;c=null==c||"http://www.w3.org/1999/xhtml"===c?Q(a):"http://www.w3.org/2000/svg"===c&&"foreignObject"===a?"http://www.w3.org/1999/xhtml":c;this.stack.push({domNamespace:c,type:b,children:f,childIndex:0,context:d,footer:h});this.previousWasTextNode=!1;return v};
36 | return a}();l={renderToString:function(a){return(new V(a,!1)).read(Infinity)},renderToStaticMarkup:function(a){return(new V(a,!0)).read(Infinity)},renderToNodeStream:function(){u("207")},renderToStaticNodeStream:function(){u("208")},version:"16.4.1"};var W={default:l};l=W&&l||W;return l.default?l.default:l});
37 |
--------------------------------------------------------------------------------
/vendor/react-dom-test-utils.development.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.4.1
2 | * react-dom-test-utils.development.js
3 | *
4 | * Copyright (c) 2013-present, Facebook, Inc.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 |
10 | 'use strict';
11 |
12 | (function (global, factory) {
13 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('react-dom')) :
14 | typeof define === 'function' && define.amd ? define(['react', 'react-dom'], factory) :
15 | (global.ReactTestUtils = factory(global.React,global.ReactDOM));
16 | }(this, (function (React,ReactDOM) { 'use strict';
17 |
18 | var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
19 |
20 | var _assign = ReactInternals.assign;
21 |
22 | /**
23 | * Use invariant() to assert state which your program assumes to be true.
24 | *
25 | * Provide sprintf-style format (only %s is supported) and arguments
26 | * to provide information about what broke and what you were
27 | * expecting.
28 | *
29 | * The invariant message will be stripped in production, but the invariant
30 | * will remain to ensure logic does not differ in production.
31 | */
32 |
33 | var validateFormat = function () {};
34 |
35 | {
36 | validateFormat = function (format) {
37 | if (format === undefined) {
38 | throw new Error('invariant requires an error message argument');
39 | }
40 | };
41 | }
42 |
43 | function invariant(condition, format, a, b, c, d, e, f) {
44 | validateFormat(format);
45 |
46 | if (!condition) {
47 | var error = void 0;
48 | if (format === undefined) {
49 | error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
50 | } else {
51 | var args = [a, b, c, d, e, f];
52 | var argIndex = 0;
53 | error = new Error(format.replace(/%s/g, function () {
54 | return args[argIndex++];
55 | }));
56 | error.name = 'Invariant Violation';
57 | }
58 |
59 | error.framesToPop = 1; // we don't care about invariant's own frame
60 | throw error;
61 | }
62 | }
63 |
64 | // Relying on the `invariant()` implementation lets us
65 | // have preserve the format and params in the www builds.
66 |
67 | /**
68 | * Similar to invariant but only logs a warning if the condition is not met.
69 | * This can be used to log issues in development environments in critical
70 | * paths. Removing the logging code for production environments will keep the
71 | * same logic and follow the same code paths.
72 | */
73 |
74 | var warningWithoutStack = function () {};
75 |
76 | {
77 | warningWithoutStack = function (condition, format) {
78 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
79 | args[_key - 2] = arguments[_key];
80 | }
81 |
82 | if (format === undefined) {
83 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
84 | }
85 | if (condition) {
86 | return;
87 | }
88 | if (typeof console !== 'undefined') {
89 | var _console;
90 |
91 | (_console = console).error.apply(_console, ['Warning: ' + format].concat(args));
92 | }
93 | try {
94 | // --- Welcome to debugging React ---
95 | // This error was thrown as a convenience so that you can use this stack
96 | // to find the callsite that caused this warning to fire.
97 | var argIndex = 0;
98 | var message = 'Warning: ' + format.replace(/%s/g, function () {
99 | return args[argIndex++];
100 | });
101 | throw new Error(message);
102 | } catch (x) {}
103 | };
104 | }
105 |
106 | var warningWithoutStack$1 = warningWithoutStack;
107 |
108 | /**
109 | * `ReactInstanceMap` maintains a mapping from a public facing stateful
110 | * instance (key) and the internal representation (value). This allows public
111 | * methods to accept the user facing instance as an argument and map them back
112 | * to internal methods.
113 | *
114 | * Note that this module is currently shared and assumed to be stateless.
115 | * If this becomes an actual Map, that will break.
116 | */
117 |
118 | /**
119 | * This API should be called `delete` but we'd have to make sure to always
120 | * transform these to strings for IE support. When this transform is fully
121 | * supported we can rename it.
122 | */
123 |
124 |
125 | function get(key) {
126 | return key._reactInternalFiber;
127 | }
128 |
129 | var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
130 |
131 | // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
132 | // nor polyfill, then a plain number is used for performance.
133 |
134 | // Before we know whether it is functional or class
135 | var FunctionalComponent = 1;
136 | var ClassComponent = 2;
137 | var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
138 | // A subtree. Could be an entry point to a different renderer.
139 | var HostComponent = 5;
140 | var HostText = 6;
141 |
142 | // Don't change these two values. They're used by React Dev Tools.
143 | var NoEffect = /* */0;
144 |
145 |
146 | // You can change the rest (and add more).
147 | var Placement = /* */2;
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 | // Update & Callback & Ref & Snapshot
158 |
159 |
160 | // Union of all host effects
161 |
162 | var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
163 |
164 | var MOUNTING = 1;
165 | var MOUNTED = 2;
166 | var UNMOUNTED = 3;
167 |
168 | function isFiberMountedImpl(fiber) {
169 | var node = fiber;
170 | if (!fiber.alternate) {
171 | // If there is no alternate, this might be a new tree that isn't inserted
172 | // yet. If it is, then it will have a pending insertion effect on it.
173 | if ((node.effectTag & Placement) !== NoEffect) {
174 | return MOUNTING;
175 | }
176 | while (node.return) {
177 | node = node.return;
178 | if ((node.effectTag & Placement) !== NoEffect) {
179 | return MOUNTING;
180 | }
181 | }
182 | } else {
183 | while (node.return) {
184 | node = node.return;
185 | }
186 | }
187 | if (node.tag === HostRoot) {
188 | // TODO: Check if this was a nested HostRoot when used with
189 | // renderContainerIntoSubtree.
190 | return MOUNTED;
191 | }
192 | // If we didn't hit the root, that means that we're in an disconnected tree
193 | // that has been unmounted.
194 | return UNMOUNTED;
195 | }
196 |
197 |
198 |
199 |
200 |
201 | function assertIsMounted(fiber) {
202 | !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
203 | }
204 |
205 | function findCurrentFiberUsingSlowPath(fiber) {
206 | var alternate = fiber.alternate;
207 | if (!alternate) {
208 | // If there is no alternate, then we only need to check if it is mounted.
209 | var state = isFiberMountedImpl(fiber);
210 | !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
211 | if (state === MOUNTING) {
212 | return null;
213 | }
214 | return fiber;
215 | }
216 | // If we have two possible branches, we'll walk backwards up to the root
217 | // to see what path the root points to. On the way we may hit one of the
218 | // special cases and we'll deal with them.
219 | var a = fiber;
220 | var b = alternate;
221 | while (true) {
222 | var parentA = a.return;
223 | var parentB = parentA ? parentA.alternate : null;
224 | if (!parentA || !parentB) {
225 | // We're at the root.
226 | break;
227 | }
228 |
229 | // If both copies of the parent fiber point to the same child, we can
230 | // assume that the child is current. This happens when we bailout on low
231 | // priority: the bailed out fiber's child reuses the current child.
232 | if (parentA.child === parentB.child) {
233 | var child = parentA.child;
234 | while (child) {
235 | if (child === a) {
236 | // We've determined that A is the current branch.
237 | assertIsMounted(parentA);
238 | return fiber;
239 | }
240 | if (child === b) {
241 | // We've determined that B is the current branch.
242 | assertIsMounted(parentA);
243 | return alternate;
244 | }
245 | child = child.sibling;
246 | }
247 | // We should never have an alternate for any mounting node. So the only
248 | // way this could possibly happen is if this was unmounted, if at all.
249 | invariant(false, 'Unable to find node on an unmounted component.');
250 | }
251 |
252 | if (a.return !== b.return) {
253 | // The return pointer of A and the return pointer of B point to different
254 | // fibers. We assume that return pointers never criss-cross, so A must
255 | // belong to the child set of A.return, and B must belong to the child
256 | // set of B.return.
257 | a = parentA;
258 | b = parentB;
259 | } else {
260 | // The return pointers point to the same fiber. We'll have to use the
261 | // default, slow path: scan the child sets of each parent alternate to see
262 | // which child belongs to which set.
263 | //
264 | // Search parent A's child set
265 | var didFindChild = false;
266 | var _child = parentA.child;
267 | while (_child) {
268 | if (_child === a) {
269 | didFindChild = true;
270 | a = parentA;
271 | b = parentB;
272 | break;
273 | }
274 | if (_child === b) {
275 | didFindChild = true;
276 | b = parentA;
277 | a = parentB;
278 | break;
279 | }
280 | _child = _child.sibling;
281 | }
282 | if (!didFindChild) {
283 | // Search parent B's child set
284 | _child = parentB.child;
285 | while (_child) {
286 | if (_child === a) {
287 | didFindChild = true;
288 | a = parentB;
289 | b = parentA;
290 | break;
291 | }
292 | if (_child === b) {
293 | didFindChild = true;
294 | b = parentB;
295 | a = parentA;
296 | break;
297 | }
298 | _child = _child.sibling;
299 | }
300 | !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
301 | }
302 | }
303 |
304 | !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
305 | }
306 | // If the root is not a host container, we're in a disconnected tree. I.e.
307 | // unmounted.
308 | !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
309 | if (a.stateNode.current === a) {
310 | // We've determined that A is the current branch.
311 | return fiber;
312 | }
313 | // Otherwise B has to be current branch.
314 | return alternate;
315 | }
316 |
317 | /* eslint valid-typeof: 0 */
318 |
319 | var EVENT_POOL_SIZE = 10;
320 |
321 | /**
322 | * @interface Event
323 | * @see http://www.w3.org/TR/DOM-Level-3-Events/
324 | */
325 | var EventInterface = {
326 | type: null,
327 | target: null,
328 | // currentTarget is set when dispatching; no use in copying it here
329 | currentTarget: function () {
330 | return null;
331 | },
332 | eventPhase: null,
333 | bubbles: null,
334 | cancelable: null,
335 | timeStamp: function (event) {
336 | return event.timeStamp || Date.now();
337 | },
338 | defaultPrevented: null,
339 | isTrusted: null
340 | };
341 |
342 | function functionThatReturnsTrue() {
343 | return true;
344 | }
345 |
346 | function functionThatReturnsFalse() {
347 | return false;
348 | }
349 |
350 | /**
351 | * Synthetic events are dispatched by event plugins, typically in response to a
352 | * top-level event delegation handler.
353 | *
354 | * These systems should generally use pooling to reduce the frequency of garbage
355 | * collection. The system should check `isPersistent` to determine whether the
356 | * event should be released into the pool after being dispatched. Users that
357 | * need a persisted event should invoke `persist`.
358 | *
359 | * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
360 | * normalizing browser quirks. Subclasses do not necessarily have to implement a
361 | * DOM interface; custom application-specific events can also subclass this.
362 | *
363 | * @param {object} dispatchConfig Configuration used to dispatch this event.
364 | * @param {*} targetInst Marker identifying the event target.
365 | * @param {object} nativeEvent Native browser event.
366 | * @param {DOMEventTarget} nativeEventTarget Target node.
367 | */
368 | function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
369 | {
370 | // these have a getter/setter for warnings
371 | delete this.nativeEvent;
372 | delete this.preventDefault;
373 | delete this.stopPropagation;
374 | delete this.isDefaultPrevented;
375 | delete this.isPropagationStopped;
376 | }
377 |
378 | this.dispatchConfig = dispatchConfig;
379 | this._targetInst = targetInst;
380 | this.nativeEvent = nativeEvent;
381 |
382 | var Interface = this.constructor.Interface;
383 | for (var propName in Interface) {
384 | if (!Interface.hasOwnProperty(propName)) {
385 | continue;
386 | }
387 | {
388 | delete this[propName]; // this has a getter/setter for warnings
389 | }
390 | var normalize = Interface[propName];
391 | if (normalize) {
392 | this[propName] = normalize(nativeEvent);
393 | } else {
394 | if (propName === 'target') {
395 | this.target = nativeEventTarget;
396 | } else {
397 | this[propName] = nativeEvent[propName];
398 | }
399 | }
400 | }
401 |
402 | var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
403 | if (defaultPrevented) {
404 | this.isDefaultPrevented = functionThatReturnsTrue;
405 | } else {
406 | this.isDefaultPrevented = functionThatReturnsFalse;
407 | }
408 | this.isPropagationStopped = functionThatReturnsFalse;
409 | return this;
410 | }
411 |
412 | _assign(SyntheticEvent.prototype, {
413 | preventDefault: function () {
414 | this.defaultPrevented = true;
415 | var event = this.nativeEvent;
416 | if (!event) {
417 | return;
418 | }
419 |
420 | if (event.preventDefault) {
421 | event.preventDefault();
422 | } else if (typeof event.returnValue !== 'unknown') {
423 | event.returnValue = false;
424 | }
425 | this.isDefaultPrevented = functionThatReturnsTrue;
426 | },
427 |
428 | stopPropagation: function () {
429 | var event = this.nativeEvent;
430 | if (!event) {
431 | return;
432 | }
433 |
434 | if (event.stopPropagation) {
435 | event.stopPropagation();
436 | } else if (typeof event.cancelBubble !== 'unknown') {
437 | // The ChangeEventPlugin registers a "propertychange" event for
438 | // IE. This event does not support bubbling or cancelling, and
439 | // any references to cancelBubble throw "Member not found". A
440 | // typeof check of "unknown" circumvents this issue (and is also
441 | // IE specific).
442 | event.cancelBubble = true;
443 | }
444 |
445 | this.isPropagationStopped = functionThatReturnsTrue;
446 | },
447 |
448 | /**
449 | * We release all dispatched `SyntheticEvent`s after each event loop, adding
450 | * them back into the pool. This allows a way to hold onto a reference that
451 | * won't be added back into the pool.
452 | */
453 | persist: function () {
454 | this.isPersistent = functionThatReturnsTrue;
455 | },
456 |
457 | /**
458 | * Checks if this event should be released back into the pool.
459 | *
460 | * @return {boolean} True if this should not be released, false otherwise.
461 | */
462 | isPersistent: functionThatReturnsFalse,
463 |
464 | /**
465 | * `PooledClass` looks for `destructor` on each instance it releases.
466 | */
467 | destructor: function () {
468 | var Interface = this.constructor.Interface;
469 | for (var propName in Interface) {
470 | {
471 | Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
472 | }
473 | }
474 | this.dispatchConfig = null;
475 | this._targetInst = null;
476 | this.nativeEvent = null;
477 | this.isDefaultPrevented = functionThatReturnsFalse;
478 | this.isPropagationStopped = functionThatReturnsFalse;
479 | this._dispatchListeners = null;
480 | this._dispatchInstances = null;
481 | {
482 | Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
483 | Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
484 | Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
485 | Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
486 | Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
487 | }
488 | }
489 | });
490 |
491 | SyntheticEvent.Interface = EventInterface;
492 |
493 | /**
494 | * Helper to reduce boilerplate when creating subclasses.
495 | */
496 | SyntheticEvent.extend = function (Interface) {
497 | var Super = this;
498 |
499 | var E = function () {};
500 | E.prototype = Super.prototype;
501 | var prototype = new E();
502 |
503 | function Class() {
504 | return Super.apply(this, arguments);
505 | }
506 | _assign(prototype, Class.prototype);
507 | Class.prototype = prototype;
508 | Class.prototype.constructor = Class;
509 |
510 | Class.Interface = _assign({}, Super.Interface, Interface);
511 | Class.extend = Super.extend;
512 | addEventPoolingTo(Class);
513 |
514 | return Class;
515 | };
516 |
517 | addEventPoolingTo(SyntheticEvent);
518 |
519 | /**
520 | * Helper to nullify syntheticEvent instance properties when destructing
521 | *
522 | * @param {String} propName
523 | * @param {?object} getVal
524 | * @return {object} defineProperty object
525 | */
526 | function getPooledWarningPropertyDefinition(propName, getVal) {
527 | var isFunction = typeof getVal === 'function';
528 | return {
529 | configurable: true,
530 | set: set,
531 | get: get
532 | };
533 |
534 | function set(val) {
535 | var action = isFunction ? 'setting the method' : 'setting the property';
536 | warn(action, 'This is effectively a no-op');
537 | return val;
538 | }
539 |
540 | function get() {
541 | var action = isFunction ? 'accessing the method' : 'accessing the property';
542 | var result = isFunction ? 'This is a no-op function' : 'This is set to null';
543 | warn(action, result);
544 | return getVal;
545 | }
546 |
547 | function warn(action, result) {
548 | var warningCondition = false;
549 | !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
550 | }
551 | }
552 |
553 | function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
554 | var EventConstructor = this;
555 | if (EventConstructor.eventPool.length) {
556 | var instance = EventConstructor.eventPool.pop();
557 | EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
558 | return instance;
559 | }
560 | return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
561 | }
562 |
563 | function releasePooledEvent(event) {
564 | var EventConstructor = this;
565 | !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
566 | event.destructor();
567 | if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
568 | EventConstructor.eventPool.push(event);
569 | }
570 | }
571 |
572 | function addEventPoolingTo(EventConstructor) {
573 | EventConstructor.eventPool = [];
574 | EventConstructor.getPooled = getPooledEvent;
575 | EventConstructor.release = releasePooledEvent;
576 | }
577 |
578 | /**
579 | * Forked from fbjs/warning:
580 | * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
581 | *
582 | * Only change is we use console.warn instead of console.error,
583 | * and do nothing when 'console' is not supported.
584 | * This really simplifies the code.
585 | * ---
586 | * Similar to invariant but only logs a warning if the condition is not met.
587 | * This can be used to log issues in development environments in critical
588 | * paths. Removing the logging code for production environments will keep the
589 | * same logic and follow the same code paths.
590 | */
591 |
592 | var lowPriorityWarning = function () {};
593 |
594 | {
595 | var printWarning = function (format) {
596 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
597 | args[_key - 1] = arguments[_key];
598 | }
599 |
600 | var argIndex = 0;
601 | var message = 'Warning: ' + format.replace(/%s/g, function () {
602 | return args[argIndex++];
603 | });
604 | if (typeof console !== 'undefined') {
605 | console.warn(message);
606 | }
607 | try {
608 | // --- Welcome to debugging React ---
609 | // This error was thrown as a convenience so that you can use this stack
610 | // to find the callsite that caused this warning to fire.
611 | throw new Error(message);
612 | } catch (x) {}
613 | };
614 |
615 | lowPriorityWarning = function (condition, format) {
616 | if (format === undefined) {
617 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
618 | }
619 | if (!condition) {
620 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
621 | args[_key2 - 2] = arguments[_key2];
622 | }
623 |
624 | printWarning.apply(undefined, [format].concat(args));
625 | }
626 | };
627 | }
628 |
629 | var lowPriorityWarning$1 = lowPriorityWarning;
630 |
631 | // Do not uses the below two methods directly!
632 | // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
633 | // (It is the only module that is allowed to access these methods.)
634 |
635 | function unsafeCastStringToDOMTopLevelType(topLevelType) {
636 | return topLevelType;
637 | }
638 |
639 | var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
640 |
641 | /**
642 | * Generate a mapping of standard vendor prefixes using the defined style property and event name.
643 | *
644 | * @param {string} styleProp
645 | * @param {string} eventName
646 | * @returns {object}
647 | */
648 | function makePrefixMap(styleProp, eventName) {
649 | var prefixes = {};
650 |
651 | prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
652 | prefixes['Webkit' + styleProp] = 'webkit' + eventName;
653 | prefixes['Moz' + styleProp] = 'moz' + eventName;
654 |
655 | return prefixes;
656 | }
657 |
658 | /**
659 | * A list of event names to a configurable list of vendor prefixes.
660 | */
661 | var vendorPrefixes = {
662 | animationend: makePrefixMap('Animation', 'AnimationEnd'),
663 | animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
664 | animationstart: makePrefixMap('Animation', 'AnimationStart'),
665 | transitionend: makePrefixMap('Transition', 'TransitionEnd')
666 | };
667 |
668 | /**
669 | * Event names that have already been detected and prefixed (if applicable).
670 | */
671 | var prefixedEventNames = {};
672 |
673 | /**
674 | * Element to check for prefixes on.
675 | */
676 | var style = {};
677 |
678 | /**
679 | * Bootstrap if a DOM exists.
680 | */
681 | if (canUseDOM) {
682 | style = document.createElement('div').style;
683 |
684 | // On some platforms, in particular some releases of Android 4.x,
685 | // the un-prefixed "animation" and "transition" properties are defined on the
686 | // style object but the events that fire will still be prefixed, so we need
687 | // to check if the un-prefixed events are usable, and if not remove them from the map.
688 | if (!('AnimationEvent' in window)) {
689 | delete vendorPrefixes.animationend.animation;
690 | delete vendorPrefixes.animationiteration.animation;
691 | delete vendorPrefixes.animationstart.animation;
692 | }
693 |
694 | // Same as above
695 | if (!('TransitionEvent' in window)) {
696 | delete vendorPrefixes.transitionend.transition;
697 | }
698 | }
699 |
700 | /**
701 | * Attempts to determine the correct vendor prefixed event name.
702 | *
703 | * @param {string} eventName
704 | * @returns {string}
705 | */
706 | function getVendorPrefixedEventName(eventName) {
707 | if (prefixedEventNames[eventName]) {
708 | return prefixedEventNames[eventName];
709 | } else if (!vendorPrefixes[eventName]) {
710 | return eventName;
711 | }
712 |
713 | var prefixMap = vendorPrefixes[eventName];
714 |
715 | for (var styleProp in prefixMap) {
716 | if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
717 | return prefixedEventNames[eventName] = prefixMap[styleProp];
718 | }
719 | }
720 |
721 | return eventName;
722 | }
723 |
724 | /**
725 | * To identify top level events in ReactDOM, we use constants defined by this
726 | * module. This is the only module that uses the unsafe* methods to express
727 | * that the constants actually correspond to the browser event names. This lets
728 | * us save some bundle size by avoiding a top level type -> event name map.
729 | * The rest of ReactDOM code should import top level types from this file.
730 | */
731 | var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
732 | var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
733 | var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
734 | var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
735 | var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
736 | var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
737 | var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
738 | var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
739 | var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
740 | var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
741 | var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
742 | var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
743 | var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
744 | var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
745 | var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
746 | var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
747 | var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
748 | var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
749 | var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
750 | var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
751 | var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
752 | var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
753 | var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
754 | var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
755 | var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
756 | var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
757 | var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
758 | var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
759 | var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
760 | var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
761 | var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
762 | var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
763 |
764 | var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
765 |
766 | var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
767 | var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
768 | var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
769 | var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
770 | var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
771 | var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
772 | var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
773 |
774 | var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
775 | var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
776 | var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
777 | var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
778 | var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
779 | var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
780 | var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
781 | var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
782 | var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 | var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
792 | var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
793 |
794 | var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
795 | var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
796 | var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
797 | var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
798 | var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
799 |
800 | var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
801 | var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
802 | var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
803 | var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
804 | var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
805 | var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
806 | var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
807 | var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
808 | var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
809 | var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
810 | var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
811 | var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
812 |
813 | // List of events that need to be individually attached to media elements.
814 | // Note that events in this list will *not* be listened to at the top level
815 | // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
816 |
817 | var findDOMNode = ReactDOM.findDOMNode;
818 | var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
819 | var EventPluginHub = _ReactDOM$__SECRET_IN.EventPluginHub;
820 | var EventPluginRegistry = _ReactDOM$__SECRET_IN.EventPluginRegistry;
821 | var EventPropagators = _ReactDOM$__SECRET_IN.EventPropagators;
822 | var ReactControlledComponent = _ReactDOM$__SECRET_IN.ReactControlledComponent;
823 | var ReactDOMComponentTree = _ReactDOM$__SECRET_IN.ReactDOMComponentTree;
824 | var ReactDOMEventListener = _ReactDOM$__SECRET_IN.ReactDOMEventListener;
825 |
826 |
827 | function Event(suffix) {}
828 |
829 | var hasWarnedAboutDeprecatedMockComponent = false;
830 |
831 | /**
832 | * @class ReactTestUtils
833 | */
834 |
835 | /**
836 | * Simulates a top level event being dispatched from a raw event that occurred
837 | * on an `Element` node.
838 | * @param {number} topLevelType A number from `TopLevelEventTypes`
839 | * @param {!Element} node The dom to simulate an event occurring on.
840 | * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
841 | */
842 | function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) {
843 | fakeNativeEvent.target = node;
844 | ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
845 | }
846 |
847 | /**
848 | * Simulates a top level event being dispatched from a raw event that occurred
849 | * on the `ReactDOMComponent` `comp`.
850 | * @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
851 | * @param {!ReactDOMComponent} comp
852 | * @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
853 | */
854 | function simulateNativeEventOnDOMComponent(topLevelType, comp, fakeNativeEvent) {
855 | simulateNativeEventOnNode(topLevelType, findDOMNode(comp), fakeNativeEvent);
856 | }
857 |
858 | function findAllInRenderedFiberTreeInternal(fiber, test) {
859 | if (!fiber) {
860 | return [];
861 | }
862 | var currentParent = findCurrentFiberUsingSlowPath(fiber);
863 | if (!currentParent) {
864 | return [];
865 | }
866 | var node = currentParent;
867 | var ret = [];
868 | while (true) {
869 | if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionalComponent) {
870 | var publicInst = node.stateNode;
871 | if (test(publicInst)) {
872 | ret.push(publicInst);
873 | }
874 | }
875 | if (node.child) {
876 | node.child.return = node;
877 | node = node.child;
878 | continue;
879 | }
880 | if (node === currentParent) {
881 | return ret;
882 | }
883 | while (!node.sibling) {
884 | if (!node.return || node.return === currentParent) {
885 | return ret;
886 | }
887 | node = node.return;
888 | }
889 | node.sibling.return = node.return;
890 | node = node.sibling;
891 | }
892 | }
893 |
894 | /**
895 | * Utilities for making it easy to test React components.
896 | *
897 | * See https://reactjs.org/docs/test-utils.html
898 | *
899 | * Todo: Support the entire DOM.scry query syntax. For now, these simple
900 | * utilities will suffice for testing purposes.
901 | * @lends ReactTestUtils
902 | */
903 | var ReactTestUtils = {
904 | renderIntoDocument: function (element) {
905 | var div = document.createElement('div');
906 | // None of our tests actually require attaching the container to the
907 | // DOM, and doing so creates a mess that we rely on test isolation to
908 | // clean up, so we're going to stop honoring the name of this method
909 | // (and probably rename it eventually) if no problems arise.
910 | // document.documentElement.appendChild(div);
911 | return ReactDOM.render(element, div);
912 | },
913 |
914 | isElement: function (element) {
915 | return React.isValidElement(element);
916 | },
917 |
918 | isElementOfType: function (inst, convenienceConstructor) {
919 | return React.isValidElement(inst) && inst.type === convenienceConstructor;
920 | },
921 |
922 | isDOMComponent: function (inst) {
923 | return !!(inst && inst.nodeType === 1 && inst.tagName);
924 | },
925 |
926 | isDOMComponentElement: function (inst) {
927 | return !!(inst && React.isValidElement(inst) && !!inst.tagName);
928 | },
929 |
930 | isCompositeComponent: function (inst) {
931 | if (ReactTestUtils.isDOMComponent(inst)) {
932 | // Accessing inst.setState warns; just return false as that'll be what
933 | // this returns when we have DOM nodes as refs directly
934 | return false;
935 | }
936 | return inst != null && typeof inst.render === 'function' && typeof inst.setState === 'function';
937 | },
938 |
939 | isCompositeComponentWithType: function (inst, type) {
940 | if (!ReactTestUtils.isCompositeComponent(inst)) {
941 | return false;
942 | }
943 | var internalInstance = get(inst);
944 | var constructor = internalInstance.type;
945 | return constructor === type;
946 | },
947 |
948 | findAllInRenderedTree: function (inst, test) {
949 | if (!inst) {
950 | return [];
951 | }
952 | !ReactTestUtils.isCompositeComponent(inst) ? invariant(false, 'findAllInRenderedTree(...): instance must be a composite component') : void 0;
953 | var internalInstance = get(inst);
954 | return findAllInRenderedFiberTreeInternal(internalInstance, test);
955 | },
956 |
957 | /**
958 | * Finds all instance of components in the rendered tree that are DOM
959 | * components with the class name matching `className`.
960 | * @return {array} an array of all the matches.
961 | */
962 | scryRenderedDOMComponentsWithClass: function (root, classNames) {
963 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
964 | if (ReactTestUtils.isDOMComponent(inst)) {
965 | var className = inst.className;
966 | if (typeof className !== 'string') {
967 | // SVG, probably.
968 | className = inst.getAttribute('class') || '';
969 | }
970 | var classList = className.split(/\s+/);
971 |
972 | if (!Array.isArray(classNames)) {
973 | !(classNames !== undefined) ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : void 0;
974 | classNames = classNames.split(/\s+/);
975 | }
976 | return classNames.every(function (name) {
977 | return classList.indexOf(name) !== -1;
978 | });
979 | }
980 | return false;
981 | });
982 | },
983 |
984 | /**
985 | * Like scryRenderedDOMComponentsWithClass but expects there to be one result,
986 | * and returns that one result, or throws exception if there is any other
987 | * number of matches besides one.
988 | * @return {!ReactDOMComponent} The one match.
989 | */
990 | findRenderedDOMComponentWithClass: function (root, className) {
991 | var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
992 | if (all.length !== 1) {
993 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
994 | }
995 | return all[0];
996 | },
997 |
998 | /**
999 | * Finds all instance of components in the rendered tree that are DOM
1000 | * components with the tag name matching `tagName`.
1001 | * @return {array} an array of all the matches.
1002 | */
1003 | scryRenderedDOMComponentsWithTag: function (root, tagName) {
1004 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
1005 | return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
1006 | });
1007 | },
1008 |
1009 | /**
1010 | * Like scryRenderedDOMComponentsWithTag but expects there to be one result,
1011 | * and returns that one result, or throws exception if there is any other
1012 | * number of matches besides one.
1013 | * @return {!ReactDOMComponent} The one match.
1014 | */
1015 | findRenderedDOMComponentWithTag: function (root, tagName) {
1016 | var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
1017 | if (all.length !== 1) {
1018 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
1019 | }
1020 | return all[0];
1021 | },
1022 |
1023 | /**
1024 | * Finds all instances of components with type equal to `componentType`.
1025 | * @return {array} an array of all the matches.
1026 | */
1027 | scryRenderedComponentsWithType: function (root, componentType) {
1028 | return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
1029 | return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
1030 | });
1031 | },
1032 |
1033 | /**
1034 | * Same as `scryRenderedComponentsWithType` but expects there to be one result
1035 | * and returns that one result, or throws exception if there is any other
1036 | * number of matches besides one.
1037 | * @return {!ReactComponent} The one match.
1038 | */
1039 | findRenderedComponentWithType: function (root, componentType) {
1040 | var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
1041 | if (all.length !== 1) {
1042 | throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
1043 | }
1044 | return all[0];
1045 | },
1046 |
1047 | /**
1048 | * Pass a mocked component module to this method to augment it with
1049 | * useful methods that allow it to be used as a dummy React component.
1050 | * Instead of rendering as usual, the component will become a simple
1051 | * containing any provided children.
1052 | *
1053 | * @param {object} module the mock function object exported from a
1054 | * module that defines the component to be mocked
1055 | * @param {?string} mockTagName optional dummy root tag name to return
1056 | * from render method (overrides
1057 | * module.mockTagName if provided)
1058 | * @return {object} the ReactTestUtils object (for chaining)
1059 | */
1060 | mockComponent: function (module, mockTagName) {
1061 | if (!hasWarnedAboutDeprecatedMockComponent) {
1062 | hasWarnedAboutDeprecatedMockComponent = true;
1063 | lowPriorityWarning$1(false, 'ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.');
1064 | }
1065 |
1066 | mockTagName = mockTagName || module.mockTagName || 'div';
1067 |
1068 | module.prototype.render.mockImplementation(function () {
1069 | return React.createElement(mockTagName, null, this.props.children);
1070 | });
1071 |
1072 | return this;
1073 | },
1074 |
1075 | nativeTouchData: function (x, y) {
1076 | return {
1077 | touches: [{ pageX: x, pageY: y }]
1078 | };
1079 | },
1080 |
1081 | Simulate: null,
1082 | SimulateNative: {}
1083 | };
1084 |
1085 | /**
1086 | * Exports:
1087 | *
1088 | * - `ReactTestUtils.Simulate.click(Element)`
1089 | * - `ReactTestUtils.Simulate.mouseMove(Element)`
1090 | * - `ReactTestUtils.Simulate.change(Element)`
1091 | * - ... (All keys from event plugin `eventTypes` objects)
1092 | */
1093 | function makeSimulator(eventType) {
1094 | return function (domNode, eventData) {
1095 | !!React.isValidElement(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.') : void 0;
1096 | !!ReactTestUtils.isCompositeComponent(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.') : void 0;
1097 |
1098 | var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
1099 |
1100 | var fakeNativeEvent = new Event();
1101 | fakeNativeEvent.target = domNode;
1102 | fakeNativeEvent.type = eventType.toLowerCase();
1103 |
1104 | // We don't use SyntheticEvent.getPooled in order to not have to worry about
1105 | // properly destroying any properties assigned from `eventData` upon release
1106 | var targetInst = ReactDOMComponentTree.getInstanceFromNode(domNode);
1107 | var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode);
1108 |
1109 | // Since we aren't using pooling, always persist the event. This will make
1110 | // sure it's marked and won't warn when setting additional properties.
1111 | event.persist();
1112 | _assign(event, eventData);
1113 |
1114 | if (dispatchConfig.phasedRegistrationNames) {
1115 | EventPropagators.accumulateTwoPhaseDispatches(event);
1116 | } else {
1117 | EventPropagators.accumulateDirectDispatches(event);
1118 | }
1119 |
1120 | ReactDOM.unstable_batchedUpdates(function () {
1121 | // Normally extractEvent enqueues a state restore, but we'll just always
1122 | // do that since we we're by-passing it here.
1123 | ReactControlledComponent.enqueueStateRestore(domNode);
1124 | EventPluginHub.runEventsInBatch(event, true);
1125 | });
1126 | ReactControlledComponent.restoreStateIfNeeded();
1127 | };
1128 | }
1129 |
1130 | function buildSimulators() {
1131 | ReactTestUtils.Simulate = {};
1132 |
1133 | var eventType = void 0;
1134 | for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
1135 | /**
1136 | * @param {!Element|ReactDOMComponent} domComponentOrNode
1137 | * @param {?object} eventData Fake event data to use in SyntheticEvent.
1138 | */
1139 | ReactTestUtils.Simulate[eventType] = makeSimulator(eventType);
1140 | }
1141 | }
1142 |
1143 | // Rebuild ReactTestUtils.Simulate whenever event plugins are injected
1144 | var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
1145 | EventPluginHub.injection.injectEventPluginOrder = function () {
1146 | oldInjectEventPluginOrder.apply(this, arguments);
1147 | buildSimulators();
1148 | };
1149 | var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
1150 | EventPluginHub.injection.injectEventPluginsByName = function () {
1151 | oldInjectEventPlugins.apply(this, arguments);
1152 | buildSimulators();
1153 | };
1154 |
1155 | buildSimulators();
1156 |
1157 | /**
1158 | * Exports:
1159 | *
1160 | * - `ReactTestUtils.SimulateNative.click(Element/ReactDOMComponent)`
1161 | * - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
1162 | * - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
1163 | * - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
1164 | * - ... (All keys from `BrowserEventConstants.topLevelTypes`)
1165 | *
1166 | * Note: Top level event types are a subset of the entire set of handler types
1167 | * (which include a broader set of "synthetic" events). For example, onDragDone
1168 | * is a synthetic event. Except when testing an event plugin or React's event
1169 | * handling code specifically, you probably want to use ReactTestUtils.Simulate
1170 | * to dispatch synthetic events.
1171 | */
1172 |
1173 | function makeNativeSimulator(eventType, topLevelType) {
1174 | return function (domComponentOrNode, nativeEventData) {
1175 | var fakeNativeEvent = new Event(eventType);
1176 | _assign(fakeNativeEvent, nativeEventData);
1177 | if (ReactTestUtils.isDOMComponent(domComponentOrNode)) {
1178 | simulateNativeEventOnDOMComponent(topLevelType, domComponentOrNode, fakeNativeEvent);
1179 | } else if (domComponentOrNode.tagName) {
1180 | // Will allow on actual dom nodes.
1181 | simulateNativeEventOnNode(topLevelType, domComponentOrNode, fakeNativeEvent);
1182 | }
1183 | };
1184 | }
1185 |
1186 | [[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_BLUR, 'blur'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CANCEL, 'cancel'], [TOP_CHANGE, 'change'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_COMPOSITION_END, 'compositionEnd'], [TOP_COMPOSITION_START, 'compositionStart'], [TOP_COMPOSITION_UPDATE, 'compositionUpdate'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DRAG_START, 'dragStart'], [TOP_DRAG, 'drag'], [TOP_DROP, 'drop'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD_START, 'loadStart'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_PLAYING, 'playing'], [TOP_PROGRESS, 'progress'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_SCROLL, 'scroll'], [TOP_SEEKED, 'seeked'], [TOP_SEEKING, 'seeking'], [TOP_SELECTION_CHANGE, 'selectionChange'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TEXT_INPUT, 'textInput'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TOUCH_START, 'touchStart'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_VOLUME_CHANGE, 'volumeChange'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']].forEach(function (_ref) {
1187 | var topLevelType = _ref[0],
1188 | eventType = _ref[1];
1189 |
1190 | /**
1191 | * @param {!Element|ReactDOMComponent} domComponentOrNode
1192 | * @param {?Event} nativeEventData Fake native event to use in SyntheticEvent.
1193 | */
1194 | ReactTestUtils.SimulateNative[eventType] = makeNativeSimulator(eventType, topLevelType);
1195 | });
1196 |
1197 |
1198 |
1199 | var ReactTestUtils$2 = Object.freeze({
1200 | default: ReactTestUtils
1201 | });
1202 |
1203 | var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$2;
1204 |
1205 | // TODO: decide on the top-level export form.
1206 | // This is hacky but makes it work with both Rollup and Jest.
1207 | var testUtils = ReactTestUtils$3.default ? ReactTestUtils$3.default : ReactTestUtils$3;
1208 |
1209 | return testUtils;
1210 |
1211 | })));
1212 |
--------------------------------------------------------------------------------
/vendor/react-dom-test-utils.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.4.1
2 | * react-dom-test-utils.production.min.js
3 | *
4 | * Copyright (c) 2013-present, Facebook, Inc.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';(function(k,n){"object"===typeof exports&&"undefined"!==typeof module?module.exports=n(require("react"),require("react-dom")):"function"===typeof define&&define.amd?define(["react","react-dom"],n):k.ReactTestUtils=n(k.React,k.ReactDOM)})(this,function(k,n){function B(a,b,c,e,d,f,g,h){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=[c,e,d,f,g,h],k=0;a=Error(b.replace(/%s/g,
10 | function(){return L[k++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function m(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,e=0;e
this.eventPool.length&&this.eventPool.push(a)}function E(a){a.eventPool=[];a.getPooled=N;a.release=O}function x(a,b){var c={};c[a.toLowerCase()]=
14 | b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}function y(a){if(z[a])return z[a];if(!p[a])return a;var b=p[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in F)return z[a]=b[c];return a}function G(a){}function P(a,b){if(!a)return[];a=M(a);if(!a)return[];for(var c=a,e=[];;){if(5===c.tag||6===c.tag||2===c.tag||1===c.tag){var d=c.stateNode;b(d)&&e.push(d)}if(c.child)c.child.return=c,c=c.child;else{if(c===a)return e;for(;!c.sibling;){if(!c.return||c.return===a)return e;c=c.return}c.sibling.return=
15 | c.return;c=c.sibling}}}function Q(a){return function(b,c){k.isValidElement(b)?m("228"):void 0;f.isCompositeComponent(b)?m("229"):void 0;var e=H.eventNameDispatchConfigs[a],d=new G;d.target=b;d.type=a.toLowerCase();var l=R.getInstanceFromNode(b),g=new r(e,l,d,b);g.persist();t(g,c);e.phasedRegistrationNames?I.accumulateTwoPhaseDispatches(g):I.accumulateDirectDispatches(g);n.unstable_batchedUpdates(function(){J.enqueueStateRestore(b);u.runEventsInBatch(g,!0)});J.restoreStateIfNeeded()}}function A(){f.Simulate=
16 | {};var a=void 0;for(a in H.eventNameDispatchConfigs)f.Simulate[a]=Q(a)}function S(a,b){return function(c,e){var d=new G(a);t(d,e);f.isDOMComponent(c)?(c=T(c),d.target=c,K.dispatchEvent(b,d)):c.tagName&&(d.target=c,K.dispatchEvent(b,d))}}var t=k.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;t(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=
17 | v)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=v)},persist:function(){this.isPersistent=v},isPersistent:w,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=w;this._dispatchInstances=this._dispatchListeners=null}});r.Interface={type:null,
18 | target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};r.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,e=function(){};e.prototype=c.prototype;e=new e;t(e,b.prototype);b.prototype=e;b.prototype.constructor=b;b.Interface=t({},c.Interface,a);b.extend=c.extend;E(b);return b};E(r);var l=!("undefined"===typeof window||!window.document||!window.document.createElement),
19 | p={animationend:x("Animation","AnimationEnd"),animationiteration:x("Animation","AnimationIteration"),animationstart:x("Animation","AnimationStart"),transitionend:x("Transition","TransitionEnd")},z={},F={};l&&(F=document.createElement("div").style,"AnimationEvent"in window||(delete p.animationend.animation,delete p.animationiteration.animation,delete p.animationstart.animation),"TransitionEvent"in window||delete p.transitionend.transition);l=y("animationend");var U=y("animationiteration"),V=y("animationstart"),
20 | W=y("transitionend"),T=n.findDOMNode,q=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=q.EventPluginHub,H=q.EventPluginRegistry,I=q.EventPropagators,J=q.ReactControlledComponent,R=q.ReactDOMComponentTree,K=q.ReactDOMEventListener,f={renderIntoDocument:function(a){var b=document.createElement("div");return n.render(a,b)},isElement:function(a){return k.isValidElement(a)},isElementOfType:function(a,b){return k.isValidElement(a)&&a.type===b},isDOMComponent:function(a){return!(!a||1!==a.nodeType||
21 | !a.tagName)},isDOMComponentElement:function(a){return!!(a&&k.isValidElement(a)&&a.tagName)},isCompositeComponent:function(a){return f.isDOMComponent(a)?!1:null!=a&&"function"===typeof a.render&&"function"===typeof a.setState},isCompositeComponentWithType:function(a,b){return f.isCompositeComponent(a)?a._reactInternalFiber.type===b:!1},findAllInRenderedTree:function(a,b){if(!a)return[];f.isCompositeComponent(a)?void 0:m("10");return P(a._reactInternalFiber,b)},scryRenderedDOMComponentsWithClass:function(a,
22 | b){return f.findAllInRenderedTree(a,function(a){if(f.isDOMComponent(a)){var c=a.className;"string"!==typeof c&&(c=a.getAttribute("class")||"");var d=c.split(/\s+/);Array.isArray(b)||(void 0===b?m("11"):void 0,b=b.split(/\s+/));return b.every(function(a){return-1!==d.indexOf(a)})}return!1})},findRenderedDOMComponentWithClass:function(a,b){a=f.scryRenderedDOMComponentsWithClass(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for class:"+b);return a[0]},scryRenderedDOMComponentsWithTag:function(a,
23 | b){return f.findAllInRenderedTree(a,function(a){return f.isDOMComponent(a)&&a.tagName.toUpperCase()===b.toUpperCase()})},findRenderedDOMComponentWithTag:function(a,b){a=f.scryRenderedDOMComponentsWithTag(a,b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for tag:"+b);return a[0]},scryRenderedComponentsWithType:function(a,b){return f.findAllInRenderedTree(a,function(a){return f.isCompositeComponentWithType(a,b)})},findRenderedComponentWithType:function(a,b){a=f.scryRenderedComponentsWithType(a,
24 | b);if(1!==a.length)throw Error("Did not find exactly one match (found: "+a.length+") for componentType:"+b);return a[0]},mockComponent:function(a,b){b=b||a.mockTagName||"div";a.prototype.render.mockImplementation(function(){return k.createElement(b,null,this.props.children)});return this},nativeTouchData:function(a,b){return{touches:[{pageX:a,pageY:b}]}},Simulate:null,SimulateNative:{}},X=u.injection.injectEventPluginOrder;u.injection.injectEventPluginOrder=function(){X.apply(this,arguments);A()};
25 | var Y=u.injection.injectEventPluginsByName;u.injection.injectEventPluginsByName=function(){Y.apply(this,arguments);A()};A();[["abort","abort"],[l,"animationEnd"],[U,"animationIteration"],[V,"animationStart"],["blur","blur"],["canplaythrough","canPlayThrough"],["canplay","canPlay"],["cancel","cancel"],["change","change"],["click","click"],["close","close"],["compositionend","compositionEnd"],["compositionstart","compositionStart"],["compositionupdate","compositionUpdate"],["contextmenu","contextMenu"],
26 | ["copy","copy"],["cut","cut"],["dblclick","doubleClick"],["dragend","dragEnd"],["dragenter","dragEnter"],["dragexit","dragExit"],["dragleave","dragLeave"],["dragover","dragOver"],["dragstart","dragStart"],["drag","drag"],["drop","drop"],["durationchange","durationChange"],["emptied","emptied"],["encrypted","encrypted"],["ended","ended"],["error","error"],["focus","focus"],["input","input"],["keydown","keyDown"],["keypress","keyPress"],["keyup","keyUp"],["loadstart","loadStart"],["loadstart","loadStart"],
27 | ["load","load"],["loadeddata","loadedData"],["loadedmetadata","loadedMetadata"],["mousedown","mouseDown"],["mousemove","mouseMove"],["mouseout","mouseOut"],["mouseover","mouseOver"],["mouseup","mouseUp"],["paste","paste"],["pause","pause"],["play","play"],["playing","playing"],["progress","progress"],["ratechange","rateChange"],["scroll","scroll"],["seeked","seeked"],["seeking","seeking"],["selectionchange","selectionChange"],["stalled","stalled"],["suspend","suspend"],["textInput","textInput"],["timeupdate",
28 | "timeUpdate"],["toggle","toggle"],["touchcancel","touchCancel"],["touchend","touchEnd"],["touchmove","touchMove"],["touchstart","touchStart"],[W,"transitionEnd"],["volumechange","volumeChange"],["waiting","waiting"],["wheel","wheel"]].forEach(function(a){var b=a[1];f.SimulateNative[b]=S(b,a[0])});l=(l={default:f},f)||l;return l.default?l.default:l});
29 |
--------------------------------------------------------------------------------
/vendor/react-dom-unstable-native-dependencies.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.4.1
2 | * react-dom-unstable-native-dependencies.production.min.js
3 | *
4 | * Copyright (c) 2013-present, Facebook, Inc.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';(function(x,n){"object"===typeof exports&&"undefined"!==typeof module?module.exports=n(require("react-dom"),require("react")):"function"===typeof define&&define.amd?define(["react-dom","react"],n):x.ReactDOMUnstableNativeDependencies=n(x.ReactDOM,x.React)})(this,function(x,n){function M(a,b,c,f,e,d,g,h){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 k=[c,f,
10 | e,d,g,h],m=0;a=Error(b.replace(/%s/g,function(){return k[m++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function y(a){for(var b=arguments.length-1,c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=0;fthis.eventPool.length&&this.eventPool.push(a)}function T(a){a.eventPool=[];a.getPooled=ba;a.release=ca}function A(a){return"touchstart"===a||"mousedown"===
16 | a}function F(a){return"touchmove"===a||"mousemove"===a}function G(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a}function l(a){return a.timeStamp||a.timestamp}function J(a){a=a.identifier;null==a?y("138"):void 0;return a}function da(a){var b=J(a),c=p[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=l(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=l(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=l(a)):(c={touchActive:!0,
17 | startPageX:a.pageX,startPageY:a.pageY,startTimeStamp:l(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:l(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:l(a)},p[b]=c);q.mostRecentTimeStamp=l(a)}function ea(a){var b=p[J(a)];b?(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=l(a),q.mostRecentTimeStamp=l(a)):console.error("Cannot record touch move without a touch start.\nTouch Move: %s\n",
18 | "Touch Bank: %s",U(a),V())}function fa(a){var b=p[J(a)];b?(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=l(a),q.mostRecentTimeStamp=l(a)):console.error("Cannot record touch end without a touch start.\nTouch End: %s\n","Touch Bank: %s",U(a),V())}function U(a){return JSON.stringify({identifier:a.identifier,pageX:a.pageX,pageY:a.pageY,timestamp:l(a)})}function V(){var a=
19 | JSON.stringify(p.slice(0,20));20 0 ? remaining : 0;
160 | }
161 | };
162 |
163 | /**
164 | * Handles the case where a callback errors:
165 | * - don't catch the error, because this changes debugging behavior
166 | * - do start a new postMessage callback, to call any remaining callbacks,
167 | * - but only if there is an error, so there is not extra overhead.
168 | */
169 | var callUnsafely = function (callbackConfig, arg) {
170 | var callback = callbackConfig.scheduledCallback;
171 | var finishedCalling = false;
172 | try {
173 | callback(arg);
174 | finishedCalling = true;
175 | } finally {
176 | // always remove it from linked list
177 | exports.cancelScheduledWork(callbackConfig);
178 |
179 | if (!finishedCalling) {
180 | // an error must have been thrown
181 | isIdleScheduled = true;
182 | window.postMessage(messageKey, '*');
183 | }
184 | }
185 | };
186 |
187 | /**
188 | * Checks for timed out callbacks, runs them, and then checks again to see if
189 | * any more have timed out.
190 | * Keeps doing this until there are none which have currently timed out.
191 | */
192 | var callTimedOutCallbacks = function () {
193 | if (headOfPendingCallbacksLinkedList === null) {
194 | return;
195 | }
196 |
197 | var currentTime = exports.now();
198 | // TODO: this would be more efficient if deferred callbacks are stored in
199 | // min heap.
200 | // Or in a linked list with links for both timeoutTime order and insertion
201 | // order.
202 | // For now an easy compromise is the current approach:
203 | // Keep a pointer to the soonest timeoutTime, and check that first.
204 | // If it has not expired, we can skip traversing the whole list.
205 | // If it has expired, then we step through all the callbacks.
206 | if (nextSoonestTimeoutTime === -1 || nextSoonestTimeoutTime > currentTime) {
207 | // We know that none of them have timed out yet.
208 | return;
209 | }
210 | // NOTE: we intentionally wait to update the nextSoonestTimeoutTime until
211 | // after successfully calling any timed out callbacks.
212 | // If a timed out callback throws an error, we could get stuck in a state
213 | // where the nextSoonestTimeoutTime was set wrong.
214 | var updatedNextSoonestTimeoutTime = -1; // we will update nextSoonestTimeoutTime below
215 | var timedOutCallbacks = [];
216 |
217 | // iterate once to find timed out callbacks and find nextSoonestTimeoutTime
218 | var currentCallbackConfig = headOfPendingCallbacksLinkedList;
219 | while (currentCallbackConfig !== null) {
220 | var _timeoutTime = currentCallbackConfig.timeoutTime;
221 | if (_timeoutTime !== -1 && _timeoutTime <= currentTime) {
222 | // it has timed out!
223 | timedOutCallbacks.push(currentCallbackConfig);
224 | } else {
225 | if (_timeoutTime !== -1 && (updatedNextSoonestTimeoutTime === -1 || _timeoutTime < updatedNextSoonestTimeoutTime)) {
226 | updatedNextSoonestTimeoutTime = _timeoutTime;
227 | }
228 | }
229 | currentCallbackConfig = currentCallbackConfig.next;
230 | }
231 |
232 | if (timedOutCallbacks.length > 0) {
233 | frameDeadlineObject.didTimeout = true;
234 | for (var i = 0, len = timedOutCallbacks.length; i < len; i++) {
235 | callUnsafely(timedOutCallbacks[i], frameDeadlineObject);
236 | }
237 | }
238 |
239 | // NOTE: we intentionally wait to update the nextSoonestTimeoutTime until
240 | // after successfully calling any timed out callbacks.
241 | nextSoonestTimeoutTime = updatedNextSoonestTimeoutTime;
242 | };
243 |
244 | // We use the postMessage trick to defer idle work until after the repaint.
245 | var messageKey = '__reactIdleCallback$' + Math.random().toString(36).slice(2);
246 | var idleTick = function (event) {
247 | if (event.source !== window || event.data !== messageKey) {
248 | return;
249 | }
250 | isIdleScheduled = false;
251 |
252 | if (headOfPendingCallbacksLinkedList === null) {
253 | return;
254 | }
255 |
256 | // First call anything which has timed out, until we have caught up.
257 | callTimedOutCallbacks();
258 |
259 | var currentTime = exports.now();
260 | // Next, as long as we have idle time, try calling more callbacks.
261 | while (frameDeadline - currentTime > 0 && headOfPendingCallbacksLinkedList !== null) {
262 | var latestCallbackConfig = headOfPendingCallbacksLinkedList;
263 | frameDeadlineObject.didTimeout = false;
264 | // callUnsafely will remove it from the head of the linked list
265 | callUnsafely(latestCallbackConfig, frameDeadlineObject);
266 | currentTime = exports.now();
267 | }
268 | if (headOfPendingCallbacksLinkedList !== null) {
269 | if (!isAnimationFrameScheduled) {
270 | // Schedule another animation callback so we retry later.
271 | isAnimationFrameScheduled = true;
272 | scheduleAnimationFrameWithFallbackSupport(animationTick);
273 | }
274 | }
275 | };
276 | // Assumes that we have addEventListener in this environment. Might need
277 | // something better for old IE.
278 | window.addEventListener('message', idleTick, false);
279 |
280 | var animationTick = function (rafTime) {
281 | isAnimationFrameScheduled = false;
282 | var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
283 | if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
284 | if (nextFrameTime < 8) {
285 | // Defensive coding. We don't support higher frame rates than 120hz.
286 | // If we get lower than that, it is probably a bug.
287 | nextFrameTime = 8;
288 | }
289 | // If one frame goes long, then the next one can be short to catch up.
290 | // If two frames are short in a row, then that's an indication that we
291 | // actually have a higher frame rate than what we're currently optimizing.
292 | // We adjust our heuristic dynamically accordingly. For example, if we're
293 | // running on 120hz display or 90hz VR display.
294 | // Take the max of the two in case one of them was an anomaly due to
295 | // missed frame deadlines.
296 | activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;
297 | } else {
298 | previousFrameTime = nextFrameTime;
299 | }
300 | frameDeadline = rafTime + activeFrameTime;
301 | if (!isIdleScheduled) {
302 | isIdleScheduled = true;
303 | window.postMessage(messageKey, '*');
304 | }
305 | };
306 |
307 | exports.scheduleWork = function (callback, options) /* CallbackConfigType */{
308 | var timeoutTime = -1;
309 | if (options != null && typeof options.timeout === 'number') {
310 | timeoutTime = exports.now() + options.timeout;
311 | }
312 | if (nextSoonestTimeoutTime === -1 || timeoutTime !== -1 && timeoutTime < nextSoonestTimeoutTime) {
313 | nextSoonestTimeoutTime = timeoutTime;
314 | }
315 |
316 | var scheduledCallbackConfig = {
317 | scheduledCallback: callback,
318 | timeoutTime: timeoutTime,
319 | prev: null,
320 | next: null
321 | };
322 | if (headOfPendingCallbacksLinkedList === null) {
323 | // Make this callback the head and tail of our list
324 | headOfPendingCallbacksLinkedList = scheduledCallbackConfig;
325 | tailOfPendingCallbacksLinkedList = scheduledCallbackConfig;
326 | } else {
327 | // Add latest callback as the new tail of the list
328 | scheduledCallbackConfig.prev = tailOfPendingCallbacksLinkedList;
329 | // renaming for clarity
330 | var oldTailOfPendingCallbacksLinkedList = tailOfPendingCallbacksLinkedList;
331 | if (oldTailOfPendingCallbacksLinkedList !== null) {
332 | oldTailOfPendingCallbacksLinkedList.next = scheduledCallbackConfig;
333 | }
334 | tailOfPendingCallbacksLinkedList = scheduledCallbackConfig;
335 | }
336 |
337 | if (!isAnimationFrameScheduled) {
338 | // If rAF didn't already schedule one, we need to schedule a frame.
339 | // TODO: If this rAF doesn't materialize because the browser throttles, we
340 | // might want to still have setTimeout trigger scheduleWork as a backup to ensure
341 | // that we keep performing work.
342 | isAnimationFrameScheduled = true;
343 | scheduleAnimationFrameWithFallbackSupport(animationTick);
344 | }
345 | return scheduledCallbackConfig;
346 | };
347 |
348 | exports.cancelScheduledWork = function (callbackConfig /* CallbackConfigType */
349 | ) {
350 | if (callbackConfig.prev === null && headOfPendingCallbacksLinkedList !== callbackConfig) {
351 | // this callbackConfig has already been cancelled.
352 | // cancelScheduledWork should be idempotent, a no-op after first call.
353 | return;
354 | }
355 |
356 | /**
357 | * There are four possible cases:
358 | * - Head/nodeToRemove/Tail -> null
359 | * In this case we set Head and Tail to null.
360 | * - Head -> ... middle nodes... -> Tail/nodeToRemove
361 | * In this case we point the middle.next to null and put middle as the new
362 | * Tail.
363 | * - Head/nodeToRemove -> ...middle nodes... -> Tail
364 | * In this case we point the middle.prev at null and move the Head to
365 | * middle.
366 | * - Head -> ... ?some nodes ... -> nodeToRemove -> ... ?some nodes ... -> Tail
367 | * In this case we point the Head.next to the Tail and the Tail.prev to
368 | * the Head.
369 | */
370 | var next = callbackConfig.next;
371 | var prev = callbackConfig.prev;
372 | callbackConfig.next = null;
373 | callbackConfig.prev = null;
374 | if (next !== null) {
375 | // we have a next
376 |
377 | if (prev !== null) {
378 | // we have a prev
379 |
380 | // callbackConfig is somewhere in the middle of a list of 3 or more nodes.
381 | prev.next = next;
382 | next.prev = prev;
383 | return;
384 | } else {
385 | // there is a next but not a previous one;
386 | // callbackConfig is the head of a list of 2 or more other nodes.
387 | next.prev = null;
388 | headOfPendingCallbacksLinkedList = next;
389 | return;
390 | }
391 | } else {
392 | // there is no next callback config; this must the tail of the list
393 |
394 | if (prev !== null) {
395 | // we have a prev
396 |
397 | // callbackConfig is the tail of a list of 2 or more other nodes.
398 | prev.next = null;
399 | tailOfPendingCallbacksLinkedList = prev;
400 | return;
401 | } else {
402 | // there is no previous callback config;
403 | // callbackConfig is the only thing in the linked list,
404 | // so both head and tail point to it.
405 | headOfPendingCallbacksLinkedList = null;
406 | tailOfPendingCallbacksLinkedList = null;
407 | return;
408 | }
409 | }
410 | };
411 | }
412 |
413 | Object.defineProperty(exports, '__esModule', { value: true });
414 |
415 | })));
416 |
--------------------------------------------------------------------------------
/vendor/react-scheduler.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.4.1
2 | * react-scheduler.production.min.js
3 | *
4 | * Copyright (c) 2013-present, Facebook, Inc.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';(function(d,f){"object"===typeof exports&&"undefined"!==typeof module?f(exports):"function"===typeof define&&define.amd?define(["exports"],f):f(d.ReactScheduler={})})(this,function(d){var f=!("undefined"===typeof window||!window.document||!window.document.createElement),C=Date,v="function"===typeof setTimeout?setTimeout:void 0,w="function"===typeof clearTimeout?clearTimeout:void 0,D="function"===typeof requestAnimationFrame?requestAnimationFrame:void 0,E="function"===typeof cancelAnimationFrame?
10 | cancelAnimationFrame:void 0,F="object"===typeof performance&&"function"===typeof performance.now;d.now=void 0;if(F){var G=performance;d.now=function(){return G.now()}}else d.now=function(){return C.now()};d.scheduleWork=void 0;d.cancelScheduledWork=void 0;if(f){var e=null,m=null,h=-1,n=!1,k=!1,x=void 0,y=void 0,z=function(a){x=D(function(b){w(y);a(b)});y=v(function(){E(x);a(d.now())},100)},p=0,q=33,l=33,r={didTimeout:!1,timeRemaining:function(){var a=p-d.now();return 0b)){a=-1;for(var c=[],g=e;null!==g;){var f=g.timeoutTime;-1!==f&&f<=b?c.push(g):-1!==f&&(-1===a||fb&&(b=8),l=b 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
150 | args[_key - 2] = arguments[_key];
151 | }
152 |
153 | if (format === undefined) {
154 | throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
155 | }
156 | if (condition) {
157 | return;
158 | }
159 | if (typeof console !== 'undefined') {
160 | var _console;
161 |
162 | (_console = console).error.apply(_console, ['Warning: ' + format].concat(args));
163 | }
164 | try {
165 | // --- Welcome to debugging React ---
166 | // This error was thrown as a convenience so that you can use this stack
167 | // to find the callsite that caused this warning to fire.
168 | var argIndex = 0;
169 | var message = 'Warning: ' + format.replace(/%s/g, function () {
170 | return args[argIndex++];
171 | });
172 | throw new Error(message);
173 | } catch (x) {}
174 | };
175 | }
176 |
177 | var warningWithoutStack$1 = warningWithoutStack;
178 |
179 | function getComponentName(type) {
180 | if (type == null) {
181 | // Host root, text node or just invalid type.
182 | return null;
183 | }
184 | {
185 | if (typeof type.tag === 'number') {
186 | warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
187 | }
188 | }
189 | if (typeof type === 'function') {
190 | return type.displayName || type.name || null;
191 | }
192 | if (typeof type === 'string') {
193 | return type;
194 | }
195 | switch (type) {
196 | case REACT_ASYNC_MODE_TYPE:
197 | return 'AsyncMode';
198 | case REACT_FRAGMENT_TYPE:
199 | return 'Fragment';
200 | case REACT_PORTAL_TYPE:
201 | return 'Portal';
202 | case REACT_PROFILER_TYPE:
203 | return 'Profiler';
204 | case REACT_STRICT_MODE_TYPE:
205 | return 'StrictMode';
206 | case REACT_PLACEHOLDER_TYPE:
207 | return 'Placeholder';
208 | }
209 | if (typeof type === 'object') {
210 | switch (type.$$typeof) {
211 | case REACT_CONTEXT_TYPE:
212 | return 'Context.Consumer';
213 | case REACT_PROVIDER_TYPE:
214 | return 'Context.Provider';
215 | case REACT_FORWARD_REF_TYPE:
216 | var renderFn = type.render;
217 | var functionName = renderFn.displayName || renderFn.name || '';
218 | return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
219 | }
220 | }
221 | return null;
222 | }
223 |
224 | /*eslint-disable no-self-compare */
225 |
226 | var hasOwnProperty = Object.prototype.hasOwnProperty;
227 |
228 | /**
229 | * inlined Object.is polyfill to avoid requiring consumers ship their own
230 | * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
231 | */
232 | function is(x, y) {
233 | // SameValue algorithm
234 | if (x === y) {
235 | // Steps 1-5, 7-10
236 | // Steps 6.b-6.e: +0 != -0
237 | // Added the nonzero y check to make Flow happy, but it is redundant
238 | return x !== 0 || y !== 0 || 1 / x === 1 / y;
239 | } else {
240 | // Step 6.a: NaN == NaN
241 | return x !== x && y !== y;
242 | }
243 | }
244 |
245 | /**
246 | * Performs equality by iterating through keys on an object and returning false
247 | * when any key has values which are not strictly equal between the arguments.
248 | * Returns true when the values of all keys are strictly equal.
249 | */
250 | function shallowEqual(objA, objB) {
251 | if (is(objA, objB)) {
252 | return true;
253 | }
254 |
255 | if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
256 | return false;
257 | }
258 |
259 | var keysA = Object.keys(objA);
260 | var keysB = Object.keys(objB);
261 |
262 | if (keysA.length !== keysB.length) {
263 | return false;
264 | }
265 |
266 | // Test for A's keys different from B.
267 | for (var i = 0; i < keysA.length; i++) {
268 | if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
269 | return false;
270 | }
271 | }
272 |
273 | return true;
274 | }
275 |
276 | /**
277 | * Copyright (c) 2013-present, Facebook, Inc.
278 | *
279 | * This source code is licensed under the MIT license found in the
280 | * LICENSE file in the root directory of this source tree.
281 | */
282 |
283 |
284 |
285 | var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
286 |
287 | var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
288 |
289 | /**
290 | * Copyright (c) 2013-present, Facebook, Inc.
291 | *
292 | * This source code is licensed under the MIT license found in the
293 | * LICENSE file in the root directory of this source tree.
294 | */
295 |
296 |
297 |
298 | var printWarning = function() {};
299 |
300 | {
301 | var ReactPropTypesSecret = ReactPropTypesSecret_1;
302 | var loggedTypeFailures = {};
303 |
304 | printWarning = function(text) {
305 | var message = 'Warning: ' + text;
306 | if (typeof console !== 'undefined') {
307 | console.error(message);
308 | }
309 | try {
310 | // --- Welcome to debugging React ---
311 | // This error was thrown as a convenience so that you can use this stack
312 | // to find the callsite that caused this warning to fire.
313 | throw new Error(message);
314 | } catch (x) {}
315 | };
316 | }
317 |
318 | /**
319 | * Assert that the values match with the type specs.
320 | * Error messages are memorized and will only be shown once.
321 | *
322 | * @param {object} typeSpecs Map of name to a ReactPropType
323 | * @param {object} values Runtime values that need to be type-checked
324 | * @param {string} location e.g. "prop", "context", "child context"
325 | * @param {string} componentName Name of the component for error messages.
326 | * @param {?Function} getStack Returns the component stack.
327 | * @private
328 | */
329 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
330 | {
331 | for (var typeSpecName in typeSpecs) {
332 | if (typeSpecs.hasOwnProperty(typeSpecName)) {
333 | var error;
334 | // Prop type validation may throw. In case they do, we don't want to
335 | // fail the render phase where it didn't fail before. So we log it.
336 | // After these have been cleaned up, we'll let them throw.
337 | try {
338 | // This is intentionally an invariant that gets caught. It's the same
339 | // behavior as without this statement except with a better message.
340 | if (typeof typeSpecs[typeSpecName] !== 'function') {
341 | var err = Error(
342 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
343 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
344 | );
345 | err.name = 'Invariant Violation';
346 | throw err;
347 | }
348 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
349 | } catch (ex) {
350 | error = ex;
351 | }
352 | if (error && !(error instanceof Error)) {
353 | printWarning(
354 | (componentName || 'React class') + ': type specification of ' +
355 | location + ' `' + typeSpecName + '` is invalid; the type checker ' +
356 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
357 | 'You may have forgotten to pass an argument to the type checker ' +
358 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
359 | 'shape all require an argument).'
360 | );
361 |
362 | }
363 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
364 | // Only monitor this failure once because there tends to be a lot of the
365 | // same error.
366 | loggedTypeFailures[error.message] = true;
367 |
368 | var stack = getStack ? getStack() : '';
369 |
370 | printWarning(
371 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
372 | );
373 | }
374 | }
375 | }
376 | }
377 | }
378 |
379 | var checkPropTypes_1 = checkPropTypes;
380 |
381 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
382 |
383 | var emptyObject = {};
384 | {
385 | Object.freeze(emptyObject);
386 | }
387 |
388 | var ReactShallowRenderer = function () {
389 | function ReactShallowRenderer() {
390 | _classCallCheck(this, ReactShallowRenderer);
391 |
392 | this._context = null;
393 | this._element = null;
394 | this._instance = null;
395 | this._newState = null;
396 | this._rendered = null;
397 | this._rendering = false;
398 | this._forcedUpdate = false;
399 | this._updater = new Updater(this);
400 | }
401 |
402 | ReactShallowRenderer.prototype.getMountedInstance = function getMountedInstance() {
403 | return this._instance;
404 | };
405 |
406 | ReactShallowRenderer.prototype.getRenderOutput = function getRenderOutput() {
407 | return this._rendered;
408 | };
409 |
410 | ReactShallowRenderer.prototype.render = function render(element) {
411 | var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyObject;
412 |
413 | !React.isValidElement(element) ? invariant(false, 'ReactShallowRenderer render(): Invalid component element.%s', typeof element === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' : '') : void 0;
414 | // Show a special message for host elements since it's a common case.
415 | !(typeof element.type !== 'string') ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, not primitives (%s). Instead of calling `.render(el)` and inspecting the rendered output, look at `el.props` directly instead.', element.type) : void 0;
416 | !(isForwardRef(element) || typeof element.type === 'function') ? invariant(false, 'ReactShallowRenderer render(): Shallow rendering works only with custom components, but the provided element type was `%s`.', Array.isArray(element.type) ? 'array' : element.type === null ? 'null' : typeof element.type) : void 0;
417 |
418 | if (this._rendering) {
419 | return;
420 | }
421 |
422 | this._rendering = true;
423 | this._element = element;
424 | this._context = getMaskedContext(element.type.contextTypes, context);
425 |
426 | if (this._instance) {
427 | this._updateClassComponent(element, this._context);
428 | } else {
429 | if (isForwardRef(element)) {
430 | this._rendered = element.type.render(element.props, element.ref);
431 | } else if (shouldConstruct(element.type)) {
432 | this._instance = new element.type(element.props, this._context, this._updater);
433 |
434 | this._updateStateFromStaticLifecycle(element.props);
435 |
436 | if (element.type.hasOwnProperty('contextTypes')) {
437 | currentlyValidatingElement = element;
438 |
439 | checkPropTypes_1(element.type.contextTypes, this._context, 'context', getName(element.type, this._instance), getStackAddendum);
440 |
441 | currentlyValidatingElement = null;
442 | }
443 |
444 | this._mountClassComponent(element, this._context);
445 | } else {
446 | this._rendered = element.type.call(undefined, element.props, this._context);
447 | }
448 | }
449 |
450 | this._rendering = false;
451 | this._updater._invokeCallbacks();
452 |
453 | return this.getRenderOutput();
454 | };
455 |
456 | ReactShallowRenderer.prototype.unmount = function unmount() {
457 | if (this._instance) {
458 | if (typeof this._instance.componentWillUnmount === 'function') {
459 | this._instance.componentWillUnmount();
460 | }
461 | }
462 |
463 | this._context = null;
464 | this._element = null;
465 | this._newState = null;
466 | this._rendered = null;
467 | this._instance = null;
468 | };
469 |
470 | ReactShallowRenderer.prototype._mountClassComponent = function _mountClassComponent(element, context) {
471 | this._instance.context = context;
472 | this._instance.props = element.props;
473 | this._instance.state = this._instance.state || null;
474 | this._instance.updater = this._updater;
475 |
476 | if (typeof this._instance.UNSAFE_componentWillMount === 'function' || typeof this._instance.componentWillMount === 'function') {
477 | var beforeState = this._newState;
478 |
479 | // In order to support react-lifecycles-compat polyfilled components,
480 | // Unsafe lifecycles should not be invoked for components using the new APIs.
481 | if (typeof element.type.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
482 | if (typeof this._instance.componentWillMount === 'function') {
483 | this._instance.componentWillMount();
484 | }
485 | if (typeof this._instance.UNSAFE_componentWillMount === 'function') {
486 | this._instance.UNSAFE_componentWillMount();
487 | }
488 | }
489 |
490 | // setState may have been called during cWM
491 | if (beforeState !== this._newState) {
492 | this._instance.state = this._newState || emptyObject;
493 | }
494 | }
495 |
496 | this._rendered = this._instance.render();
497 | // Intentionally do not call componentDidMount()
498 | // because DOM refs are not available.
499 | };
500 |
501 | ReactShallowRenderer.prototype._updateClassComponent = function _updateClassComponent(element, context) {
502 | var props = element.props,
503 | type = element.type;
504 |
505 |
506 | var oldState = this._instance.state || emptyObject;
507 | var oldProps = this._instance.props;
508 |
509 | if (oldProps !== props) {
510 | // In order to support react-lifecycles-compat polyfilled components,
511 | // Unsafe lifecycles should not be invoked for components using the new APIs.
512 | if (typeof element.type.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
513 | if (typeof this._instance.componentWillReceiveProps === 'function') {
514 | this._instance.componentWillReceiveProps(props, context);
515 | }
516 | if (typeof this._instance.UNSAFE_componentWillReceiveProps === 'function') {
517 | this._instance.UNSAFE_componentWillReceiveProps(props, context);
518 | }
519 | }
520 | }
521 | this._updateStateFromStaticLifecycle(props);
522 |
523 | // Read state after cWRP in case it calls setState
524 | var state = this._newState || oldState;
525 |
526 | var shouldUpdate = true;
527 | if (this._forcedUpdate) {
528 | shouldUpdate = true;
529 | this._forcedUpdate = false;
530 | } else if (typeof this._instance.shouldComponentUpdate === 'function') {
531 | shouldUpdate = !!this._instance.shouldComponentUpdate(props, state, context);
532 | } else if (type.prototype && type.prototype.isPureReactComponent) {
533 | shouldUpdate = !shallowEqual(oldProps, props) || !shallowEqual(oldState, state);
534 | }
535 |
536 | if (shouldUpdate) {
537 | // In order to support react-lifecycles-compat polyfilled components,
538 | // Unsafe lifecycles should not be invoked for components using the new APIs.
539 | if (typeof element.type.getDerivedStateFromProps !== 'function' && typeof this._instance.getSnapshotBeforeUpdate !== 'function') {
540 | if (typeof this._instance.componentWillUpdate === 'function') {
541 | this._instance.componentWillUpdate(props, state, context);
542 | }
543 | if (typeof this._instance.UNSAFE_componentWillUpdate === 'function') {
544 | this._instance.UNSAFE_componentWillUpdate(props, state, context);
545 | }
546 | }
547 | }
548 |
549 | this._instance.context = context;
550 | this._instance.props = props;
551 | this._instance.state = state;
552 |
553 | if (shouldUpdate) {
554 | this._rendered = this._instance.render();
555 | }
556 | // Intentionally do not call componentDidUpdate()
557 | // because DOM refs are not available.
558 | };
559 |
560 | ReactShallowRenderer.prototype._updateStateFromStaticLifecycle = function _updateStateFromStaticLifecycle(props) {
561 | var type = this._element.type;
562 |
563 |
564 | if (typeof type.getDerivedStateFromProps === 'function') {
565 | var oldState = this._newState || this._instance.state;
566 | var partialState = type.getDerivedStateFromProps.call(null, props, oldState);
567 |
568 | if (partialState != null) {
569 | var newState = _assign({}, oldState, partialState);
570 | this._instance.state = this._newState = newState;
571 | }
572 | }
573 | };
574 |
575 | return ReactShallowRenderer;
576 | }();
577 |
578 | ReactShallowRenderer.createRenderer = function () {
579 | return new ReactShallowRenderer();
580 | };
581 |
582 | var Updater = function () {
583 | function Updater(renderer) {
584 | _classCallCheck(this, Updater);
585 |
586 | this._renderer = renderer;
587 | this._callbacks = [];
588 | }
589 |
590 | Updater.prototype._enqueueCallback = function _enqueueCallback(callback, publicInstance) {
591 | if (typeof callback === 'function' && publicInstance) {
592 | this._callbacks.push({
593 | callback: callback,
594 | publicInstance: publicInstance
595 | });
596 | }
597 | };
598 |
599 | Updater.prototype._invokeCallbacks = function _invokeCallbacks() {
600 | var callbacks = this._callbacks;
601 | this._callbacks = [];
602 |
603 | callbacks.forEach(function (_ref) {
604 | var callback = _ref.callback,
605 | publicInstance = _ref.publicInstance;
606 |
607 | callback.call(publicInstance);
608 | });
609 | };
610 |
611 | Updater.prototype.isMounted = function isMounted(publicInstance) {
612 | return !!this._renderer._element;
613 | };
614 |
615 | Updater.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance, callback, callerName) {
616 | this._enqueueCallback(callback, publicInstance);
617 | this._renderer._forcedUpdate = true;
618 | this._renderer.render(this._renderer._element, this._renderer._context);
619 | };
620 |
621 | Updater.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState, callback, callerName) {
622 | this._enqueueCallback(callback, publicInstance);
623 | this._renderer._newState = completeState;
624 | this._renderer.render(this._renderer._element, this._renderer._context);
625 | };
626 |
627 | Updater.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState, callback, callerName) {
628 | this._enqueueCallback(callback, publicInstance);
629 | var currentState = this._renderer._newState || publicInstance.state;
630 |
631 | if (typeof partialState === 'function') {
632 | partialState = partialState.call(publicInstance, currentState, publicInstance.props);
633 | }
634 |
635 | // Null and undefined are treated as no-ops.
636 | if (partialState === null || partialState === undefined) {
637 | return;
638 | }
639 |
640 | this._renderer._newState = _assign({}, currentState, partialState);
641 |
642 | this._renderer.render(this._renderer._element, this._renderer._context);
643 | };
644 |
645 | return Updater;
646 | }();
647 |
648 | var currentlyValidatingElement = null;
649 |
650 | function getDisplayName(element) {
651 | if (element == null) {
652 | return '#empty';
653 | } else if (typeof element === 'string' || typeof element === 'number') {
654 | return '#text';
655 | } else if (typeof element.type === 'string') {
656 | return element.type;
657 | } else {
658 | return element.type.displayName || element.type.name || 'Unknown';
659 | }
660 | }
661 |
662 | function getStackAddendum() {
663 | var stack = '';
664 | if (currentlyValidatingElement) {
665 | var name = getDisplayName(currentlyValidatingElement);
666 | var owner = currentlyValidatingElement._owner;
667 | stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
668 | }
669 | return stack;
670 | }
671 |
672 | function getName(type, instance) {
673 | var constructor = instance && instance.constructor;
674 | return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null;
675 | }
676 |
677 | function shouldConstruct(Component) {
678 | return !!(Component.prototype && Component.prototype.isReactComponent);
679 | }
680 |
681 | function getMaskedContext(contextTypes, unmaskedContext) {
682 | if (!contextTypes) {
683 | return emptyObject;
684 | }
685 | var context = {};
686 | for (var key in contextTypes) {
687 | context[key] = unmaskedContext[key];
688 | }
689 | return context;
690 | }
691 |
692 |
693 |
694 | var ReactShallowRenderer$2 = Object.freeze({
695 | default: ReactShallowRenderer
696 | });
697 |
698 | var ReactShallowRenderer$3 = ( ReactShallowRenderer$2 && ReactShallowRenderer ) || ReactShallowRenderer$2;
699 |
700 | // TODO: decide on the top-level export form.
701 | // This is hacky but makes it work with both Rollup and Jest.
702 | var shallow = ReactShallowRenderer$3.default ? ReactShallowRenderer$3.default : ReactShallowRenderer$3;
703 |
704 | return shallow;
705 |
706 | })));
707 |
--------------------------------------------------------------------------------
/vendor/react-test-renderer-shallow.production.min.js:
--------------------------------------------------------------------------------
1 | /** @license React v16.4.1
2 | * react-test-renderer-shallow.production.min.js
3 | *
4 | * Copyright (c) 2013-present, Facebook, Inc.
5 | *
6 | * This source code is licensed under the MIT license found in the
7 | * LICENSE file in the root directory of this source tree.
8 | */
9 | 'use strict';(function(g,f){"object"===typeof exports&&"undefined"!==typeof module?module.exports=f(require("react")):"function"===typeof define&&define.amd?define(["react"],f):g.ReactShallowRenderer=f(g.React)})(this,function(g){function f(a,b,d,c,e,h,g,x){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 w=[d,c,e,h,g,x],f=0;a=Error(b.replace(/%s/g,function(){return w[f++]}));
10 | a.name="Invariant Violation"}a.framesToPop=1;throw a;}}function n(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c=a?(b=!0,0):999},didTimeout:!1})}return L}function hb(){var a=L;L=[];return a}function Da(){l("272")}function Ea(a){switch(a.tag){case "INSTANCE":var b=a.rootContainerInstance.createNodeMock;return b({type:a.type,
15 | props:a.props});default:return a}}function bc(a,b){var c=a.children.indexOf(b);-1!==c&&a.children.splice(c,1);a.children.push(b)}function cc(a,b,c){var d=a.children.indexOf(b);-1!==d&&a.children.splice(d,1);c=a.children.indexOf(c);a.children.splice(c,0,b)}function dc(a,b){b=a.children.indexOf(b);a.children.splice(b,1)}function ec(a){var b="";do{a:switch(a.tag){case 0:case 1:case 2:case 5:case 11:var c=a._debugOwner,d=a._debugSource;var e=na(a.type);var f=null;c&&(f=na(c.type));c=d;e="\n in "+(e||
16 | "Unknown")+(c?" (at "+c.fileName.replace(/^.*[\\\/]/,"")+":"+c.lineNumber+")":f?" (created by "+f+")":"");break a;default:e=""}b+=e;a=a.return}while(a);return b}function v(a,b){0>ca||(a.current=ib[ca],ib[ca]=null,ca--)}function y(a,b,c){ca++;ib[ca]=a.current;a.current=b}function da(a){return pa(a)?jb:I.current}function ea(a,b){var c=a.type.contextTypes;if(!c)return S;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e=
17 | {},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function pa(a){return 2===a.tag&&null!=a.type.childContextTypes}function kb(a){pa(a)&&(v(x,a),v(I,a))}function lb(a){v(x,a);v(I,a)}function fc(a,b,c){I.current!==S?l("168"):void 0;y(I,b,a);y(x,c,a)}function gc(a,b){var c=a.stateNode;a=a.type;var d=a.childContextTypes;if("function"!==typeof c.getChildContext)return b;c=c.getChildContext();for(var e in c)e in
18 | d?void 0:l("108",na(a)||"Unknown",e);return T({},b,c)}function mb(a){if(!pa(a))return!1;var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||S;jb=I.current;y(I,b,a);y(x,x.current,a);return!0}function hc(a,b){var c=a.stateNode;c?void 0:l("169");if(b){var d=gc(a,jb);c.__reactInternalMemoizedMergedChildContext=d;v(x,a);v(I,a);y(I,d,a)}else v(x,a);y(x,b,a)}function ic(a){return function(b){try{return a(b)}catch(c){}}}function fd(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;
19 | var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);nb=ic(function(a){return b.onCommitFiberRoot(c,a)});ob=ic(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function N(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=null;this.index=0;this.ref=null;this.pendingProps=b;this.firstContextDependency=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=
20 | this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function Fa(a,b,c){var d=a.alternate;null===d?(d=new N(a.tag,b,a.key,a.mode),d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=b,d.effectTag=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null);d.childExpirationTime=a.childExpirationTime;d.expirationTime=b!==a.pendingProps?c:a.expirationTime;d.child=a.child;d.memoizedProps=a.memoizedProps;d.memoizedState=a.memoizedState;
21 | d.updateQueue=a.updateQueue;d.firstContextDependency=a.firstContextDependency;d.sibling=a.sibling;d.index=a.index;d.ref=a.ref;return d}function pb(a,b,c){var d=a.type,e=a.key;a=a.props;if("function"===typeof d)var f=d.prototype&&d.prototype.isReactComponent?2:0;else if("string"===typeof d)f=5;else switch(d){case K:return Ga(a.children,b,c,e);case Ub:f=11;b|=3;break;case Vb:f=11;b|=2;break;case gb:return d=new N(15,a,e,b|4),d.type=gb,d.expirationTime=c,d;case Wb:f=16;break;default:a:{switch("object"===
22 | typeof d&&null!==d?d.$$typeof:null){case Yb:f=13;break a;case Xb:f=12;break a;case Zb:f=14;break a;default:l("130",null==d?d:typeof d,"")}f=void 0}}b=new N(f,a,e,b);b.type=d;b.expirationTime=c;return b}function Ga(a,b,c,d){a=new N(10,a,d,b);a.expirationTime=c;return a}function qb(a,b,c){a=new N(6,a,null,b);a.expirationTime=c;return a}function rb(a,b,c){b=new N(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};
23 | return b}function gd(a,b,c){b=new N(3,null,null,b?3:0);a={current:b,containerInfo:a,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,didError:!1,pendingCommitExpirationTime:0,finishedWork:null,timeoutHandle:-1,context:null,pendingContext:null,hydrate:c,nextExpirationTimeToWorkOn:0,expirationTime:0,firstBatch:null,nextScheduledRoot:null};return b.stateNode=a}function Ha(a,b){a.didError=!1;var c=a.earliestPendingTime;0===
24 | c?a.earliestPendingTime=a.latestPendingTime=b:c>b?a.earliestPendingTime=b:a.latestPendingTimea)&&(e=d);a=e;0!==a&&0!==c&&ce){if(null===g&&(g=m,f=l),0===h||h>k)h=k}else l=lc(a,b,m,l,c,d),null!==m.callback&&(a.effectTag|=32,m.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=m:(b.lastEffect.nextEffect=m,b.lastEffect=m));m=m.next}k=null;for(m=b.firstCapturedUpdate;null!==m;){var H=m.expirationTime;if(H>e){if(null===k&&(k=m,null===g&&(f=l)),0===h||h>H)h=H}else l=lc(a,b,m,l,c,d),null!==m.callback&&(a.effectTag|=32,m.nextEffect=
29 | null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=m:(b.lastCapturedEffect.nextEffect=m,b.lastCapturedEffect=m));m=m.next}null===g&&(b.lastUpdate=null);null===k?b.lastCapturedUpdate=null:a.effectTag|=32;null===g&&null===k&&(f=l);b.baseState=f;b.firstUpdate=g;b.firstCapturedUpdate=k;a.expirationTime=h;a.memoizedState=l}function mc(a,b){"function"!==typeof a?l("191",a):void 0;a.call(b)}function nc(a,b,c,d){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=
30 | b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null);a=b.firstEffect;for(b.firstEffect=b.lastEffect=null;null!==a;)d=a.callback,null!==d&&(a.callback=null,mc(d,c)),a=a.nextEffect;a=b.firstCapturedEffect;for(b.firstCapturedEffect=b.lastCapturedEffect=null;null!==a;)b=a.callback,null!==b&&(a.callback=null,mc(b,c)),a=a.nextEffect}function Ka(a,b){return{value:a,source:b,stack:ec(b)}}function ra(a){var b=a.type._context;y(ub,b._changedBits2,a);y(vb,
31 | b._currentValue2,a);b._currentValue2=a.pendingProps.value;b._changedBits2=a.stateNode}function wb(a){var b=ub.current,c=vb.current;v(vb,a);v(ub,a);a=a.type._context;a._currentValue2=c;a._changedBits2=b}function oc(a,b,c,d){var e=a.child;null!==e&&(e.return=a);for(;null!==e;){var f=e.firstContextDependency;if(null!==f){do{if(f.context===b&&0!==(f.observedBits&c)){if(0===e.expirationTime||e.expirationTime>d)e.expirationTime=d;var g=e.alternate;null!==g&&(0===g.expirationTime||g.expirationTime>d)&&(g.expirationTime=
32 | d);for(var h=e.return;null!==h;){g=h.alternate;if(0===h.childExpirationTime||h.childExpirationTime>d)h.childExpirationTime=d,null!==g&&(0===g.childExpirationTime||g.childExpirationTime>d)&&(g.childExpirationTime=d);else if(null!==g&&(0===g.childExpirationTime||g.childExpirationTime>d))g.childExpirationTime=d;else break;h=h.return}g=null}else g=e.child;f=f.next}while(null!==f)}else g=13===e.tag?e.type===a.type?null:e.child:e.child;if(null!==g)g.return=e;else for(g=e;null!==g;){if(g===a){g=null;break}e=
33 | g.sibling;if(null!==e){e.return=g.return;g=e;break}g=g.return}e=g}}function La(a,b){Ma=a;Na=ha=null;var c=a.firstContextDependency;if(null!==c){a.firstContextDependency=null;var d=!1;do{var e=c.context,f=e._changedBits2;0!==f&&(oc(a,e,f,b),0!==(f&c.observedBits)&&(d=!0));c=c.next}while(null!==c);return d}return!1}function pc(a,b){if(Na!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)Na=a,b=1073741823;b={context:a,observedBits:b,next:null};null===ha?(null===Ma?G(!1,"Context.unstable_read(): Context can only be read while React is rendering, e.g. inside the render method or getDerivedStateFromProps."):
34 | void 0,Ma.firstContextDependency=ha=b):ha=ha.next=b}return a._currentValue2}function V(a){a===sa?l("174"):void 0;return a}function xb(a,b){y(ta,b,a);y(ua,a,a);y(C,sa,a);b=qc;v(C,a);y(C,b,a)}function ia(a){v(C,a);v(ua,a);v(ta,a)}function rc(a){V(ta.current);var b=V(C.current),c=qc;b!==c&&(y(ua,a,a),y(C,c,a))}function yb(a){ua.current===a&&(v(C,a),v(ua,a))}function sc(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function tc(a,b){if(sc(a,b))return!0;if("object"!==typeof a||null===a||"object"!==
35 | typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;dq?(w=n,n=null):w=n.sibling;var r=D(e,n,h[q],m);if(null===r){null===n&&(n=w);break}a&&n&&null===r.alternate&&b(e,n);g=f(r,g,q);null===k?l=r:k.sibling=r;k=r;n=w}if(q===h.length)return c(e,n),l;if(null===n){for(;qw?(p=q,q=null):p=q.sibling;var t=D(e,q,r.value,m);if(null===t){q||(q=p);break}a&&q&&null===t.alternate&&b(e,q);g=f(t,g,w);null===n?k=t:n.sibling=t;n=t;q=p}if(r.done)return c(e,q),k;if(null===q){for(;!r.done;w++,r=h.next())r=H(e,r.value,m),null!==r&&(g=
46 | f(r,g,w),null===n?k=r:n.sibling=r,n=r);return k}for(q=d(e,q);!r.done;w++,r=h.next())r=u(q,e,w,r.value,m),null!==r&&(a&&null!==r.alternate&&q.delete(null===r.key?w:r.key),g=f(r,g,w),null===n?k=r:n.sibling=r,n=r);a&&q.forEach(function(a){return b(e,a)});return k}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===K&&null===f.key;k&&(f=f.props.children);var m="object"===typeof f&&null!==f;if(m)switch(f.$$typeof){case Ra:a:{m=f.key;for(k=d;null!==k;){if(k.key===m)if(10===k.tag?f.type===
47 | K:k.type===f.type){c(a,k.sibling);d=e(k,f.type===K?f.props.children:f.props,h);d.ref=va(a,k,f);d.return=a;a=d;break a}else{c(a,k);break}else b(a,k);k=k.sibling}f.type===K?(d=Ga(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=pb(f,a.mode,h),h.ref=va(a,d,f),h.return=a,a=h)}return g(a);case oa:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,
48 | d);break}else b(a,d);d=d.sibling}d=rb(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=qb(f,a.mode,h),d.return=a,a=d),g(a);if(Sa(f))return v(a,d,f,h);if(ma(f))return x(a,d,f,h);m&&Qa(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 2:case 1:h=a.type,l("152",h.displayName||h.name||"Component")}return c(a,d)}}function zc(a,b){switch(a.tag){case 5:return b=id(b,a.type,a.pendingProps),
49 | null!==b?(a.stateNode=b,!0):!1;case 6:return b=jd(b,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;default:return!1}}function Ac(a){if(zb){var b=Bc;if(b){var c=b;if(!zc(a,b)){b=kd(c);if(!b||!zc(a,b)){a.effectTag|=2;zb=!1;Ta=a;return}var d=Ta,e=new N(5,null,null,0);e.type="DELETED";e.stateNode=c;e.return=d;e.effectTag=8;null!==d.lastEffect?(d.lastEffect.nextEffect=e,d.lastEffect=e):d.firstEffect=d.lastEffect=e}Ta=a;Bc=ld(b)}else a.effectTag|=2,zb=!1,Ta=a}}function A(a,b,c,d){b.child=null===a?md(b,
50 | null,c,d):Cc(b,a.child,c,d)}function Dc(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function Ec(a,b,c,d,e){Dc(a,b);var f=0!==(b.effectTag&64);if(!c&&!f)return d&&hc(b,!1),W(a,b,e);c=b.stateNode;nd.current=b;var g=f?null:c.render();b.effectTag|=1;null!==a&&f&&(A(a,b,null,e),b.child=null);A(a,b,g,e);b.memoizedState=c.state;b.memoizedProps=c.props;d&&hc(b,!0);return b.child}function Fc(a){var b=a.stateNode;b.pendingContext?fc(a,b.pendingContext,b.pendingContext!==b.context):
51 | b.context&&fc(a,b.context,!1);xb(a,b.containerInfo)}function W(a,b,c){null!==a&&(b.firstContextDependency=a.firstContextDependency);var d=b.childExpirationTime;if(0===d||d>c)return null;null!==a&&b.child!==a.child?l("153"):void 0;if(null!==b.child){a=b.child;c=Fa(a,a.pendingProps,a.expirationTime);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Fa(a,a.pendingProps,a.expirationTime),c.return=b;c.sibling=null}return b.child}function od(a,b,c){var d=b.expirationTime;if(!x.current&&
52 | (0===d||d>c)){switch(b.tag){case 3:Fc(b);break;case 5:rc(b);break;case 2:mb(b);break;case 4:xb(b,b.stateNode.containerInfo);break;case 13:b.stateNode=0,ra(b)}return W(a,b,c)}b.expirationTime=0;switch(b.tag){case 0:null!==a?l("155"):void 0;var e=b.type;d=b.pendingProps;var f=da(b);f=ea(b,f);La(b,c);e=e(d,f);b.effectTag|=1;if("object"===typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){var g=b.type;b.tag=2;f=mb(b);b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;g=
53 | g.getDerivedStateFromProps;"function"===typeof g&&Oa(b,g,d);e.updater=Pa;b.stateNode=e;e._reactInternalFiber=b;wc(b,c);a=Ec(a,b,!0,f,c)}else b.tag=1,A(a,b,e,c),b.memoizedProps=d,a=b.child;return a;case 1:return e=b.type,d=b.pendingProps,f=da(b),f=ea(b,f),La(b,c),e=e(d,f),b.effectTag|=1,A(a,b,e,c),b.memoizedProps=d,b.child;case 2:d=mb(b);e=La(b,c);if(null===a)if(null===b.stateNode){var h=b.pendingProps,k=b.type;e=da(b);f=(g=2===b.tag&&null!=b.type.contextTypes)?ea(b,e):S;h=new k(h,f);b.memoizedState=
54 | null!==h.state&&void 0!==h.state?h.state:null;h.updater=Pa;b.stateNode=h;h._reactInternalFiber=b;g&&(g=b.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=e,g.__reactInternalMemoizedMaskedChildContext=f);wc(b,c);e=!0}else{var t=b.type;f=b.stateNode;h=b.memoizedProps;g=b.pendingProps;f.props=h;var p=f.context;k=da(b);k=ea(b,k);var u=t.getDerivedStateFromProps;(t="function"===typeof u||"function"===typeof f.getSnapshotBeforeUpdate)||"function"!==typeof f.UNSAFE_componentWillReceiveProps&&"function"!==
55 | typeof f.componentWillReceiveProps||(h!==g||p!==k)&&vc(b,f,g,k);O=!1;var D=b.memoizedState;p=f.state=D;var v=b.updateQueue;null!==v&&(qa(b,v,g,f,c),p=b.memoizedState);h!==g||D!==p||x.current||e||O?("function"===typeof u&&(Oa(b,u,g),p=b.memoizedState),(e=O||e||uc(b,h,g,D,p,k))?(t||"function"!==typeof f.UNSAFE_componentWillMount&&"function"!==typeof f.componentWillMount||("function"===typeof f.componentWillMount&&f.componentWillMount(),"function"===typeof f.UNSAFE_componentWillMount&&f.UNSAFE_componentWillMount()),
56 | "function"===typeof f.componentDidMount&&(b.effectTag|=4)):("function"===typeof f.componentDidMount&&(b.effectTag|=4),b.memoizedProps=g,b.memoizedState=p),f.props=g,f.state=p,f.context=k):("function"===typeof f.componentDidMount&&(b.effectTag|=4),e=!1)}else t=b.type,f=b.stateNode,g=b.memoizedProps,h=b.pendingProps,f.props=g,p=f.context,k=da(b),k=ea(b,k),u=t.getDerivedStateFromProps,(t="function"===typeof u||"function"===typeof f.getSnapshotBeforeUpdate)||"function"!==typeof f.UNSAFE_componentWillReceiveProps&&
57 | "function"!==typeof f.componentWillReceiveProps||(g!==h||p!==k)&&vc(b,f,h,k),O=!1,p=b.memoizedState,D=f.state=p,v=b.updateQueue,null!==v&&(qa(b,v,h,f,c),D=b.memoizedState),g!==h||p!==D||x.current||e||O?("function"===typeof u&&(Oa(b,u,h),D=b.memoizedState),(e=O||e||uc(b,g,h,p,D,k))?(t||"function"!==typeof f.UNSAFE_componentWillUpdate&&"function"!==typeof f.componentWillUpdate||("function"===typeof f.componentWillUpdate&&f.componentWillUpdate(h,D,k),"function"===typeof f.UNSAFE_componentWillUpdate&&
58 | f.UNSAFE_componentWillUpdate(h,D,k)),"function"===typeof f.componentDidUpdate&&(b.effectTag|=4),"function"===typeof f.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!==typeof f.componentDidUpdate||g===a.memoizedProps&&p===a.memoizedState||(b.effectTag|=4),"function"!==typeof f.getSnapshotBeforeUpdate||g===a.memoizedProps&&p===a.memoizedState||(b.effectTag|=256),b.memoizedProps=h,b.memoizedState=D),f.props=h,f.state=D,f.context=k):("function"!==typeof f.componentDidUpdate||g===a.memoizedProps&&
59 | p===a.memoizedState||(b.effectTag|=4),"function"!==typeof f.getSnapshotBeforeUpdate||g===a.memoizedProps&&p===a.memoizedState||(b.effectTag|=256),e=!1);return Ec(a,b,e,d,c);case 3:return Fc(b),d=b.updateQueue,null===d?G(!1,"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."):void 0,e=b.memoizedState,e=null!==e?e.element:null,qa(b,d,b.pendingProps,null,c),d=b.memoizedState.element,d===e?a=W(a,b,c):(A(a,
60 | b,d,c),a=b.child),a;case 5:return rc(b),null===a&&Ac(b),d=b.pendingProps,e=d.children,Dc(a,b),A(a,b,e,c),b.memoizedProps=d,a=b.child,a;case 6:return null===a&&Ac(b),b.memoizedProps=b.pendingProps,null;case 16:return null;case 4:return xb(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Cc(b,null,d,c):A(a,b,d,c),b.memoizedProps=d,b.child;case 14:return e=b.type.render,d=b.pendingProps,f=b.ref,x.current||b.memoizedProps!==d||f!==(null!==a?a.ref:null)?(e=e(d,f),A(a,b,e,c),b.memoizedProps=
61 | d,a=b.child):a=W(a,b,c),a;case 10:return d=b.pendingProps,A(a,b,d,c),b.memoizedProps=d,b.child;case 11:return d=b.pendingProps.children,A(a,b,d,c),b.memoizedProps=d,b.child;case 15:return d=b.pendingProps,A(a,b,d.children,c),b.memoizedProps=d,b.child;case 13:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;g=e.value;b.memoizedProps=e;if(null===f)g=1073741823;else if(f.value===e.value){if(f.children===e.children&&!x.current){b.stateNode=0;ra(b);a=W(a,b,c);break a}g=0}else if(h=f.value,h===g&&
62 | (0!==h||1/h===1/g)||h!==h&&g!==g){if(f.children===e.children&&!x.current){b.stateNode=0;ra(b);a=W(a,b,c);break a}g=0}else if(g="function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,g):1073741823,g|=0,0===g){if(f.children===e.children&&!x.current){b.stateNode=0;ra(b);a=W(a,b,c);break a}}else oc(b,d,g,c);b.stateNode=g;ra(b);A(a,b,e.children,c);a=b.child}return a;case 12:return f=b.type,d=b.pendingProps,e=d.children,La(b,c),f=pc(f,d.unstable_observedBits),e=e(f),b.effectTag|=1,A(a,b,
63 | e,c),b.memoizedProps=d,b.child;default:l("156")}}function Gc(a,b){var c=b.source;null===b.stack&&null!==c&&ec(c);null!==c&&na(c.type);b=b.value;null!==a&&2===a.tag&&na(a.type);try{b&&b.suppressReactErrorLogging||console.error(b)}catch(d){d&&d.suppressReactErrorLogging||console.error(d)}}function Hc(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){wa(a,c)}else b.current=null}function Ic(a){"function"===typeof ob&&ob(a);switch(a.tag){case 2:Hc(a);var b=a.stateNode;if("function"===
64 | typeof b.componentWillUnmount)try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(c){wa(a,c)}break;case 5:Hc(a);break;case 4:Jc(a)}}function Kc(a){return 5===a.tag||3===a.tag||4===a.tag}function Lc(a){a:{for(var b=a.return;null!==b;){if(Kc(b)){var c=b;break a}b=b.return}l("160");c=void 0}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:l("161")}c.effectTag&
65 | 16&&(c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Kc(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)c?d?pd(b,e.stateNode,c):cc(b,e.stateNode,c):d?qd(b,e.stateNode):bc(b,e.stateNode);else if(4!==e.tag&&null!==e.child){e.child.return=
66 | e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return;e=e.sibling}}function Jc(a){for(var b=a,c=!1,d=void 0,e=void 0;;){if(!c){c=b.return;a:for(;;){null===c?l("160"):void 0;switch(c.tag){case 5:d=c.stateNode;e=!1;break a;case 3:d=c.stateNode.containerInfo;e=!0;break a;case 4:d=c.stateNode.containerInfo;e=!0;break a}c=c.return}c=!0}if(5===b.tag||6===b.tag){a:for(var f=b,g=f;;)if(Ic(g),null!==g.child&&4!==g.tag)g.child.return=
67 | g,g=g.child;else{if(g===f)break;for(;null===g.sibling;){if(null===g.return||g.return===f)break a;g=g.return}g.sibling.return=g.return;g=g.sibling}e?rd(d,b.stateNode):dc(d,b.stateNode)}else if(4===b.tag?(d=b.stateNode.containerInfo,e=!0):Ic(b),null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return;b=b.return;4===b.tag&&(c=!1)}b.sibling.return=b.return;b=b.sibling}}function Mc(a,b){switch(b.tag){case 2:break;case 5:a=b.stateNode;
68 | if(null!=a){var c=b.memoizedProps,d=b.type,e=b.updateQueue;b.updateQueue=null;null!==e&&(a.type=d,a.props=c)}break;case 6:null===b.stateNode?l("162"):void 0;b.stateNode.text=b.memoizedProps;break;case 3:break;case 15:break;case 16:break;default:l("163")}}function Ab(a,b,c){c=fa(c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Bb(d);Gc(a,b)};return c}function Nc(a,b,c){c=fa(c);c.tag=3;var d=a.stateNode;null!==d&&"function"===typeof d.componentDidCatch&&(c.callback=function(){null===
69 | P?P=new Set([this]):P.add(this);var c=b.value,d=b.stack;Gc(a,b);this.componentDidCatch(c,{componentStack:null!==d?d:""})});return c}function sd(a,b){switch(a.tag){case 2:return kb(a),b=a.effectTag,b&1024?(a.effectTag=b&-1025|64,a):null;case 3:return ia(a),lb(a),b=a.effectTag,0!==(b&64)?G(!1,"The root failed to unmount after an error. This is likely a bug in React. Please file an issue."):void 0,a.effectTag=b&-1025|64,a;case 5:return yb(a),null;case 16:return b=a.effectTag,b&1024?(a.effectTag=b&-1025|
70 | 64,a):null;case 4:return ia(a),null;case 13:return wb(a),null;default:return null}}function Oc(){if(null!==u)for(var a=u.return;null!==a;){var b=a;switch(b.tag){case 2:kb(b);break;case 3:ia(b);lb(b);break;case 5:yb(b);break;case 4:ia(b);break;case 13:wb(b)}a=a.return}Q=null;E=0;Cb=!1;u=null}function Pc(a){for(;;){var b=a.alternate,c=a.return,d=a.sibling;if(0===(a.effectTag&512)){var e=b;b=a;var f=b.pendingProps;switch(b.tag){case 1:break;case 2:kb(b);break;case 3:ia(b);lb(b);f=b.stateNode;f.pendingContext&&
71 | (f.context=f.pendingContext,f.pendingContext=null);if(null===e||null===e.child)b.effectTag&=-3;Db(b);break;case 5:yb(b);var g=V(ta.current),h=b.type;if(null!==e&&null!=b.stateNode){var k=e.memoizedProps,t=V(C.current);Qc(e,b,td,h,k,f,g,t);e.ref!==b.ref&&(b.effectTag|=128)}else if(f){V(C.current);e={type:h,props:f,children:[],rootContainerInstance:g,tag:"INSTANCE"};a:for(f=e,g=b,h=g.child;null!==h;){if(5===h.tag||6===h.tag){k=f;t=h.stateNode;var p=k.children.indexOf(t);-1!==p&&k.children.splice(p,
72 | 1);k.children.push(t)}else if(4!==h.tag&&null!==h.child){h.child.return=h;h=h.child;continue}if(h===g)break;for(;null===h.sibling;){if(null===h.return||h.return===g)break a;h=h.return}h.sibling.return=h.return;h=h.sibling}b.stateNode=e;null!==b.ref&&(b.effectTag|=128)}else null===b.stateNode?l("166"):void 0;break;case 6:e&&null!=b.stateNode?Rc(e,b,e.memoizedProps,f):("string"!==typeof f&&(null===b.stateNode?l("166"):void 0),V(ta.current),V(C.current),b.stateNode={text:f,tag:"TEXT"});break;case 14:break;
73 | case 16:break;case 10:break;case 11:break;case 15:break;case 4:ia(b);Db(b);break;case 13:wb(b);break;case 12:break;case 0:l("167");default:l("156")}b=u=null;e=a;if(1073741823===E||1073741823!==e.childExpirationTime){f=0;for(g=e.child;null!==g;){h=g.expirationTime;k=g.childExpirationTime;if(0===f||0!==h&&hd||0!==f&&f>d||0!==g&&g>d){a.didError=!1;c=a.latestPingedTime;0!==c&&c<=d&&(a.latestPingedTime=0);c=a.earliestPendingTime;b=a.latestPendingTime;c===d?a.earliestPendingTime=b===d?a.latestPendingTime=0:b:b===d&&(a.latestPendingTime=c);c=a.earliestSuspendedTime;b=a.latestSuspendedTime;0===c?a.earliestSuspendedTime=a.latestSuspendedTime=d:c>d?a.earliestSuspendedTime=d:bb)a.expirationTime=b;var c=a.alternate;null!==c&&(0===c.expirationTime||c.expirationTime>b)&&(c.expirationTime=b);var d=a.return;if(null===d&&3===a.tag)a=a.stateNode;else{for(;null!==
80 | d;){c=d.alternate;if(0===d.childExpirationTime||d.childExpirationTime>b)d.childExpirationTime=b;null!==c&&(0===c.childExpirationTime||c.childExpirationTime>b)&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){a=d.stateNode;break a}d=d.return}a=null}}if(null!==a){!J&&0!==E&&bxd&&(za=0,l("185"))}}function Gb(){Z=((Xa()-Wc)/10|0)+2}function Vc(a){if(0!==Ya){if(a>Ya)return;null!==Hb&&(M=null)}Ya=a;Xa();M=yd;Hb=0}function Za(){if(ja)return Aa;$a();if(0===B||1073741823===B)Gb(),Aa=Z;return Aa}function $a(){var a=0,b=null;if(null!==z)for(var c=z,d=Y;null!==d;){var e=d.expirationTime;if(0===e){null===c||null===z?l("244"):void 0;if(d===d.nextScheduledRoot){Y=z=d.nextScheduledRoot=null;break}else if(d===
82 | Y)Y=e=d.nextScheduledRoot,z.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===z){z=c;z.nextScheduledRoot=Y;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{if(0===a||e=B)&&(!ab||Z>=B);)Eb(R,B,Z>=B),$a(),Gb(),Aa=Z;else for(;null!==R&&0!==B&&(0===a||a>=
83 | B);)Eb(R,B,!0),$a();null!==aa&&(Ya=0,Hb=null);0!==B&&Vc(B);aa=null;ab=!1;za=0;Ib=null;if(null!==ka)for(a=ka,ka=null,b=0;ba.latestSuspendedTime?(a.earliestSuspendedTime=0,a.latestSuspendedTime=0,a.latestPingedTime=0,Ha(a,d)):dzd?!1:ab=!0}function Bb(a){null===R?l("246"):void 0;R.expirationTime=0;la||(la=!0,bb=a)}function Jb(a,b,c,d){var e=b.current,f=Za();e=Va(f,e);f=b.current;if(c){c=c._reactInternalFiber;var g;b:{2===Ca(c)&&2===c.tag?void 0:l("170");for(g=c;3!==g.tag;){if(pa(g)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;
91 | break b}(g=g.return)?void 0:l("171")}g=g.stateNode.context}c=pa(c)?gc(c,g):g}else c=S;null===b.context?b.context=c:b.pendingContext=c;b=d;d=fa(e);d.payload={element:a};b=void 0===b?null:b;null!==b&&(d.callback=b);U(f,d);X(f,e);return e}function Xc(a){if(a=null(a)){l("194");var b=null(a.stateNode);null.restoreControlledState(a.stateNode,a.type,b)}}function Kb(a){switch(a.tag){case "TEXT":return a.text;case "INSTANCE":var b=a.props,c=["children"],d={},e;for(e in b)0<=c.indexOf(e)||Object.prototype.hasOwnProperty.call(b,
92 | e)&&(d[e]=b[e]);b=null;a.children&&a.children.length&&(b=a.children.map(Kb));a={type:a.type,props:d,children:b};Object.defineProperty(a,"$$typeof",{value:Symbol.for("react.test.json")});return a;default:throw Error("Unexpected node type in toJSON: "+a.tag);}}function Ba(a){if(!a)return null;a=Yc(a);return 0===a.length?null:1===a.length?db(a[0]):Zc(a.map(db))}function Yc(a){for(var b=[];null!=a;)b.push(a),a=a.sibling;return b}function Zc(a){var b=[];for(a=[{i:0,array:a}];a.length;)for(var c=a.pop();c.i<
93 | c.array.length;){var d=c.array[c.i];c.i+=1;if(Array.isArray(d)){a.push(c);a.push({i:0,array:d});break}b.push(d)}return b}function db(a){if(null==a)return null;switch(a.tag){case 3:return Ba(a.child);case 4:return Ba(a.child);case 2:return{nodeType:"component",type:a.type,props:T({},a.memoizedProps),instance:a.stateNode,rendered:Ba(a.child)};case 1:return{nodeType:"component",type:a.type,props:T({},a.memoizedProps),instance:null,rendered:Ba(a.child)};case 5:return{nodeType:"host",type:a.type,props:T({},
94 | a.memoizedProps),instance:null,rendered:Zc(Yc(a.child).map(db))};case 6:return a.stateNode.text;case 10:case 13:case 12:case 11:case 15:case 14:return Ba(a.child);default:l("214",a.tag)}}function Lb(a){var b=Mb.get(a);void 0===b&&null!==a.alternate&&(b=Mb.get(a.alternate));void 0===b&&(b=new Ad(a),Mb.set(a,b));return b}function Nb(a){var b=[],c=a;if(null===c.child)return b;c.child.return=c;c=c.child;a:for(;;){var d=!1;Ob.has(c.tag)?b.push(Lb(c)):6===c.tag?b.push(""+c.memoizedProps):d=!0;if(d&&null!==
95 | c.child)c.child.return=c,c=c.child;else{for(;null===c.sibling;){if(c.return===a)break a;c=c.return}c.sibling.return=c.return;c=c.sibling}}return b}function eb(a,b,c){var d=c?c.deep:!0,e=[];if(b(a)&&(e.push(a),!d))return e;a.children.forEach(function(a){"string"!==typeof a&&e.push.apply(e,eb(a,b,c))});return e}function Pb(a,b){if(1===a.length)return a[0];throw Error((0===a.length?"No instances found ":"Expected 1 but found "+a.length+" instances ")+b);}var T=ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign,
96 | $c=ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F="function"===typeof Symbol&&Symbol.for,Ra=F?Symbol.for("react.element"):60103,oa=F?Symbol.for("react.portal"):60106,K=F?Symbol.for("react.fragment"):60107,Vb=F?Symbol.for("react.strict_mode"):60108,gb=F?Symbol.for("react.profiler"):60114,Yb=F?Symbol.for("react.provider"):60109,Xb=F?Symbol.for("react.context"):60110,Ub=F?Symbol.for("react.async_mode"):60111,Zb=F?Symbol.for("react.forward_ref"):60112,Wb=F?Symbol.for("react.placeholder"):60113,
97 | Tb="function"===typeof Symbol&&Symbol.iterator,Xa=function(){return 0},M=null,L=[],id=Da,jd=Da,kd=Da,ld=Da,qc={},td={},qd=bc,pd=cc,rd=dc;new Set;var ib=[],ca=-1,S={},I={current:S},x={current:!1},jb=S,nb=null,ob=null,O=!1,vb={current:null},ub={current:0},Ma=null,ha=null,Na=null,sa={},C={current:sa},ua={current:sa},ta={current:sa},hd=Object.prototype.hasOwnProperty,xc=(new ba.Component).refs,Pa={isMounted:function(a){return(a=a._reactInternalFiber)?2===Ca(a):!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;
98 | var d=Za();d=Va(d,a);var e=fa(d);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);U(a,e);X(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Za();d=Va(d,a);var e=fa(d);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);U(a,e);X(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Za();c=Va(c,a);var d=fa(c);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);U(a,d);X(a,c)}},Sa=Array.isArray,Cc=yc(!0),md=yc(!1),Ta=null,Bc=null,zb=!1,nd=$c.ReactCurrentOwner,Db=void 0,
99 | Qc=void 0,Rc=void 0;Db=function(a){};Qc=function(a,b,c,d,e,f,g,h){if(b.updateQueue=c)b.effectTag|=4};Rc=function(a,b,c,d){c!==d&&(b.effectTag|=4)};var ud={readContext:pc},Ua=$c.ReactCurrentOwner,ya=0,J=!1,u=null,Q=null,E=0,Cb=!1,k=null,xa=!1,P=null,Y=null,z=null,Ya=0,Hb=void 0,ja=!1,R=null,B=0,ab=!1,la=!1,bb=null,aa=null,Wa=!1,wd=!1,vd=!1,ka=null,Wc=Xa(),Z=(Wc/10|0)+2,Aa=Z,xd=50,za=0,Ib=null,zd=1,fb=null,Qb=null,Rb=!1,Bd=function(){function a(a,c){for(var b=0;bNb(a).length)break;return Lb(a)}a=a.return}return null}},{key:"children",get:function(){return Nb(this._currentFiber())}}]);return a}(),ad={create:function(a,b){var c=Cd,d=!1;"object"===typeof b&&null!==b&&("function"===typeof b.createNodeMock&&(c=b.createNodeMock),!0===b.unstable_isAsync&&(d=!0));var e={children:[],createNodeMock:c,tag:"CONTAINER"},f=gd(e,d,!1);null==f?l("215"):void 0;Jb(a,f,null,
104 | null);a={root:void 0,toJSON:function(){return null==f||null==f.current||null==e||0===e.children.length?null:1===e.children.length?Kb(e.children[0]):e.children.map(Kb)},toTree:function(){return null==f||null==f.current?null:db(f.current)},update:function(a){null!=f&&null!=f.current&&Jb(a,f,null,null)},unmount:function(){null!=f&&null!=f.current&&(Jb(null,f,null,null),f=e=null)},getInstance:function(){if(null==f||null==f.current)return null;a:{var a=f.current;if(a.child)switch(a.child.tag){case 5:a=
105 | Ea(a.child.stateNode);break a;default:a=a.child.stateNode}else a=null}return a},unstable_flushAll:dd,unstable_flushSync:function(a){hb();a:{ja?l("187"):void 0;var b=Wa;Wa=!0;try{b:{var c=ya;ya=1;try{var d=a(void 0,void 0,void 0,void 0);break b}finally{ya=c}d=void 0}break a}finally{Wa=b,Fb(1,null)}d=void 0}return d},unstable_flushNumberOfYields:ed,unstable_clearYields:hb};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===f)throw Error("Can't access .root on unmounted test renderer");
106 | var a=Nb(f.current);if(0===a.length)throw Error("Can't access .root on unmounted test renderer");return 1===a.length?a[0]:Lb(f.current)}});return a},unstable_yield:function(a){L.push(a)},unstable_clearYields:hb,unstable_batchedUpdates:function(a,b){if(Rb)return a(b);Rb=!0;try{return a(b)}finally{if(Rb=!1,(null!==fb||null!==Qb)&&fb&&(b=fb,a=Qb,Qb=fb=null,Xc(b),a))for(b=0;bu.length&&u.push(a)}function x(a,b,d,c){var e=typeof a;if("undefined"===e||"boolean"===
13 | 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 q:case R:g=!0}}if(g)return d(c,a,""===b?"."+y(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;ka;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(c){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");
18 | var d=Object(a);for(var c,e=1;e