react 16.0.0-alpha.5 → 16.0.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +0 -7
  2. package/cjs/react.development.js +2161 -0
  3. package/cjs/react.production.min.js +1 -0
  4. package/index.js +7 -0
  5. package/package.json +10 -9
  6. package/{dist/react.js → umd/react.development.js} +2960 -3263
  7. package/umd/react.production.min.js +4 -0
  8. package/dist/react.min.js +0 -17
  9. package/lib/KeyEscapeUtils.js +0 -58
  10. package/lib/PooledClass.js +0 -111
  11. package/lib/React.js +0 -84
  12. package/lib/ReactBaseClasses.js +0 -136
  13. package/lib/ReactChildren.js +0 -190
  14. package/lib/ReactClass.js +0 -698
  15. package/lib/ReactComponentTreeHook.js +0 -342
  16. package/lib/ReactComponentTreeHookUMDShim.js +0 -17
  17. package/lib/ReactCurrentOwner.js +0 -28
  18. package/lib/ReactCurrentOwnerUMDShim.js +0 -17
  19. package/lib/ReactDOMFactories.js +0 -169
  20. package/lib/ReactDebugCurrentFrame.js +0 -55
  21. package/lib/ReactElement.js +0 -340
  22. package/lib/ReactElementSymbol.js +0 -19
  23. package/lib/ReactElementType.js +0 -12
  24. package/lib/ReactElementValidator.js +0 -269
  25. package/lib/ReactFiberComponentTreeHook.js +0 -62
  26. package/lib/ReactNoopUpdateQueue.js +0 -90
  27. package/lib/ReactPropTypes.js +0 -458
  28. package/lib/ReactPropTypesSecret.js +0 -16
  29. package/lib/ReactTypeOfWork.js +0 -26
  30. package/lib/ReactUMDEntry.js +0 -31
  31. package/lib/ReactUMDShim.js +0 -15
  32. package/lib/ReactVersion.js +0 -13
  33. package/lib/canDefineProperty.js +0 -25
  34. package/lib/checkPropTypes.js +0 -64
  35. package/lib/checkReactTypeSpec.js +0 -22
  36. package/lib/deprecated.js +0 -56
  37. package/lib/flattenChildren.js +0 -75
  38. package/lib/getComponentName.js +0 -35
  39. package/lib/getIteratorFn.js +0 -40
  40. package/lib/getNextDebugID.js +0 -20
  41. package/lib/onlyChild.js +0 -37
  42. package/lib/reactProdInvariant.js +0 -38
  43. package/lib/traverseAllChildren.js +0 -164
  44. package/react.js +0 -3
package/README.md CHANGED
@@ -13,11 +13,4 @@ To use React in production mode, set the environment variable `NODE_ENV` to `pro
13
13
 
14
14
  ```js
15
15
  var React = require('react');
16
-
17
- // Addons are in separate packages:
18
- var createFragment = require('react-addons-create-fragment');
19
- var immutabilityHelpers = require('react-addons-update');
20
- var CSSTransitionGroup = require('react-addons-css-transition-group');
21
16
  ```
22
-
23
- For a complete list of addons visit the [addons documentation page](https://facebook.github.io/react/docs/addons.html).
@@ -0,0 +1,2161 @@
1
+ 'use strict';
2
+
3
+ var objectAssign$1 = require('object-assign');
4
+ var warning = require('fbjs/lib/warning');
5
+ var emptyObject = require('fbjs/lib/emptyObject');
6
+ var invariant = require('fbjs/lib/invariant');
7
+ var emptyFunction = require('fbjs/lib/emptyFunction');
8
+ var checkPropTypes = require('prop-types/checkPropTypes');
9
+ var factory = require('prop-types/factory');
10
+ var factory$1 = require('create-react-class/factory');
11
+
12
+ /**
13
+ * Copyright (c) 2013-present, Facebook, Inc.
14
+ * All rights reserved.
15
+ *
16
+ * This source code is licensed under the BSD-style license found in the
17
+ * LICENSE file in the root directory of this source tree. An additional grant
18
+ * of patent rights can be found in the PATENTS file in the same directory.
19
+ *
20
+ * @providesModule reactProdInvariant
21
+ *
22
+ */
23
+
24
+ function warnNoop(publicInstance, callerName) {
25
+ {
26
+ var constructor = publicInstance.constructor;
27
+ warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass');
28
+ }
29
+ }
30
+
31
+ /**
32
+ * This is the abstract API for an update queue.
33
+ */
34
+ var ReactNoopUpdateQueue = {
35
+ /**
36
+ * Checks whether or not this composite component is mounted.
37
+ * @param {ReactClass} publicInstance The instance we want to test.
38
+ * @return {boolean} True if mounted, false otherwise.
39
+ * @protected
40
+ * @final
41
+ */
42
+ isMounted: function (publicInstance) {
43
+ return false;
44
+ },
45
+
46
+ /**
47
+ * Forces an update. This should only be invoked when it is known with
48
+ * certainty that we are **not** in a DOM transaction.
49
+ *
50
+ * You may want to call this when you know that some deeper aspect of the
51
+ * component's state has changed but `setState` was not called.
52
+ *
53
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
54
+ * `componentWillUpdate` and `componentDidUpdate`.
55
+ *
56
+ * @param {ReactClass} publicInstance The instance that should rerender.
57
+ * @param {?function} callback Called after component is updated.
58
+ * @param {?string} Name of the calling function in the public API.
59
+ * @internal
60
+ */
61
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
62
+ warnNoop(publicInstance, 'forceUpdate');
63
+ },
64
+
65
+ /**
66
+ * Replaces all of the state. Always use this or `setState` to mutate state.
67
+ * You should treat `this.state` as immutable.
68
+ *
69
+ * There is no guarantee that `this.state` will be immediately updated, so
70
+ * accessing `this.state` after calling this method may return the old value.
71
+ *
72
+ * @param {ReactClass} publicInstance The instance that should rerender.
73
+ * @param {object} completeState Next state.
74
+ * @param {?function} callback Called after component is updated.
75
+ * @param {?string} Name of the calling function in the public API.
76
+ * @internal
77
+ */
78
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
79
+ warnNoop(publicInstance, 'replaceState');
80
+ },
81
+
82
+ /**
83
+ * Sets a subset of the state. This only exists because _pendingState is
84
+ * internal. This provides a merging strategy that is not available to deep
85
+ * properties which is confusing. TODO: Expose pendingState or don't use it
86
+ * during the merge.
87
+ *
88
+ * @param {ReactClass} publicInstance The instance that should rerender.
89
+ * @param {object} partialState Next partial state to be merged with state.
90
+ * @param {?function} callback Called after component is updated.
91
+ * @param {?string} Name of the calling function in the public API.
92
+ * @internal
93
+ */
94
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
95
+ warnNoop(publicInstance, 'setState');
96
+ }
97
+ };
98
+
99
+ var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
100
+
101
+ /**
102
+ * Copyright 2013-present, Facebook, Inc.
103
+ * All rights reserved.
104
+ *
105
+ * This source code is licensed under the BSD-style license found in the
106
+ * LICENSE file in the root directory of this source tree. An additional grant
107
+ * of patent rights can be found in the PATENTS file in the same directory.
108
+ *
109
+ *
110
+ * @providesModule canDefineProperty
111
+ */
112
+
113
+ var canDefineProperty$1 = false;
114
+ {
115
+ try {
116
+ // $FlowFixMe https://github.com/facebook/flow/issues/285
117
+ Object.defineProperty({}, 'x', { get: function () {} });
118
+ canDefineProperty$1 = true;
119
+ } catch (x) {
120
+ // IE will fail on defineProperty
121
+ }
122
+ }
123
+
124
+ var canDefineProperty_1 = canDefineProperty$1;
125
+
126
+ /**
127
+ * Base class helpers for the updating state of a component.
128
+ */
129
+ function ReactComponent(props, context, updater) {
130
+ this.props = props;
131
+ this.context = context;
132
+ this.refs = emptyObject;
133
+ // We initialize the default updater but the real one gets injected by the
134
+ // renderer.
135
+ this.updater = updater || ReactNoopUpdateQueue_1;
136
+ }
137
+
138
+ ReactComponent.prototype.isReactComponent = {};
139
+
140
+ /**
141
+ * Sets a subset of the state. Always use this to mutate
142
+ * state. You should treat `this.state` as immutable.
143
+ *
144
+ * There is no guarantee that `this.state` will be immediately updated, so
145
+ * accessing `this.state` after calling this method may return the old value.
146
+ *
147
+ * There is no guarantee that calls to `setState` will run synchronously,
148
+ * as they may eventually be batched together. You can provide an optional
149
+ * callback that will be executed when the call to setState is actually
150
+ * completed.
151
+ *
152
+ * When a function is provided to setState, it will be called at some point in
153
+ * the future (not synchronously). It will be called with the up to date
154
+ * component arguments (state, props, context). These values can be different
155
+ * from this.* because your function may be called after receiveProps but before
156
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
157
+ * assigned to this.
158
+ *
159
+ * @param {object|function} partialState Next partial state or function to
160
+ * produce next partial state to be merged with current state.
161
+ * @param {?function} callback Called after state is updated.
162
+ * @final
163
+ * @protected
164
+ */
165
+ ReactComponent.prototype.setState = function (partialState, callback) {
166
+ !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
167
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
168
+ };
169
+
170
+ /**
171
+ * Forces an update. This should only be invoked when it is known with
172
+ * certainty that we are **not** in a DOM transaction.
173
+ *
174
+ * You may want to call this when you know that some deeper aspect of the
175
+ * component's state has changed but `setState` was not called.
176
+ *
177
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
178
+ * `componentWillUpdate` and `componentDidUpdate`.
179
+ *
180
+ * @param {?function} callback Called after update is complete.
181
+ * @final
182
+ * @protected
183
+ */
184
+ ReactComponent.prototype.forceUpdate = function (callback) {
185
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
186
+ };
187
+
188
+ /**
189
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
190
+ * we would like to deprecate them, we're not going to move them over to this
191
+ * modern base class. Instead, we define a getter that warns if it's accessed.
192
+ */
193
+ {
194
+ var deprecatedAPIs = {
195
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
196
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
197
+ };
198
+ var defineDeprecationWarning = function (methodName, info) {
199
+ if (canDefineProperty_1) {
200
+ Object.defineProperty(ReactComponent.prototype, methodName, {
201
+ get: function () {
202
+ warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
203
+ return undefined;
204
+ }
205
+ });
206
+ }
207
+ };
208
+ for (var fnName in deprecatedAPIs) {
209
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
210
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
211
+ }
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Base class helpers for the updating state of a component.
217
+ */
218
+ function ReactPureComponent(props, context, updater) {
219
+ // Duplicated from ReactComponent.
220
+ this.props = props;
221
+ this.context = context;
222
+ this.refs = emptyObject;
223
+ // We initialize the default updater but the real one gets injected by the
224
+ // renderer.
225
+ this.updater = updater || ReactNoopUpdateQueue_1;
226
+ }
227
+
228
+ function ComponentDummy() {}
229
+ ComponentDummy.prototype = ReactComponent.prototype;
230
+ ReactPureComponent.prototype = new ComponentDummy();
231
+ ReactPureComponent.prototype.constructor = ReactPureComponent;
232
+ // Avoid an extra prototype jump for these methods.
233
+ objectAssign$1(ReactPureComponent.prototype, ReactComponent.prototype);
234
+ ReactPureComponent.prototype.isPureReactComponent = true;
235
+
236
+ var ReactBaseClasses = {
237
+ Component: ReactComponent,
238
+ PureComponent: ReactPureComponent
239
+ };
240
+
241
+ /**
242
+ * Static poolers. Several custom versions for each potential number of
243
+ * arguments. A completely generic pooler is easy to implement, but would
244
+ * require accessing the `arguments` object. In each of these, `this` refers to
245
+ * the Class itself, not an instance. If any others are needed, simply add them
246
+ * here, or in their own files.
247
+ */
248
+ var oneArgumentPooler = function (copyFieldsFrom) {
249
+ var Klass = this;
250
+ if (Klass.instancePool.length) {
251
+ var instance = Klass.instancePool.pop();
252
+ Klass.call(instance, copyFieldsFrom);
253
+ return instance;
254
+ } else {
255
+ return new Klass(copyFieldsFrom);
256
+ }
257
+ };
258
+
259
+ var twoArgumentPooler$1 = function (a1, a2) {
260
+ var Klass = this;
261
+ if (Klass.instancePool.length) {
262
+ var instance = Klass.instancePool.pop();
263
+ Klass.call(instance, a1, a2);
264
+ return instance;
265
+ } else {
266
+ return new Klass(a1, a2);
267
+ }
268
+ };
269
+
270
+ var threeArgumentPooler = function (a1, a2, a3) {
271
+ var Klass = this;
272
+ if (Klass.instancePool.length) {
273
+ var instance = Klass.instancePool.pop();
274
+ Klass.call(instance, a1, a2, a3);
275
+ return instance;
276
+ } else {
277
+ return new Klass(a1, a2, a3);
278
+ }
279
+ };
280
+
281
+ var fourArgumentPooler$1 = function (a1, a2, a3, a4) {
282
+ var Klass = this;
283
+ if (Klass.instancePool.length) {
284
+ var instance = Klass.instancePool.pop();
285
+ Klass.call(instance, a1, a2, a3, a4);
286
+ return instance;
287
+ } else {
288
+ return new Klass(a1, a2, a3, a4);
289
+ }
290
+ };
291
+
292
+ var standardReleaser = function (instance) {
293
+ var Klass = this;
294
+ !(instance instanceof Klass) ? invariant(false, 'Trying to release an instance into a pool of a different type.') : void 0;
295
+ instance.destructor();
296
+ if (Klass.instancePool.length < Klass.poolSize) {
297
+ Klass.instancePool.push(instance);
298
+ }
299
+ };
300
+
301
+ var DEFAULT_POOL_SIZE = 10;
302
+ var DEFAULT_POOLER = oneArgumentPooler;
303
+
304
+ /**
305
+ * Augments `CopyConstructor` to be a poolable class, augmenting only the class
306
+ * itself (statically) not adding any prototypical fields. Any CopyConstructor
307
+ * you give this may have a `poolSize` property, and will look for a
308
+ * prototypical `destructor` on instances.
309
+ *
310
+ * @param {Function} CopyConstructor Constructor that can be used to reset.
311
+ * @param {Function} pooler Customizable pooler.
312
+ */
313
+ var addPoolingTo = function (CopyConstructor, pooler) {
314
+ // Casting as any so that flow ignores the actual implementation and trusts
315
+ // it to match the type we declared
316
+ var NewKlass = CopyConstructor;
317
+ NewKlass.instancePool = [];
318
+ NewKlass.getPooled = pooler || DEFAULT_POOLER;
319
+ if (!NewKlass.poolSize) {
320
+ NewKlass.poolSize = DEFAULT_POOL_SIZE;
321
+ }
322
+ NewKlass.release = standardReleaser;
323
+ return NewKlass;
324
+ };
325
+
326
+ var PooledClass = {
327
+ addPoolingTo: addPoolingTo,
328
+ oneArgumentPooler: oneArgumentPooler,
329
+ twoArgumentPooler: twoArgumentPooler$1,
330
+ threeArgumentPooler: threeArgumentPooler,
331
+ fourArgumentPooler: fourArgumentPooler$1
332
+ };
333
+
334
+ var PooledClass_1 = PooledClass;
335
+
336
+ /**
337
+ * Copyright 2013-present, Facebook, Inc.
338
+ * All rights reserved.
339
+ *
340
+ * This source code is licensed under the BSD-style license found in the
341
+ * LICENSE file in the root directory of this source tree. An additional grant
342
+ * of patent rights can be found in the PATENTS file in the same directory.
343
+ *
344
+ * @providesModule ReactCurrentOwner
345
+ *
346
+ */
347
+
348
+ /**
349
+ * Keeps track of the current owner.
350
+ *
351
+ * The current owner is the component who should own any components that are
352
+ * currently being constructed.
353
+ */
354
+ var ReactCurrentOwner = {
355
+ /**
356
+ * @internal
357
+ * @type {ReactComponent}
358
+ */
359
+ current: null
360
+ };
361
+
362
+ var ReactCurrentOwner_1 = ReactCurrentOwner;
363
+
364
+ /**
365
+ * Copyright 2014-present, Facebook, Inc.
366
+ * All rights reserved.
367
+ *
368
+ * This source code is licensed under the BSD-style license found in the
369
+ * LICENSE file in the root directory of this source tree. An additional grant
370
+ * of patent rights can be found in the PATENTS file in the same directory.
371
+ *
372
+ * @providesModule ReactElementSymbol
373
+ *
374
+ */
375
+
376
+ // The Symbol used to tag the ReactElement type. If there is no native Symbol
377
+ // nor polyfill, then a plain number is used for performance.
378
+
379
+ var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
380
+
381
+ var ReactElementSymbol = REACT_ELEMENT_TYPE;
382
+
383
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
384
+
385
+
386
+
387
+ var RESERVED_PROPS = {
388
+ key: true,
389
+ ref: true,
390
+ __self: true,
391
+ __source: true
392
+ };
393
+
394
+ var specialPropKeyWarningShown;
395
+ var specialPropRefWarningShown;
396
+
397
+ function hasValidRef(config) {
398
+ {
399
+ if (hasOwnProperty.call(config, 'ref')) {
400
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
401
+ if (getter && getter.isReactWarning) {
402
+ return false;
403
+ }
404
+ }
405
+ }
406
+ return config.ref !== undefined;
407
+ }
408
+
409
+ function hasValidKey(config) {
410
+ {
411
+ if (hasOwnProperty.call(config, 'key')) {
412
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
413
+ if (getter && getter.isReactWarning) {
414
+ return false;
415
+ }
416
+ }
417
+ }
418
+ return config.key !== undefined;
419
+ }
420
+
421
+ function defineKeyPropWarningGetter(props, displayName) {
422
+ var warnAboutAccessingKey = function () {
423
+ if (!specialPropKeyWarningShown) {
424
+ specialPropKeyWarningShown = true;
425
+ warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
426
+ }
427
+ };
428
+ warnAboutAccessingKey.isReactWarning = true;
429
+ Object.defineProperty(props, 'key', {
430
+ get: warnAboutAccessingKey,
431
+ configurable: true
432
+ });
433
+ }
434
+
435
+ function defineRefPropWarningGetter(props, displayName) {
436
+ var warnAboutAccessingRef = function () {
437
+ if (!specialPropRefWarningShown) {
438
+ specialPropRefWarningShown = true;
439
+ warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
440
+ }
441
+ };
442
+ warnAboutAccessingRef.isReactWarning = true;
443
+ Object.defineProperty(props, 'ref', {
444
+ get: warnAboutAccessingRef,
445
+ configurable: true
446
+ });
447
+ }
448
+
449
+ /**
450
+ * Factory method to create a new React element. This no longer adheres to
451
+ * the class pattern, so do not use new to call it. Also, no instanceof check
452
+ * will work. Instead test $$typeof field against Symbol.for('react.element') to check
453
+ * if something is a React Element.
454
+ *
455
+ * @param {*} type
456
+ * @param {*} key
457
+ * @param {string|object} ref
458
+ * @param {*} self A *temporary* helper to detect places where `this` is
459
+ * different from the `owner` when React.createElement is called, so that we
460
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
461
+ * functions, and as long as `this` and owner are the same, there will be no
462
+ * change in behavior.
463
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
464
+ * indicating filename, line number, and/or other information.
465
+ * @param {*} owner
466
+ * @param {*} props
467
+ * @internal
468
+ */
469
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
470
+ var element = {
471
+ // This tag allow us to uniquely identify this as a React Element
472
+ $$typeof: ReactElementSymbol,
473
+
474
+ // Built-in properties that belong on the element
475
+ type: type,
476
+ key: key,
477
+ ref: ref,
478
+ props: props,
479
+
480
+ // Record the component responsible for creating this element.
481
+ _owner: owner
482
+ };
483
+
484
+ {
485
+ // The validation flag is currently mutative. We put it on
486
+ // an external backing store so that we can freeze the whole object.
487
+ // This can be replaced with a WeakMap once they are implemented in
488
+ // commonly used development environments.
489
+ element._store = {};
490
+
491
+ // To make comparing ReactElements easier for testing purposes, we make
492
+ // the validation flag non-enumerable (where possible, which should
493
+ // include every environment we run tests in), so the test framework
494
+ // ignores it.
495
+ if (canDefineProperty_1) {
496
+ Object.defineProperty(element._store, 'validated', {
497
+ configurable: false,
498
+ enumerable: false,
499
+ writable: true,
500
+ value: false
501
+ });
502
+ // self and source are DEV only properties.
503
+ Object.defineProperty(element, '_self', {
504
+ configurable: false,
505
+ enumerable: false,
506
+ writable: false,
507
+ value: self
508
+ });
509
+ // Two elements created in two different places should be considered
510
+ // equal for testing purposes and therefore we hide it from enumeration.
511
+ Object.defineProperty(element, '_source', {
512
+ configurable: false,
513
+ enumerable: false,
514
+ writable: false,
515
+ value: source
516
+ });
517
+ } else {
518
+ element._store.validated = false;
519
+ element._self = self;
520
+ element._source = source;
521
+ }
522
+ if (Object.freeze) {
523
+ Object.freeze(element.props);
524
+ Object.freeze(element);
525
+ }
526
+ }
527
+
528
+ return element;
529
+ };
530
+
531
+ /**
532
+ * Create and return a new ReactElement of the given type.
533
+ * See https://facebook.github.io/react/docs/react-api.html#createelement
534
+ */
535
+ ReactElement.createElement = function (type, config, children) {
536
+ var propName;
537
+
538
+ // Reserved names are extracted
539
+ var props = {};
540
+
541
+ var key = null;
542
+ var ref = null;
543
+ var self = null;
544
+ var source = null;
545
+
546
+ if (config != null) {
547
+ if (hasValidRef(config)) {
548
+ ref = config.ref;
549
+ }
550
+ if (hasValidKey(config)) {
551
+ key = '' + config.key;
552
+ }
553
+
554
+ self = config.__self === undefined ? null : config.__self;
555
+ source = config.__source === undefined ? null : config.__source;
556
+ // Remaining properties are added to a new props object
557
+ for (propName in config) {
558
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
559
+ props[propName] = config[propName];
560
+ }
561
+ }
562
+ }
563
+
564
+ // Children can be more than one argument, and those are transferred onto
565
+ // the newly allocated props object.
566
+ var childrenLength = arguments.length - 2;
567
+ if (childrenLength === 1) {
568
+ props.children = children;
569
+ } else if (childrenLength > 1) {
570
+ var childArray = Array(childrenLength);
571
+ for (var i = 0; i < childrenLength; i++) {
572
+ childArray[i] = arguments[i + 2];
573
+ }
574
+ {
575
+ if (Object.freeze) {
576
+ Object.freeze(childArray);
577
+ }
578
+ }
579
+ props.children = childArray;
580
+ }
581
+
582
+ // Resolve default props
583
+ if (type && type.defaultProps) {
584
+ var defaultProps = type.defaultProps;
585
+ for (propName in defaultProps) {
586
+ if (props[propName] === undefined) {
587
+ props[propName] = defaultProps[propName];
588
+ }
589
+ }
590
+ }
591
+ {
592
+ if (key || ref) {
593
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== ReactElementSymbol) {
594
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
595
+ if (key) {
596
+ defineKeyPropWarningGetter(props, displayName);
597
+ }
598
+ if (ref) {
599
+ defineRefPropWarningGetter(props, displayName);
600
+ }
601
+ }
602
+ }
603
+ }
604
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner_1.current, props);
605
+ };
606
+
607
+ /**
608
+ * Return a function that produces ReactElements of a given type.
609
+ * See https://facebook.github.io/react/docs/react-api.html#createfactory
610
+ */
611
+ ReactElement.createFactory = function (type) {
612
+ var factory$$1 = ReactElement.createElement.bind(null, type);
613
+ // Expose the type on the factory and the prototype so that it can be
614
+ // easily accessed on elements. E.g. `<Foo />.type === Foo`.
615
+ // This should not be named `constructor` since this may not be the function
616
+ // that created the element, and it may not even be a constructor.
617
+ // Legacy hook TODO: Warn if this is accessed
618
+ factory$$1.type = type;
619
+ return factory$$1;
620
+ };
621
+
622
+ ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
623
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
624
+
625
+ return newElement;
626
+ };
627
+
628
+ /**
629
+ * Clone and return a new ReactElement using element as the starting point.
630
+ * See https://facebook.github.io/react/docs/react-api.html#cloneelement
631
+ */
632
+ ReactElement.cloneElement = function (element, config, children) {
633
+ var propName;
634
+
635
+ // Original props are copied
636
+ var props = objectAssign$1({}, element.props);
637
+
638
+ // Reserved names are extracted
639
+ var key = element.key;
640
+ var ref = element.ref;
641
+ // Self is preserved since the owner is preserved.
642
+ var self = element._self;
643
+ // Source is preserved since cloneElement is unlikely to be targeted by a
644
+ // transpiler, and the original source is probably a better indicator of the
645
+ // true owner.
646
+ var source = element._source;
647
+
648
+ // Owner will be preserved, unless ref is overridden
649
+ var owner = element._owner;
650
+
651
+ if (config != null) {
652
+ if (hasValidRef(config)) {
653
+ // Silently steal the ref from the parent.
654
+ ref = config.ref;
655
+ owner = ReactCurrentOwner_1.current;
656
+ }
657
+ if (hasValidKey(config)) {
658
+ key = '' + config.key;
659
+ }
660
+
661
+ // Remaining properties override existing props
662
+ var defaultProps;
663
+ if (element.type && element.type.defaultProps) {
664
+ defaultProps = element.type.defaultProps;
665
+ }
666
+ for (propName in config) {
667
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
668
+ if (config[propName] === undefined && defaultProps !== undefined) {
669
+ // Resolve default props
670
+ props[propName] = defaultProps[propName];
671
+ } else {
672
+ props[propName] = config[propName];
673
+ }
674
+ }
675
+ }
676
+ }
677
+
678
+ // Children can be more than one argument, and those are transferred onto
679
+ // the newly allocated props object.
680
+ var childrenLength = arguments.length - 2;
681
+ if (childrenLength === 1) {
682
+ props.children = children;
683
+ } else if (childrenLength > 1) {
684
+ var childArray = Array(childrenLength);
685
+ for (var i = 0; i < childrenLength; i++) {
686
+ childArray[i] = arguments[i + 2];
687
+ }
688
+ props.children = childArray;
689
+ }
690
+
691
+ return ReactElement(element.type, key, ref, self, source, owner, props);
692
+ };
693
+
694
+ /**
695
+ * Verifies the object is a ReactElement.
696
+ * See https://facebook.github.io/react/docs/react-api.html#isvalidelement
697
+ * @param {?object} object
698
+ * @return {boolean} True if `object` is a valid component.
699
+ * @final
700
+ */
701
+ ReactElement.isValidElement = function (object) {
702
+ return typeof object === 'object' && object !== null && object.$$typeof === ReactElementSymbol;
703
+ };
704
+
705
+ var ReactElement_1 = ReactElement;
706
+
707
+ /**
708
+ * Copyright 2013-present, Facebook, Inc.
709
+ * All rights reserved.
710
+ *
711
+ * This source code is licensed under the BSD-style license found in the
712
+ * LICENSE file in the root directory of this source tree. An additional grant
713
+ * of patent rights can be found in the PATENTS file in the same directory.
714
+ *
715
+ * @providesModule getIteratorFn
716
+ *
717
+ */
718
+
719
+ /* global Symbol */
720
+
721
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
722
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
723
+
724
+ /**
725
+ * Returns the iterator method function contained on the iterable object.
726
+ *
727
+ * Be sure to invoke the function with the iterable as context:
728
+ *
729
+ * var iteratorFn = getIteratorFn(myIterable);
730
+ * if (iteratorFn) {
731
+ * var iterator = iteratorFn.call(myIterable);
732
+ * ...
733
+ * }
734
+ *
735
+ * @param {?object} maybeIterable
736
+ * @return {?function}
737
+ */
738
+ function getIteratorFn(maybeIterable) {
739
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
740
+ if (typeof iteratorFn === 'function') {
741
+ return iteratorFn;
742
+ }
743
+ }
744
+
745
+ var getIteratorFn_1 = getIteratorFn;
746
+
747
+ /**
748
+ * Copyright 2013-present, Facebook, Inc.
749
+ * All rights reserved.
750
+ *
751
+ * This source code is licensed under the BSD-style license found in the
752
+ * LICENSE file in the root directory of this source tree. An additional grant
753
+ * of patent rights can be found in the PATENTS file in the same directory.
754
+ *
755
+ * @providesModule KeyEscapeUtils
756
+ *
757
+ */
758
+
759
+ /**
760
+ * Escape and wrap key so it is safe to use as a reactid
761
+ *
762
+ * @param {string} key to be escaped.
763
+ * @return {string} the escaped key.
764
+ */
765
+
766
+ function escape(key) {
767
+ var escapeRegex = /[=:]/g;
768
+ var escaperLookup = {
769
+ '=': '=0',
770
+ ':': '=2'
771
+ };
772
+ var escapedString = ('' + key).replace(escapeRegex, function (match) {
773
+ return escaperLookup[match];
774
+ });
775
+
776
+ return '$' + escapedString;
777
+ }
778
+
779
+ /**
780
+ * Unescape and unwrap key for human-readable display
781
+ *
782
+ * @param {string} key to unescape.
783
+ * @return {string} the unescaped key.
784
+ */
785
+ function unescape(key) {
786
+ var unescapeRegex = /(=0|=2)/g;
787
+ var unescaperLookup = {
788
+ '=0': '=',
789
+ '=2': ':'
790
+ };
791
+ var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
792
+
793
+ return ('' + keySubstring).replace(unescapeRegex, function (match) {
794
+ return unescaperLookup[match];
795
+ });
796
+ }
797
+
798
+ var KeyEscapeUtils = {
799
+ escape: escape,
800
+ unescape: unescape
801
+ };
802
+
803
+ var KeyEscapeUtils_1 = KeyEscapeUtils;
804
+
805
+ var SEPARATOR = '.';
806
+ var SUBSEPARATOR = ':';
807
+
808
+ /**
809
+ * This is inlined from ReactElement since this file is shared between
810
+ * isomorphic and renderers. We could extract this to a
811
+ *
812
+ */
813
+
814
+ /**
815
+ * TODO: Test that a single child and an array with one item have the same key
816
+ * pattern.
817
+ */
818
+
819
+ var didWarnAboutMaps = false;
820
+
821
+ /**
822
+ * Generate a key string that identifies a component within a set.
823
+ *
824
+ * @param {*} component A component that could contain a manual key.
825
+ * @param {number} index Index that is used if a manual key is not provided.
826
+ * @return {string}
827
+ */
828
+ function getComponentKey(component, index) {
829
+ // Do some typechecking here since we call this blindly. We want to ensure
830
+ // that we don't block potential future ES APIs.
831
+ if (component && typeof component === 'object' && component.key != null) {
832
+ // Explicit key
833
+ return KeyEscapeUtils_1.escape(component.key);
834
+ }
835
+ // Implicit key determined by the index in the set
836
+ return index.toString(36);
837
+ }
838
+
839
+ /**
840
+ * @param {?*} children Children tree container.
841
+ * @param {!string} nameSoFar Name of the key path so far.
842
+ * @param {!function} callback Callback to invoke with each child found.
843
+ * @param {?*} traverseContext Used to pass information throughout the traversal
844
+ * process.
845
+ * @return {!number} The number of children in this subtree.
846
+ */
847
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
848
+ var type = typeof children;
849
+
850
+ if (type === 'undefined' || type === 'boolean') {
851
+ // All of the above are perceived as null.
852
+ children = null;
853
+ }
854
+
855
+ if (children === null || type === 'string' || type === 'number' ||
856
+ // The following is inlined from ReactElement. This means we can optimize
857
+ // some checks. React Fiber also inlines this logic for similar purposes.
858
+ type === 'object' && children.$$typeof === ReactElementSymbol) {
859
+ callback(traverseContext, children,
860
+ // If it's the only child, treat the name as if it was wrapped in an array
861
+ // so that it's consistent if the number of children grows.
862
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
863
+ return 1;
864
+ }
865
+
866
+ var child;
867
+ var nextName;
868
+ var subtreeCount = 0; // Count of children found in the current subtree.
869
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
870
+
871
+ if (Array.isArray(children)) {
872
+ for (var i = 0; i < children.length; i++) {
873
+ child = children[i];
874
+ nextName = nextNamePrefix + getComponentKey(child, i);
875
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
876
+ }
877
+ } else {
878
+ var iteratorFn = getIteratorFn_1(children);
879
+ if (iteratorFn) {
880
+ {
881
+ // Warn about using Maps as children
882
+ if (iteratorFn === children.entries) {
883
+ var mapsAsChildrenAddendum = '';
884
+ if (ReactCurrentOwner_1.current) {
885
+ var mapsAsChildrenOwnerName = ReactCurrentOwner_1.current.getName();
886
+ if (mapsAsChildrenOwnerName) {
887
+ mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
888
+ }
889
+ }
890
+ warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', mapsAsChildrenAddendum);
891
+ didWarnAboutMaps = true;
892
+ }
893
+ }
894
+
895
+ var iterator = iteratorFn.call(children);
896
+ var step;
897
+ var ii = 0;
898
+ while (!(step = iterator.next()).done) {
899
+ child = step.value;
900
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
901
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
902
+ }
903
+ } else if (type === 'object') {
904
+ var addendum = '';
905
+ {
906
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.';
907
+ if (ReactCurrentOwner_1.current) {
908
+ var name = ReactCurrentOwner_1.current.getName();
909
+ if (name) {
910
+ addendum += '\n\nCheck the render method of `' + name + '`.';
911
+ }
912
+ }
913
+ }
914
+ var childrenString = '' + children;
915
+ invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
916
+ }
917
+ }
918
+
919
+ return subtreeCount;
920
+ }
921
+
922
+ /**
923
+ * Traverses children that are typically specified as `props.children`, but
924
+ * might also be specified through attributes:
925
+ *
926
+ * - `traverseAllChildren(this.props.children, ...)`
927
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
928
+ *
929
+ * The `traverseContext` is an optional argument that is passed through the
930
+ * entire traversal. It can be used to store accumulations or anything else that
931
+ * the callback might find relevant.
932
+ *
933
+ * @param {?*} children Children tree object.
934
+ * @param {!function} callback To invoke upon traversing each child.
935
+ * @param {?*} traverseContext Context for traversal.
936
+ * @return {!number} The number of children in this subtree.
937
+ */
938
+ function traverseAllChildren(children, callback, traverseContext) {
939
+ if (children == null) {
940
+ return 0;
941
+ }
942
+
943
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
944
+ }
945
+
946
+ var traverseAllChildren_1 = traverseAllChildren;
947
+
948
+ var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
949
+ var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
950
+
951
+ var userProvidedKeyEscapeRegex = /\/+/g;
952
+ function escapeUserProvidedKey(text) {
953
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
954
+ }
955
+
956
+ /**
957
+ * PooledClass representing the bookkeeping associated with performing a child
958
+ * traversal. Allows avoiding binding callbacks.
959
+ *
960
+ * @constructor ForEachBookKeeping
961
+ * @param {!function} forEachFunction Function to perform traversal with.
962
+ * @param {?*} forEachContext Context to perform context with.
963
+ */
964
+ function ForEachBookKeeping(forEachFunction, forEachContext) {
965
+ this.func = forEachFunction;
966
+ this.context = forEachContext;
967
+ this.count = 0;
968
+ }
969
+ ForEachBookKeeping.prototype.destructor = function () {
970
+ this.func = null;
971
+ this.context = null;
972
+ this.count = 0;
973
+ };
974
+ PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
975
+
976
+ function forEachSingleChild(bookKeeping, child, name) {
977
+ var func = bookKeeping.func,
978
+ context = bookKeeping.context;
979
+
980
+ func.call(context, child, bookKeeping.count++);
981
+ }
982
+
983
+ /**
984
+ * Iterates through children that are typically specified as `props.children`.
985
+ *
986
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
987
+ *
988
+ * The provided forEachFunc(child, index) will be called for each
989
+ * leaf child.
990
+ *
991
+ * @param {?*} children Children tree container.
992
+ * @param {function(*, int)} forEachFunc
993
+ * @param {*} forEachContext Context for forEachContext.
994
+ */
995
+ function forEachChildren(children, forEachFunc, forEachContext) {
996
+ if (children == null) {
997
+ return children;
998
+ }
999
+ var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
1000
+ traverseAllChildren_1(children, forEachSingleChild, traverseContext);
1001
+ ForEachBookKeeping.release(traverseContext);
1002
+ }
1003
+
1004
+ /**
1005
+ * PooledClass representing the bookkeeping associated with performing a child
1006
+ * mapping. Allows avoiding binding callbacks.
1007
+ *
1008
+ * @constructor MapBookKeeping
1009
+ * @param {!*} mapResult Object containing the ordered map of results.
1010
+ * @param {!function} mapFunction Function to perform mapping with.
1011
+ * @param {?*} mapContext Context to perform mapping with.
1012
+ */
1013
+ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1014
+ this.result = mapResult;
1015
+ this.keyPrefix = keyPrefix;
1016
+ this.func = mapFunction;
1017
+ this.context = mapContext;
1018
+ this.count = 0;
1019
+ }
1020
+ MapBookKeeping.prototype.destructor = function () {
1021
+ this.result = null;
1022
+ this.keyPrefix = null;
1023
+ this.func = null;
1024
+ this.context = null;
1025
+ this.count = 0;
1026
+ };
1027
+ PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1028
+
1029
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1030
+ var result = bookKeeping.result,
1031
+ keyPrefix = bookKeeping.keyPrefix,
1032
+ func = bookKeeping.func,
1033
+ context = bookKeeping.context;
1034
+
1035
+
1036
+ var mappedChild = func.call(context, child, bookKeeping.count++);
1037
+ if (Array.isArray(mappedChild)) {
1038
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
1039
+ } else if (mappedChild != null) {
1040
+ if (ReactElement_1.isValidElement(mappedChild)) {
1041
+ mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1042
+ // Keep both the (mapped) and old keys if they differ, just as
1043
+ // traverseAllChildren used to do for objects as children
1044
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1045
+ }
1046
+ result.push(mappedChild);
1047
+ }
1048
+ }
1049
+
1050
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1051
+ var escapedPrefix = '';
1052
+ if (prefix != null) {
1053
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1054
+ }
1055
+ var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1056
+ traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1057
+ MapBookKeeping.release(traverseContext);
1058
+ }
1059
+
1060
+ /**
1061
+ * Maps children that are typically specified as `props.children`.
1062
+ *
1063
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1064
+ *
1065
+ * The provided mapFunction(child, key, index) will be called for each
1066
+ * leaf child.
1067
+ *
1068
+ * @param {?*} children Children tree container.
1069
+ * @param {function(*, int)} func The map function.
1070
+ * @param {*} context Context for mapFunction.
1071
+ * @return {object} Object containing the ordered map of results.
1072
+ */
1073
+ function mapChildren(children, func, context) {
1074
+ if (children == null) {
1075
+ return children;
1076
+ }
1077
+ var result = [];
1078
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1079
+ return result;
1080
+ }
1081
+
1082
+ function forEachSingleChildDummy(traverseContext, child, name) {
1083
+ return null;
1084
+ }
1085
+
1086
+ /**
1087
+ * Count the number of children that are typically specified as
1088
+ * `props.children`.
1089
+ *
1090
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1091
+ *
1092
+ * @param {?*} children Children tree container.
1093
+ * @return {number} The number of children.
1094
+ */
1095
+ function countChildren(children, context) {
1096
+ return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1097
+ }
1098
+
1099
+ /**
1100
+ * Flatten a children object (typically specified as `props.children`) and
1101
+ * return an array with appropriately re-keyed children.
1102
+ *
1103
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1104
+ */
1105
+ function toArray(children) {
1106
+ var result = [];
1107
+ mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
1108
+ return result;
1109
+ }
1110
+
1111
+ var ReactChildren = {
1112
+ forEach: forEachChildren,
1113
+ map: mapChildren,
1114
+ mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1115
+ count: countChildren,
1116
+ toArray: toArray
1117
+ };
1118
+
1119
+ var ReactChildren_1 = ReactChildren;
1120
+
1121
+ /**
1122
+ * Copyright 2013-present, Facebook, Inc.
1123
+ * All rights reserved.
1124
+ *
1125
+ * This source code is licensed under the BSD-style license found in the
1126
+ * LICENSE file in the root directory of this source tree. An additional grant
1127
+ * of patent rights can be found in the PATENTS file in the same directory.
1128
+ *
1129
+ * @providesModule getComponentName
1130
+ *
1131
+ */
1132
+
1133
+ function getComponentName(instanceOrFiber) {
1134
+ if (typeof instanceOrFiber.getName === 'function') {
1135
+ // Stack reconciler
1136
+ var instance = instanceOrFiber;
1137
+ return instance.getName();
1138
+ }
1139
+ if (typeof instanceOrFiber.tag === 'number') {
1140
+ // Fiber reconciler
1141
+ var fiber = instanceOrFiber;
1142
+ var type = fiber.type;
1143
+
1144
+ if (typeof type === 'string') {
1145
+ return type;
1146
+ }
1147
+ if (typeof type === 'function') {
1148
+ return type.displayName || type.name;
1149
+ }
1150
+ }
1151
+ return null;
1152
+ }
1153
+
1154
+ var getComponentName_1 = getComponentName;
1155
+
1156
+ var checkPropTypes$2 = checkPropTypes;
1157
+
1158
+ /**
1159
+ * Copyright 2013-present, Facebook, Inc.
1160
+ * All rights reserved.
1161
+ *
1162
+ * This source code is licensed under the BSD-style license found in the
1163
+ * LICENSE file in the root directory of this source tree. An additional grant
1164
+ * of patent rights can be found in the PATENTS file in the same directory.
1165
+ *
1166
+ * @providesModule ReactTypeOfWork
1167
+ *
1168
+ */
1169
+
1170
+ var ReactTypeOfWork = {
1171
+ IndeterminateComponent: 0, // Before we know whether it is functional or class
1172
+ FunctionalComponent: 1,
1173
+ ClassComponent: 2,
1174
+ HostRoot: 3, // Root of a host tree. Could be nested inside another node.
1175
+ HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
1176
+ HostComponent: 5,
1177
+ HostText: 6,
1178
+ CoroutineComponent: 7,
1179
+ CoroutineHandlerPhase: 8,
1180
+ YieldComponent: 9,
1181
+ Fragment: 10
1182
+ };
1183
+
1184
+ var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1185
+ var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1186
+ var ClassComponent = ReactTypeOfWork.ClassComponent;
1187
+ var HostComponent = ReactTypeOfWork.HostComponent;
1188
+
1189
+
1190
+
1191
+ function describeComponentFrame$1(name, source, ownerName) {
1192
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1193
+ }
1194
+
1195
+ function describeFiber(fiber) {
1196
+ switch (fiber.tag) {
1197
+ case IndeterminateComponent:
1198
+ case FunctionalComponent:
1199
+ case ClassComponent:
1200
+ case HostComponent:
1201
+ var owner = fiber._debugOwner;
1202
+ var source = fiber._debugSource;
1203
+ var name = getComponentName_1(fiber);
1204
+ var ownerName = null;
1205
+ if (owner) {
1206
+ ownerName = getComponentName_1(owner);
1207
+ }
1208
+ return describeComponentFrame$1(name, source, ownerName);
1209
+ default:
1210
+ return '';
1211
+ }
1212
+ }
1213
+
1214
+ // This function can only be called with a work-in-progress fiber and
1215
+ // only during begin or complete phase. Do not call it under any other
1216
+ // circumstances.
1217
+ function getStackAddendumByWorkInProgressFiber$2(workInProgress) {
1218
+ var info = '';
1219
+ var node = workInProgress;
1220
+ do {
1221
+ info += describeFiber(node);
1222
+ // Otherwise this return pointer might point to the wrong tree:
1223
+ node = node['return'];
1224
+ } while (node);
1225
+ return info;
1226
+ }
1227
+
1228
+ var ReactFiberComponentTreeHook = {
1229
+ getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$2,
1230
+ describeComponentFrame: describeComponentFrame$1
1231
+ };
1232
+
1233
+ var getStackAddendumByWorkInProgressFiber$1 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1234
+ var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1235
+
1236
+
1237
+
1238
+
1239
+
1240
+ function isNative(fn) {
1241
+ // Based on isNative() from Lodash
1242
+ var funcToString = Function.prototype.toString;
1243
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1244
+ var reIsNative = RegExp('^' + funcToString
1245
+ // Take an example native function source for comparison
1246
+ .call(hasOwnProperty)
1247
+ // Strip regex characters so we can use it for regex
1248
+ .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1249
+ // Remove hasOwnProperty from the template to make it generic
1250
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1251
+ try {
1252
+ var source = funcToString.call(fn);
1253
+ return reIsNative.test(source);
1254
+ } catch (err) {
1255
+ return false;
1256
+ }
1257
+ }
1258
+
1259
+ var canUseCollections =
1260
+ // Array.from
1261
+ typeof Array.from === 'function' &&
1262
+ // Map
1263
+ typeof Map === 'function' && isNative(Map) &&
1264
+ // Map.prototype.keys
1265
+ Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1266
+ // Set
1267
+ typeof Set === 'function' && isNative(Set) &&
1268
+ // Set.prototype.keys
1269
+ Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
1270
+
1271
+ var setItem;
1272
+ var getItem;
1273
+ var removeItem;
1274
+ var getItemIDs;
1275
+ var addRoot;
1276
+ var removeRoot;
1277
+ var getRootIDs;
1278
+
1279
+ if (canUseCollections) {
1280
+ var itemMap = new Map();
1281
+ var rootIDSet = new Set();
1282
+
1283
+ setItem = function (id, item) {
1284
+ itemMap.set(id, item);
1285
+ };
1286
+ getItem = function (id) {
1287
+ return itemMap.get(id);
1288
+ };
1289
+ removeItem = function (id) {
1290
+ itemMap['delete'](id);
1291
+ };
1292
+ getItemIDs = function () {
1293
+ return Array.from(itemMap.keys());
1294
+ };
1295
+
1296
+ addRoot = function (id) {
1297
+ rootIDSet.add(id);
1298
+ };
1299
+ removeRoot = function (id) {
1300
+ rootIDSet['delete'](id);
1301
+ };
1302
+ getRootIDs = function () {
1303
+ return Array.from(rootIDSet.keys());
1304
+ };
1305
+ } else {
1306
+ var itemByKey = {};
1307
+ var rootByKey = {};
1308
+
1309
+ // Use non-numeric keys to prevent V8 performance issues:
1310
+ // https://github.com/facebook/react/pull/7232
1311
+ var getKeyFromID = function (id) {
1312
+ return '.' + id;
1313
+ };
1314
+ var getIDFromKey = function (key) {
1315
+ return parseInt(key.substr(1), 10);
1316
+ };
1317
+
1318
+ setItem = function (id, item) {
1319
+ var key = getKeyFromID(id);
1320
+ itemByKey[key] = item;
1321
+ };
1322
+ getItem = function (id) {
1323
+ var key = getKeyFromID(id);
1324
+ return itemByKey[key];
1325
+ };
1326
+ removeItem = function (id) {
1327
+ var key = getKeyFromID(id);
1328
+ delete itemByKey[key];
1329
+ };
1330
+ getItemIDs = function () {
1331
+ return Object.keys(itemByKey).map(getIDFromKey);
1332
+ };
1333
+
1334
+ addRoot = function (id) {
1335
+ var key = getKeyFromID(id);
1336
+ rootByKey[key] = true;
1337
+ };
1338
+ removeRoot = function (id) {
1339
+ var key = getKeyFromID(id);
1340
+ delete rootByKey[key];
1341
+ };
1342
+ getRootIDs = function () {
1343
+ return Object.keys(rootByKey).map(getIDFromKey);
1344
+ };
1345
+ }
1346
+
1347
+ var unmountedIDs = [];
1348
+
1349
+ function purgeDeep(id) {
1350
+ var item = getItem(id);
1351
+ if (item) {
1352
+ var childIDs = item.childIDs;
1353
+
1354
+ removeItem(id);
1355
+ childIDs.forEach(purgeDeep);
1356
+ }
1357
+ }
1358
+
1359
+ function getDisplayName(element) {
1360
+ if (element == null) {
1361
+ return '#empty';
1362
+ } else if (typeof element === 'string' || typeof element === 'number') {
1363
+ return '#text';
1364
+ } else if (typeof element.type === 'string') {
1365
+ return element.type;
1366
+ } else {
1367
+ return element.type.displayName || element.type.name || 'Unknown';
1368
+ }
1369
+ }
1370
+
1371
+ function describeID(id) {
1372
+ var name = ReactComponentTreeHook.getDisplayName(id);
1373
+ var element = ReactComponentTreeHook.getElement(id);
1374
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
1375
+ var ownerName = void 0;
1376
+
1377
+ if (ownerID) {
1378
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
1379
+ }
1380
+ warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
1381
+ return describeComponentFrame(name || '', element && element._source, ownerName || '');
1382
+ }
1383
+
1384
+ var ReactComponentTreeHook = {
1385
+ onSetChildren: function (id, nextChildIDs) {
1386
+ var item = getItem(id);
1387
+ invariant(item, 'Item must have been set');
1388
+ item.childIDs = nextChildIDs;
1389
+
1390
+ for (var i = 0; i < nextChildIDs.length; i++) {
1391
+ var nextChildID = nextChildIDs[i];
1392
+ var nextChild = getItem(nextChildID);
1393
+ !nextChild ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
1394
+ !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : void 0;
1395
+ !nextChild.isMounted ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
1396
+ if (nextChild.parentID == null) {
1397
+ nextChild.parentID = id;
1398
+ // TODO: This shouldn't be necessary but mounting a new root during in
1399
+ // componentWillMount currently causes not-yet-mounted components to
1400
+ // be purged from our tree data so their parent id is missing.
1401
+ }
1402
+ !(nextChild.parentID === id) ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : void 0;
1403
+ }
1404
+ },
1405
+ onBeforeMountComponent: function (id, element, parentID) {
1406
+ var item = {
1407
+ element: element,
1408
+ parentID: parentID,
1409
+ text: null,
1410
+ childIDs: [],
1411
+ isMounted: false,
1412
+ updateCount: 0
1413
+ };
1414
+ setItem(id, item);
1415
+ },
1416
+ onBeforeUpdateComponent: function (id, element) {
1417
+ var item = getItem(id);
1418
+ if (!item || !item.isMounted) {
1419
+ // We may end up here as a result of setState() in componentWillUnmount().
1420
+ // In this case, ignore the element.
1421
+ return;
1422
+ }
1423
+ item.element = element;
1424
+ },
1425
+ onMountComponent: function (id) {
1426
+ var item = getItem(id);
1427
+ invariant(item, 'Item must have been set');
1428
+ item.isMounted = true;
1429
+ var isRoot = item.parentID === 0;
1430
+ if (isRoot) {
1431
+ addRoot(id);
1432
+ }
1433
+ },
1434
+ onUpdateComponent: function (id) {
1435
+ var item = getItem(id);
1436
+ if (!item || !item.isMounted) {
1437
+ // We may end up here as a result of setState() in componentWillUnmount().
1438
+ // In this case, ignore the element.
1439
+ return;
1440
+ }
1441
+ item.updateCount++;
1442
+ },
1443
+ onUnmountComponent: function (id) {
1444
+ var item = getItem(id);
1445
+ if (item) {
1446
+ // We need to check if it exists.
1447
+ // `item` might not exist if it is inside an error boundary, and a sibling
1448
+ // error boundary child threw while mounting. Then this instance never
1449
+ // got a chance to mount, but it still gets an unmounting event during
1450
+ // the error boundary cleanup.
1451
+ item.isMounted = false;
1452
+ var isRoot = item.parentID === 0;
1453
+ if (isRoot) {
1454
+ removeRoot(id);
1455
+ }
1456
+ }
1457
+ unmountedIDs.push(id);
1458
+ },
1459
+ purgeUnmountedComponents: function () {
1460
+ if (ReactComponentTreeHook._preventPurging) {
1461
+ // Should only be used for testing.
1462
+ return;
1463
+ }
1464
+
1465
+ for (var i = 0; i < unmountedIDs.length; i++) {
1466
+ var id = unmountedIDs[i];
1467
+ purgeDeep(id);
1468
+ }
1469
+ unmountedIDs.length = 0;
1470
+ },
1471
+ isMounted: function (id) {
1472
+ var item = getItem(id);
1473
+ return item ? item.isMounted : false;
1474
+ },
1475
+ getCurrentStackAddendum: function (topElement) {
1476
+ var info = '';
1477
+ if (topElement) {
1478
+ var name = getDisplayName(topElement);
1479
+ var owner = topElement._owner;
1480
+ info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
1481
+ }
1482
+
1483
+ var currentOwner = ReactCurrentOwner_1.current;
1484
+ if (currentOwner) {
1485
+ if (typeof currentOwner.tag === 'number') {
1486
+ var workInProgress = currentOwner;
1487
+ // Safe because if current owner exists, we are reconciling,
1488
+ // and it is guaranteed to be the work-in-progress version.
1489
+ info += getStackAddendumByWorkInProgressFiber$1(workInProgress);
1490
+ } else if (typeof currentOwner._debugID === 'number') {
1491
+ info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
1492
+ }
1493
+ }
1494
+ return info;
1495
+ },
1496
+ getStackAddendumByID: function (id) {
1497
+ var info = '';
1498
+ while (id) {
1499
+ info += describeID(id);
1500
+ id = ReactComponentTreeHook.getParentID(id);
1501
+ }
1502
+ return info;
1503
+ },
1504
+ getChildIDs: function (id) {
1505
+ var item = getItem(id);
1506
+ return item ? item.childIDs : [];
1507
+ },
1508
+ getDisplayName: function (id) {
1509
+ var element = ReactComponentTreeHook.getElement(id);
1510
+ if (!element) {
1511
+ return null;
1512
+ }
1513
+ return getDisplayName(element);
1514
+ },
1515
+ getElement: function (id) {
1516
+ var item = getItem(id);
1517
+ return item ? item.element : null;
1518
+ },
1519
+ getOwnerID: function (id) {
1520
+ var element = ReactComponentTreeHook.getElement(id);
1521
+ if (!element || !element._owner) {
1522
+ return null;
1523
+ }
1524
+ return element._owner._debugID;
1525
+ },
1526
+ getParentID: function (id) {
1527
+ var item = getItem(id);
1528
+ return item ? item.parentID : null;
1529
+ },
1530
+ getSource: function (id) {
1531
+ var item = getItem(id);
1532
+ var element = item ? item.element : null;
1533
+ var source = element != null ? element._source : null;
1534
+ return source;
1535
+ },
1536
+ getText: function (id) {
1537
+ var element = ReactComponentTreeHook.getElement(id);
1538
+ if (typeof element === 'string') {
1539
+ return element;
1540
+ } else if (typeof element === 'number') {
1541
+ return '' + element;
1542
+ } else {
1543
+ return null;
1544
+ }
1545
+ },
1546
+ getUpdateCount: function (id) {
1547
+ var item = getItem(id);
1548
+ return item ? item.updateCount : 0;
1549
+ },
1550
+
1551
+
1552
+ getRootIDs: getRootIDs,
1553
+ getRegisteredIDs: getItemIDs
1554
+ };
1555
+
1556
+ var ReactComponentTreeHook_1 = ReactComponentTreeHook;
1557
+
1558
+ var ReactDebugCurrentFrame$1 = {};
1559
+
1560
+ {
1561
+ var _require$1 = ReactComponentTreeHook_1,
1562
+ getStackAddendumByID = _require$1.getStackAddendumByID,
1563
+ getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
1564
+
1565
+ var _require2$1 = ReactFiberComponentTreeHook,
1566
+ getStackAddendumByWorkInProgressFiber = _require2$1.getStackAddendumByWorkInProgressFiber;
1567
+
1568
+ // Component that is being worked on
1569
+
1570
+
1571
+ ReactDebugCurrentFrame$1.current = null;
1572
+
1573
+ // Element that is being cloned or created
1574
+ ReactDebugCurrentFrame$1.element = null;
1575
+
1576
+ ReactDebugCurrentFrame$1.getStackAddendum = function () {
1577
+ var stack = null;
1578
+ var current = ReactDebugCurrentFrame$1.current;
1579
+ var element = ReactDebugCurrentFrame$1.element;
1580
+ if (current !== null) {
1581
+ if (typeof current === 'number') {
1582
+ // DebugID from Stack.
1583
+ var debugID = current;
1584
+ stack = getStackAddendumByID(debugID);
1585
+ } else if (typeof current.tag === 'number') {
1586
+ // This is a Fiber.
1587
+ // The stack will only be correct if this is a work in progress
1588
+ // version and we're calling it during reconciliation.
1589
+ var workInProgress = current;
1590
+ stack = getStackAddendumByWorkInProgressFiber(workInProgress);
1591
+ }
1592
+ } else if (element !== null) {
1593
+ stack = getCurrentStackAddendum$1(element);
1594
+ }
1595
+ return stack;
1596
+ };
1597
+ }
1598
+
1599
+ var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame$1;
1600
+
1601
+ {
1602
+ var checkPropTypes$1 = checkPropTypes$2;
1603
+ var warning$3 = warning;
1604
+ var ReactDebugCurrentFrame = ReactDebugCurrentFrame_1;
1605
+
1606
+ var _require = ReactComponentTreeHook_1,
1607
+ getCurrentStackAddendum = _require.getCurrentStackAddendum;
1608
+ }
1609
+
1610
+ function getDeclarationErrorAddendum() {
1611
+ if (ReactCurrentOwner_1.current) {
1612
+ var name = getComponentName_1(ReactCurrentOwner_1.current);
1613
+ if (name) {
1614
+ return '\n\nCheck the render method of `' + name + '`.';
1615
+ }
1616
+ }
1617
+ return '';
1618
+ }
1619
+
1620
+ function getSourceInfoErrorAddendum(elementProps) {
1621
+ if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
1622
+ var source = elementProps.__source;
1623
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
1624
+ var lineNumber = source.lineNumber;
1625
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
1626
+ }
1627
+ return '';
1628
+ }
1629
+
1630
+ /**
1631
+ * Warn if there's no key explicitly set on dynamic arrays of children or
1632
+ * object keys are not valid. This allows us to keep track of children between
1633
+ * updates.
1634
+ */
1635
+ var ownerHasKeyUseWarning = {};
1636
+
1637
+ function getCurrentComponentErrorInfo(parentType) {
1638
+ var info = getDeclarationErrorAddendum();
1639
+
1640
+ if (!info) {
1641
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1642
+ if (parentName) {
1643
+ info = '\n\nCheck the top-level render call using <' + parentName + '>.';
1644
+ }
1645
+ }
1646
+ return info;
1647
+ }
1648
+
1649
+ /**
1650
+ * Warn if the element doesn't have an explicit key assigned to it.
1651
+ * This element is in an array. The array could grow and shrink or be
1652
+ * reordered. All children that haven't already been validated are required to
1653
+ * have a "key" property assigned to it. Error statuses are cached so a warning
1654
+ * will only be shown once.
1655
+ *
1656
+ * @internal
1657
+ * @param {ReactElement} element Element that requires a key.
1658
+ * @param {*} parentType element's parent's type.
1659
+ */
1660
+ function validateExplicitKey(element, parentType) {
1661
+ if (!element._store || element._store.validated || element.key != null) {
1662
+ return;
1663
+ }
1664
+ element._store.validated = true;
1665
+
1666
+ var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
1667
+
1668
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1669
+ if (memoizer[currentComponentErrorInfo]) {
1670
+ return;
1671
+ }
1672
+ memoizer[currentComponentErrorInfo] = true;
1673
+
1674
+ // Usually the current owner is the offender, but if it accepts children as a
1675
+ // property, it may be the creator of the child that's responsible for
1676
+ // assigning it a key.
1677
+ var childOwner = '';
1678
+ if (element && element._owner && element._owner !== ReactCurrentOwner_1.current) {
1679
+ // Give the component that originally created this child.
1680
+ childOwner = ' It was passed a child from ' + getComponentName_1(element._owner) + '.';
1681
+ }
1682
+
1683
+ warning$3(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getCurrentStackAddendum(element));
1684
+ }
1685
+
1686
+ /**
1687
+ * Ensure that every element either is passed in a static location, in an
1688
+ * array with an explicit keys property defined, or in an object literal
1689
+ * with valid key property.
1690
+ *
1691
+ * @internal
1692
+ * @param {ReactNode} node Statically passed child of any type.
1693
+ * @param {*} parentType node's parent's type.
1694
+ */
1695
+ function validateChildKeys(node, parentType) {
1696
+ if (typeof node !== 'object') {
1697
+ return;
1698
+ }
1699
+ if (Array.isArray(node)) {
1700
+ for (var i = 0; i < node.length; i++) {
1701
+ var child = node[i];
1702
+ if (ReactElement_1.isValidElement(child)) {
1703
+ validateExplicitKey(child, parentType);
1704
+ }
1705
+ }
1706
+ } else if (ReactElement_1.isValidElement(node)) {
1707
+ // This element was passed in a valid location.
1708
+ if (node._store) {
1709
+ node._store.validated = true;
1710
+ }
1711
+ } else if (node) {
1712
+ var iteratorFn = getIteratorFn_1(node);
1713
+ // Entry iterators provide implicit keys.
1714
+ if (iteratorFn) {
1715
+ if (iteratorFn !== node.entries) {
1716
+ var iterator = iteratorFn.call(node);
1717
+ var step;
1718
+ while (!(step = iterator.next()).done) {
1719
+ if (ReactElement_1.isValidElement(step.value)) {
1720
+ validateExplicitKey(step.value, parentType);
1721
+ }
1722
+ }
1723
+ }
1724
+ }
1725
+ }
1726
+ }
1727
+
1728
+ /**
1729
+ * Given an element, validate that its props follow the propTypes definition,
1730
+ * provided by the type.
1731
+ *
1732
+ * @param {ReactElement} element
1733
+ */
1734
+ function validatePropTypes(element) {
1735
+ var componentClass = element.type;
1736
+ if (typeof componentClass !== 'function') {
1737
+ return;
1738
+ }
1739
+ var name = componentClass.displayName || componentClass.name;
1740
+
1741
+ // ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
1742
+ // In their place a temporary getter has been added with a deprecated warning message.
1743
+ // Avoid triggering that warning during validation using the temporary workaround,
1744
+ // __propTypesSecretDontUseThesePlease.
1745
+ // TODO (bvaughn) Revert this particular change any time after April 1 ReactNative tag.
1746
+ var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
1747
+
1748
+ if (propTypes) {
1749
+ checkPropTypes$1(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
1750
+ }
1751
+ if (typeof componentClass.getDefaultProps === 'function') {
1752
+ warning$3(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1753
+ }
1754
+ }
1755
+
1756
+ var ReactElementValidator$2 = {
1757
+ createElement: function (type, props, children) {
1758
+ var validType = typeof type === 'string' || typeof type === 'function';
1759
+ // We warn in this case but don't throw. We expect the element creation to
1760
+ // succeed and there will likely be errors in render.
1761
+ if (!validType) {
1762
+ var info = '';
1763
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1764
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
1765
+ }
1766
+
1767
+ var sourceInfo = getSourceInfoErrorAddendum(props);
1768
+ if (sourceInfo) {
1769
+ info += sourceInfo;
1770
+ } else {
1771
+ info += getDeclarationErrorAddendum();
1772
+ }
1773
+
1774
+ info += getCurrentStackAddendum();
1775
+
1776
+ warning$3(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
1777
+ }
1778
+
1779
+ var element = ReactElement_1.createElement.apply(this, arguments);
1780
+
1781
+ // The result can be nullish if a mock or a custom function is used.
1782
+ // TODO: Drop this when these are no longer allowed as the type argument.
1783
+ if (element == null) {
1784
+ return element;
1785
+ }
1786
+
1787
+ {
1788
+ ReactDebugCurrentFrame.element = element;
1789
+ }
1790
+
1791
+ // Skip key warning if the type isn't valid since our key validation logic
1792
+ // doesn't expect a non-string/function type and can throw confusing errors.
1793
+ // We don't want exception behavior to differ between dev and prod.
1794
+ // (Rendering will throw with a helpful message and as soon as the type is
1795
+ // fixed, the key warnings will appear.)
1796
+ if (validType) {
1797
+ for (var i = 2; i < arguments.length; i++) {
1798
+ validateChildKeys(arguments[i], type);
1799
+ }
1800
+ }
1801
+
1802
+ validatePropTypes(element);
1803
+
1804
+ {
1805
+ ReactDebugCurrentFrame.element = null;
1806
+ }
1807
+
1808
+ return element;
1809
+ },
1810
+
1811
+ createFactory: function (type) {
1812
+ var validatedFactory = ReactElementValidator$2.createElement.bind(null, type);
1813
+ // Legacy hook TODO: Warn if this is accessed
1814
+ validatedFactory.type = type;
1815
+
1816
+ {
1817
+ if (canDefineProperty_1) {
1818
+ Object.defineProperty(validatedFactory, 'type', {
1819
+ enumerable: false,
1820
+ get: function () {
1821
+ warning$3(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
1822
+ Object.defineProperty(this, 'type', {
1823
+ value: type
1824
+ });
1825
+ return type;
1826
+ }
1827
+ });
1828
+ }
1829
+ }
1830
+
1831
+ return validatedFactory;
1832
+ },
1833
+
1834
+ cloneElement: function (element, props, children) {
1835
+ var newElement = ReactElement_1.cloneElement.apply(this, arguments);
1836
+ {
1837
+ ReactDebugCurrentFrame.element = newElement;
1838
+ }
1839
+ for (var i = 2; i < arguments.length; i++) {
1840
+ validateChildKeys(arguments[i], newElement.type);
1841
+ }
1842
+ validatePropTypes(newElement);
1843
+ {
1844
+ ReactDebugCurrentFrame.element = null;
1845
+ }
1846
+ return newElement;
1847
+ }
1848
+ };
1849
+
1850
+ var ReactElementValidator_1 = ReactElementValidator$2;
1851
+
1852
+ /**
1853
+ * Create a factory that creates HTML tag elements.
1854
+ *
1855
+ * @private
1856
+ */
1857
+ var createDOMFactory = ReactElement_1.createFactory;
1858
+ {
1859
+ var ReactElementValidator$1 = ReactElementValidator_1;
1860
+ createDOMFactory = ReactElementValidator$1.createFactory;
1861
+ }
1862
+
1863
+ /**
1864
+ * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
1865
+ * This is also accessible via `React.DOM`.
1866
+ *
1867
+ * @public
1868
+ */
1869
+ var ReactDOMFactories = {
1870
+ a: createDOMFactory('a'),
1871
+ abbr: createDOMFactory('abbr'),
1872
+ address: createDOMFactory('address'),
1873
+ area: createDOMFactory('area'),
1874
+ article: createDOMFactory('article'),
1875
+ aside: createDOMFactory('aside'),
1876
+ audio: createDOMFactory('audio'),
1877
+ b: createDOMFactory('b'),
1878
+ base: createDOMFactory('base'),
1879
+ bdi: createDOMFactory('bdi'),
1880
+ bdo: createDOMFactory('bdo'),
1881
+ big: createDOMFactory('big'),
1882
+ blockquote: createDOMFactory('blockquote'),
1883
+ body: createDOMFactory('body'),
1884
+ br: createDOMFactory('br'),
1885
+ button: createDOMFactory('button'),
1886
+ canvas: createDOMFactory('canvas'),
1887
+ caption: createDOMFactory('caption'),
1888
+ cite: createDOMFactory('cite'),
1889
+ code: createDOMFactory('code'),
1890
+ col: createDOMFactory('col'),
1891
+ colgroup: createDOMFactory('colgroup'),
1892
+ data: createDOMFactory('data'),
1893
+ datalist: createDOMFactory('datalist'),
1894
+ dd: createDOMFactory('dd'),
1895
+ del: createDOMFactory('del'),
1896
+ details: createDOMFactory('details'),
1897
+ dfn: createDOMFactory('dfn'),
1898
+ dialog: createDOMFactory('dialog'),
1899
+ div: createDOMFactory('div'),
1900
+ dl: createDOMFactory('dl'),
1901
+ dt: createDOMFactory('dt'),
1902
+ em: createDOMFactory('em'),
1903
+ embed: createDOMFactory('embed'),
1904
+ fieldset: createDOMFactory('fieldset'),
1905
+ figcaption: createDOMFactory('figcaption'),
1906
+ figure: createDOMFactory('figure'),
1907
+ footer: createDOMFactory('footer'),
1908
+ form: createDOMFactory('form'),
1909
+ h1: createDOMFactory('h1'),
1910
+ h2: createDOMFactory('h2'),
1911
+ h3: createDOMFactory('h3'),
1912
+ h4: createDOMFactory('h4'),
1913
+ h5: createDOMFactory('h5'),
1914
+ h6: createDOMFactory('h6'),
1915
+ head: createDOMFactory('head'),
1916
+ header: createDOMFactory('header'),
1917
+ hgroup: createDOMFactory('hgroup'),
1918
+ hr: createDOMFactory('hr'),
1919
+ html: createDOMFactory('html'),
1920
+ i: createDOMFactory('i'),
1921
+ iframe: createDOMFactory('iframe'),
1922
+ img: createDOMFactory('img'),
1923
+ input: createDOMFactory('input'),
1924
+ ins: createDOMFactory('ins'),
1925
+ kbd: createDOMFactory('kbd'),
1926
+ keygen: createDOMFactory('keygen'),
1927
+ label: createDOMFactory('label'),
1928
+ legend: createDOMFactory('legend'),
1929
+ li: createDOMFactory('li'),
1930
+ link: createDOMFactory('link'),
1931
+ main: createDOMFactory('main'),
1932
+ map: createDOMFactory('map'),
1933
+ mark: createDOMFactory('mark'),
1934
+ menu: createDOMFactory('menu'),
1935
+ menuitem: createDOMFactory('menuitem'),
1936
+ meta: createDOMFactory('meta'),
1937
+ meter: createDOMFactory('meter'),
1938
+ nav: createDOMFactory('nav'),
1939
+ noscript: createDOMFactory('noscript'),
1940
+ object: createDOMFactory('object'),
1941
+ ol: createDOMFactory('ol'),
1942
+ optgroup: createDOMFactory('optgroup'),
1943
+ option: createDOMFactory('option'),
1944
+ output: createDOMFactory('output'),
1945
+ p: createDOMFactory('p'),
1946
+ param: createDOMFactory('param'),
1947
+ picture: createDOMFactory('picture'),
1948
+ pre: createDOMFactory('pre'),
1949
+ progress: createDOMFactory('progress'),
1950
+ q: createDOMFactory('q'),
1951
+ rp: createDOMFactory('rp'),
1952
+ rt: createDOMFactory('rt'),
1953
+ ruby: createDOMFactory('ruby'),
1954
+ s: createDOMFactory('s'),
1955
+ samp: createDOMFactory('samp'),
1956
+ script: createDOMFactory('script'),
1957
+ section: createDOMFactory('section'),
1958
+ select: createDOMFactory('select'),
1959
+ small: createDOMFactory('small'),
1960
+ source: createDOMFactory('source'),
1961
+ span: createDOMFactory('span'),
1962
+ strong: createDOMFactory('strong'),
1963
+ style: createDOMFactory('style'),
1964
+ sub: createDOMFactory('sub'),
1965
+ summary: createDOMFactory('summary'),
1966
+ sup: createDOMFactory('sup'),
1967
+ table: createDOMFactory('table'),
1968
+ tbody: createDOMFactory('tbody'),
1969
+ td: createDOMFactory('td'),
1970
+ textarea: createDOMFactory('textarea'),
1971
+ tfoot: createDOMFactory('tfoot'),
1972
+ th: createDOMFactory('th'),
1973
+ thead: createDOMFactory('thead'),
1974
+ time: createDOMFactory('time'),
1975
+ title: createDOMFactory('title'),
1976
+ tr: createDOMFactory('tr'),
1977
+ track: createDOMFactory('track'),
1978
+ u: createDOMFactory('u'),
1979
+ ul: createDOMFactory('ul'),
1980
+ 'var': createDOMFactory('var'),
1981
+ video: createDOMFactory('video'),
1982
+ wbr: createDOMFactory('wbr'),
1983
+
1984
+ // SVG
1985
+ circle: createDOMFactory('circle'),
1986
+ clipPath: createDOMFactory('clipPath'),
1987
+ defs: createDOMFactory('defs'),
1988
+ ellipse: createDOMFactory('ellipse'),
1989
+ g: createDOMFactory('g'),
1990
+ image: createDOMFactory('image'),
1991
+ line: createDOMFactory('line'),
1992
+ linearGradient: createDOMFactory('linearGradient'),
1993
+ mask: createDOMFactory('mask'),
1994
+ path: createDOMFactory('path'),
1995
+ pattern: createDOMFactory('pattern'),
1996
+ polygon: createDOMFactory('polygon'),
1997
+ polyline: createDOMFactory('polyline'),
1998
+ radialGradient: createDOMFactory('radialGradient'),
1999
+ rect: createDOMFactory('rect'),
2000
+ stop: createDOMFactory('stop'),
2001
+ svg: createDOMFactory('svg'),
2002
+ text: createDOMFactory('text'),
2003
+ tspan: createDOMFactory('tspan')
2004
+ };
2005
+
2006
+ var ReactDOMFactories_1 = ReactDOMFactories;
2007
+
2008
+ var isValidElement = ReactElement_1.isValidElement;
2009
+
2010
+
2011
+
2012
+ var ReactPropTypes = factory(isValidElement);
2013
+
2014
+ /**
2015
+ * Copyright 2013-present, Facebook, Inc.
2016
+ * All rights reserved.
2017
+ *
2018
+ * This source code is licensed under the BSD-style license found in the
2019
+ * LICENSE file in the root directory of this source tree. An additional grant
2020
+ * of patent rights can be found in the PATENTS file in the same directory.
2021
+ *
2022
+ * @providesModule ReactVersion
2023
+ */
2024
+
2025
+ var ReactVersion = '16.0.0-alpha.9';
2026
+
2027
+ /**
2028
+ * Returns the first child in a collection of children and verifies that there
2029
+ * is only one child in the collection.
2030
+ *
2031
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.only
2032
+ *
2033
+ * The current implementation of this function assumes that a single child gets
2034
+ * passed without a wrapper, but the purpose of this helper function is to
2035
+ * abstract away the particular structure of children.
2036
+ *
2037
+ * @param {?object} children Child collection structure.
2038
+ * @return {ReactElement} The first and only `ReactElement` contained in the
2039
+ * structure.
2040
+ */
2041
+ function onlyChild(children) {
2042
+ !ReactElement_1.isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
2043
+ return children;
2044
+ }
2045
+
2046
+ var onlyChild_1 = onlyChild;
2047
+
2048
+ var Component = ReactBaseClasses.Component;
2049
+
2050
+ var isValidElement$1 = ReactElement_1.isValidElement;
2051
+
2052
+
2053
+
2054
+
2055
+ var createClass = factory$1(Component, isValidElement$1, ReactNoopUpdateQueue_1);
2056
+
2057
+ var createElement = ReactElement_1.createElement;
2058
+ var createFactory = ReactElement_1.createFactory;
2059
+ var cloneElement = ReactElement_1.cloneElement;
2060
+
2061
+ {
2062
+ var warning$1 = warning;
2063
+ var canDefineProperty = canDefineProperty_1;
2064
+ var ReactElementValidator = ReactElementValidator_1;
2065
+ createElement = ReactElementValidator.createElement;
2066
+ createFactory = ReactElementValidator.createFactory;
2067
+ cloneElement = ReactElementValidator.cloneElement;
2068
+ }
2069
+
2070
+ var createMixin = function (mixin) {
2071
+ return mixin;
2072
+ };
2073
+
2074
+ var React = {
2075
+ // Modern
2076
+
2077
+ Children: {
2078
+ map: ReactChildren_1.map,
2079
+ forEach: ReactChildren_1.forEach,
2080
+ count: ReactChildren_1.count,
2081
+ toArray: ReactChildren_1.toArray,
2082
+ only: onlyChild_1
2083
+ },
2084
+
2085
+ Component: ReactBaseClasses.Component,
2086
+ PureComponent: ReactBaseClasses.PureComponent,
2087
+
2088
+ createElement: createElement,
2089
+ cloneElement: cloneElement,
2090
+ isValidElement: ReactElement_1.isValidElement,
2091
+
2092
+ // TODO (bvaughn) Remove these getters in 16.0.0-alpha.10
2093
+ PropTypes: ReactPropTypes,
2094
+ checkPropTypes: checkPropTypes$2,
2095
+ createClass: createClass,
2096
+
2097
+ // Classic
2098
+
2099
+ createFactory: createFactory,
2100
+ createMixin: createMixin,
2101
+
2102
+ // This looks DOM specific but these are actually isomorphic helpers
2103
+ // since they are just generating DOM strings.
2104
+ DOM: ReactDOMFactories_1,
2105
+
2106
+ version: ReactVersion,
2107
+
2108
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
2109
+ ReactCurrentOwner: ReactCurrentOwner_1
2110
+ }
2111
+ };
2112
+
2113
+ {
2114
+ objectAssign$1(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
2115
+ // These should not be included in production.
2116
+ ReactComponentTreeHook: ReactComponentTreeHook_1,
2117
+ ReactDebugCurrentFrame: ReactDebugCurrentFrame_1
2118
+ });
2119
+
2120
+ var warnedForCheckPropTypes = false;
2121
+ var warnedForCreateMixin = false;
2122
+ var warnedForCreateClass = false;
2123
+ var warnedForPropTypes = false;
2124
+
2125
+ React.createMixin = function (mixin) {
2126
+ warning$1(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.');
2127
+ warnedForCreateMixin = true;
2128
+ return mixin;
2129
+ };
2130
+
2131
+ // TODO (bvaughn) Remove both of these deprecation warnings in 16.0.0-alpha.10
2132
+ if (canDefineProperty) {
2133
+ Object.defineProperty(React, 'checkPropTypes', {
2134
+ get: function () {
2135
+ warning$1(warnedForCheckPropTypes, 'checkPropTypes has been moved to a separate package. ' + 'Accessing React.checkPropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
2136
+ warnedForCheckPropTypes = true;
2137
+ return ReactPropTypes;
2138
+ }
2139
+ });
2140
+
2141
+ Object.defineProperty(React, 'createClass', {
2142
+ get: function () {
2143
+ warning$1(warnedForCreateClass, 'React.createClass is no longer supported. Use a plain JavaScript ' + "class instead. If you're not yet ready to migrate, " + 'create-react-class is available on npm as a drop-in replacement. ' + '(https://fb.me/migrating-from-react-create-class)');
2144
+ warnedForCreateClass = true;
2145
+ return createClass;
2146
+ }
2147
+ });
2148
+
2149
+ Object.defineProperty(React, 'PropTypes', {
2150
+ get: function () {
2151
+ warning$1(warnedForPropTypes, 'PropTypes has been moved to a separate package. ' + 'Accessing React.PropTypes is no longer supported ' + 'and will be removed completely in React 16. ' + 'Use the prop-types package on npm instead. ' + '(https://fb.me/migrating-from-react-proptypes)');
2152
+ warnedForPropTypes = true;
2153
+ return ReactPropTypes;
2154
+ }
2155
+ });
2156
+ }
2157
+ }
2158
+
2159
+ var React_1 = React;
2160
+
2161
+ module.exports = React_1;