react 16.0.0-alpha.6 → 16.0.0-alpha.7

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 (43) hide show
  1. package/cjs/react.development.js +3268 -0
  2. package/cjs/react.production.min.js +1 -0
  3. package/index.js +7 -0
  4. package/package.json +7 -8
  5. package/{dist/react.js → umd/react.development.js} +2806 -3216
  6. package/umd/react.production.min.js +4 -0
  7. package/dist/react.min.js +0 -17
  8. package/lib/KeyEscapeUtils.js +0 -58
  9. package/lib/PooledClass.js +0 -111
  10. package/lib/React.js +0 -84
  11. package/lib/ReactBaseClasses.js +0 -136
  12. package/lib/ReactChildren.js +0 -190
  13. package/lib/ReactClass.js +0 -698
  14. package/lib/ReactComponentTreeHook.js +0 -342
  15. package/lib/ReactComponentTreeHookUMDShim.js +0 -17
  16. package/lib/ReactCurrentOwner.js +0 -28
  17. package/lib/ReactCurrentOwnerUMDShim.js +0 -17
  18. package/lib/ReactDOMFactories.js +0 -169
  19. package/lib/ReactDebugCurrentFrame.js +0 -55
  20. package/lib/ReactElement.js +0 -340
  21. package/lib/ReactElementSymbol.js +0 -19
  22. package/lib/ReactElementType.js +0 -12
  23. package/lib/ReactElementValidator.js +0 -276
  24. package/lib/ReactFiberComponentTreeHook.js +0 -62
  25. package/lib/ReactNoopUpdateQueue.js +0 -90
  26. package/lib/ReactPropTypes.js +0 -458
  27. package/lib/ReactPropTypesSecret.js +0 -16
  28. package/lib/ReactTypeOfWork.js +0 -26
  29. package/lib/ReactUMDEntry.js +0 -31
  30. package/lib/ReactUMDShim.js +0 -15
  31. package/lib/ReactVersion.js +0 -13
  32. package/lib/canDefineProperty.js +0 -25
  33. package/lib/checkPropTypes.js +0 -64
  34. package/lib/checkReactTypeSpec.js +0 -22
  35. package/lib/deprecated.js +0 -56
  36. package/lib/flattenChildren.js +0 -75
  37. package/lib/getComponentName.js +0 -35
  38. package/lib/getIteratorFn.js +0 -40
  39. package/lib/getNextDebugID.js +0 -20
  40. package/lib/onlyChild.js +0 -37
  41. package/lib/reactProdInvariant.js +0 -38
  42. package/lib/traverseAllChildren.js +0 -164
  43. package/react.js +0 -3
@@ -0,0 +1,3268 @@
1
+ 'use strict';
2
+
3
+ var _assign = 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
+
9
+ /**
10
+ * Copyright (c) 2013-present, Facebook, Inc.
11
+ * All rights reserved.
12
+ *
13
+ * This source code is licensed under the BSD-style license found in the
14
+ * LICENSE file in the root directory of this source tree. An additional grant
15
+ * of patent rights can be found in the PATENTS file in the same directory.
16
+ *
17
+ * @providesModule reactProdInvariant
18
+ *
19
+ */
20
+
21
+ function warnNoop(publicInstance, callerName) {
22
+ {
23
+ var constructor = publicInstance.constructor;
24
+ 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');
25
+ }
26
+ }
27
+
28
+ /**
29
+ * This is the abstract API for an update queue.
30
+ */
31
+ var ReactNoopUpdateQueue = {
32
+ /**
33
+ * Checks whether or not this composite component is mounted.
34
+ * @param {ReactClass} publicInstance The instance we want to test.
35
+ * @return {boolean} True if mounted, false otherwise.
36
+ * @protected
37
+ * @final
38
+ */
39
+ isMounted: function (publicInstance) {
40
+ return false;
41
+ },
42
+
43
+ /**
44
+ * Forces an update. This should only be invoked when it is known with
45
+ * certainty that we are **not** in a DOM transaction.
46
+ *
47
+ * You may want to call this when you know that some deeper aspect of the
48
+ * component's state has changed but `setState` was not called.
49
+ *
50
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
51
+ * `componentWillUpdate` and `componentDidUpdate`.
52
+ *
53
+ * @param {ReactClass} publicInstance The instance that should rerender.
54
+ * @param {?function} callback Called after component is updated.
55
+ * @param {?string} Name of the calling function in the public API.
56
+ * @internal
57
+ */
58
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
59
+ warnNoop(publicInstance, 'forceUpdate');
60
+ },
61
+
62
+ /**
63
+ * Replaces all of the state. Always use this or `setState` to mutate state.
64
+ * You should treat `this.state` as immutable.
65
+ *
66
+ * There is no guarantee that `this.state` will be immediately updated, so
67
+ * accessing `this.state` after calling this method may return the old value.
68
+ *
69
+ * @param {ReactClass} publicInstance The instance that should rerender.
70
+ * @param {object} completeState Next state.
71
+ * @param {?function} callback Called after component is updated.
72
+ * @param {?string} Name of the calling function in the public API.
73
+ * @internal
74
+ */
75
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
76
+ warnNoop(publicInstance, 'replaceState');
77
+ },
78
+
79
+ /**
80
+ * Sets a subset of the state. This only exists because _pendingState is
81
+ * internal. This provides a merging strategy that is not available to deep
82
+ * properties which is confusing. TODO: Expose pendingState or don't use it
83
+ * during the merge.
84
+ *
85
+ * @param {ReactClass} publicInstance The instance that should rerender.
86
+ * @param {object} partialState Next partial state to be merged with state.
87
+ * @param {?function} callback Called after component is updated.
88
+ * @param {?string} Name of the calling function in the public API.
89
+ * @internal
90
+ */
91
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
92
+ warnNoop(publicInstance, 'setState');
93
+ }
94
+ };
95
+
96
+ var ReactNoopUpdateQueue_1 = ReactNoopUpdateQueue;
97
+
98
+ /**
99
+ * Copyright 2013-present, Facebook, Inc.
100
+ * All rights reserved.
101
+ *
102
+ * This source code is licensed under the BSD-style license found in the
103
+ * LICENSE file in the root directory of this source tree. An additional grant
104
+ * of patent rights can be found in the PATENTS file in the same directory.
105
+ *
106
+ *
107
+ * @providesModule canDefineProperty
108
+ */
109
+
110
+ var canDefineProperty = false;
111
+ {
112
+ try {
113
+ // $FlowFixMe https://github.com/facebook/flow/issues/285
114
+ Object.defineProperty({}, 'x', { get: function () {} });
115
+ canDefineProperty = true;
116
+ } catch (x) {
117
+ // IE will fail on defineProperty
118
+ }
119
+ }
120
+
121
+ var canDefineProperty_1 = canDefineProperty;
122
+
123
+ /**
124
+ * Base class helpers for the updating state of a component.
125
+ */
126
+ function ReactComponent(props, context, updater) {
127
+ this.props = props;
128
+ this.context = context;
129
+ this.refs = emptyObject;
130
+ // We initialize the default updater but the real one gets injected by the
131
+ // renderer.
132
+ this.updater = updater || ReactNoopUpdateQueue_1;
133
+ }
134
+
135
+ ReactComponent.prototype.isReactComponent = {};
136
+
137
+ /**
138
+ * Sets a subset of the state. Always use this to mutate
139
+ * state. You should treat `this.state` as immutable.
140
+ *
141
+ * There is no guarantee that `this.state` will be immediately updated, so
142
+ * accessing `this.state` after calling this method may return the old value.
143
+ *
144
+ * There is no guarantee that calls to `setState` will run synchronously,
145
+ * as they may eventually be batched together. You can provide an optional
146
+ * callback that will be executed when the call to setState is actually
147
+ * completed.
148
+ *
149
+ * When a function is provided to setState, it will be called at some point in
150
+ * the future (not synchronously). It will be called with the up to date
151
+ * component arguments (state, props, context). These values can be different
152
+ * from this.* because your function may be called after receiveProps but before
153
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
154
+ * assigned to this.
155
+ *
156
+ * @param {object|function} partialState Next partial state or function to
157
+ * produce next partial state to be merged with current state.
158
+ * @param {?function} callback Called after state is updated.
159
+ * @final
160
+ * @protected
161
+ */
162
+ ReactComponent.prototype.setState = function (partialState, callback) {
163
+ !(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;
164
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
165
+ };
166
+
167
+ /**
168
+ * Forces an update. This should only be invoked when it is known with
169
+ * certainty that we are **not** in a DOM transaction.
170
+ *
171
+ * You may want to call this when you know that some deeper aspect of the
172
+ * component's state has changed but `setState` was not called.
173
+ *
174
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
175
+ * `componentWillUpdate` and `componentDidUpdate`.
176
+ *
177
+ * @param {?function} callback Called after update is complete.
178
+ * @final
179
+ * @protected
180
+ */
181
+ ReactComponent.prototype.forceUpdate = function (callback) {
182
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
183
+ };
184
+
185
+ /**
186
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
187
+ * we would like to deprecate them, we're not going to move them over to this
188
+ * modern base class. Instead, we define a getter that warns if it's accessed.
189
+ */
190
+ {
191
+ var deprecatedAPIs = {
192
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
193
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
194
+ };
195
+ var defineDeprecationWarning = function (methodName, info) {
196
+ if (canDefineProperty_1) {
197
+ Object.defineProperty(ReactComponent.prototype, methodName, {
198
+ get: function () {
199
+ warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
200
+ return undefined;
201
+ }
202
+ });
203
+ }
204
+ };
205
+ for (var fnName in deprecatedAPIs) {
206
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
207
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
208
+ }
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Base class helpers for the updating state of a component.
214
+ */
215
+ function ReactPureComponent(props, context, updater) {
216
+ // Duplicated from ReactComponent.
217
+ this.props = props;
218
+ this.context = context;
219
+ this.refs = emptyObject;
220
+ // We initialize the default updater but the real one gets injected by the
221
+ // renderer.
222
+ this.updater = updater || ReactNoopUpdateQueue_1;
223
+ }
224
+
225
+ function ComponentDummy() {}
226
+ ComponentDummy.prototype = ReactComponent.prototype;
227
+ ReactPureComponent.prototype = new ComponentDummy();
228
+ ReactPureComponent.prototype.constructor = ReactPureComponent;
229
+ // Avoid an extra prototype jump for these methods.
230
+ _assign(ReactPureComponent.prototype, ReactComponent.prototype);
231
+ ReactPureComponent.prototype.isPureReactComponent = true;
232
+
233
+ var ReactBaseClasses = {
234
+ Component: ReactComponent,
235
+ PureComponent: ReactPureComponent
236
+ };
237
+
238
+ /**
239
+ * Static poolers. Several custom versions for each potential number of
240
+ * arguments. A completely generic pooler is easy to implement, but would
241
+ * require accessing the `arguments` object. In each of these, `this` refers to
242
+ * the Class itself, not an instance. If any others are needed, simply add them
243
+ * here, or in their own files.
244
+ */
245
+ var oneArgumentPooler = function (copyFieldsFrom) {
246
+ var Klass = this;
247
+ if (Klass.instancePool.length) {
248
+ var instance = Klass.instancePool.pop();
249
+ Klass.call(instance, copyFieldsFrom);
250
+ return instance;
251
+ } else {
252
+ return new Klass(copyFieldsFrom);
253
+ }
254
+ };
255
+
256
+ var twoArgumentPooler$1 = function (a1, a2) {
257
+ var Klass = this;
258
+ if (Klass.instancePool.length) {
259
+ var instance = Klass.instancePool.pop();
260
+ Klass.call(instance, a1, a2);
261
+ return instance;
262
+ } else {
263
+ return new Klass(a1, a2);
264
+ }
265
+ };
266
+
267
+ var threeArgumentPooler = function (a1, a2, a3) {
268
+ var Klass = this;
269
+ if (Klass.instancePool.length) {
270
+ var instance = Klass.instancePool.pop();
271
+ Klass.call(instance, a1, a2, a3);
272
+ return instance;
273
+ } else {
274
+ return new Klass(a1, a2, a3);
275
+ }
276
+ };
277
+
278
+ var fourArgumentPooler$1 = function (a1, a2, a3, a4) {
279
+ var Klass = this;
280
+ if (Klass.instancePool.length) {
281
+ var instance = Klass.instancePool.pop();
282
+ Klass.call(instance, a1, a2, a3, a4);
283
+ return instance;
284
+ } else {
285
+ return new Klass(a1, a2, a3, a4);
286
+ }
287
+ };
288
+
289
+ var standardReleaser = function (instance) {
290
+ var Klass = this;
291
+ !(instance instanceof Klass) ? invariant(false, 'Trying to release an instance into a pool of a different type.') : void 0;
292
+ instance.destructor();
293
+ if (Klass.instancePool.length < Klass.poolSize) {
294
+ Klass.instancePool.push(instance);
295
+ }
296
+ };
297
+
298
+ var DEFAULT_POOL_SIZE = 10;
299
+ var DEFAULT_POOLER = oneArgumentPooler;
300
+
301
+ /**
302
+ * Augments `CopyConstructor` to be a poolable class, augmenting only the class
303
+ * itself (statically) not adding any prototypical fields. Any CopyConstructor
304
+ * you give this may have a `poolSize` property, and will look for a
305
+ * prototypical `destructor` on instances.
306
+ *
307
+ * @param {Function} CopyConstructor Constructor that can be used to reset.
308
+ * @param {Function} pooler Customizable pooler.
309
+ */
310
+ var addPoolingTo = function (CopyConstructor, pooler) {
311
+ // Casting as any so that flow ignores the actual implementation and trusts
312
+ // it to match the type we declared
313
+ var NewKlass = CopyConstructor;
314
+ NewKlass.instancePool = [];
315
+ NewKlass.getPooled = pooler || DEFAULT_POOLER;
316
+ if (!NewKlass.poolSize) {
317
+ NewKlass.poolSize = DEFAULT_POOL_SIZE;
318
+ }
319
+ NewKlass.release = standardReleaser;
320
+ return NewKlass;
321
+ };
322
+
323
+ var PooledClass = {
324
+ addPoolingTo: addPoolingTo,
325
+ oneArgumentPooler: oneArgumentPooler,
326
+ twoArgumentPooler: twoArgumentPooler$1,
327
+ threeArgumentPooler: threeArgumentPooler,
328
+ fourArgumentPooler: fourArgumentPooler$1
329
+ };
330
+
331
+ var PooledClass_1 = PooledClass;
332
+
333
+ /**
334
+ * Copyright 2013-present, Facebook, Inc.
335
+ * All rights reserved.
336
+ *
337
+ * This source code is licensed under the BSD-style license found in the
338
+ * LICENSE file in the root directory of this source tree. An additional grant
339
+ * of patent rights can be found in the PATENTS file in the same directory.
340
+ *
341
+ * @providesModule ReactCurrentOwner
342
+ *
343
+ */
344
+
345
+ /**
346
+ * Keeps track of the current owner.
347
+ *
348
+ * The current owner is the component who should own any components that are
349
+ * currently being constructed.
350
+ */
351
+ var ReactCurrentOwner = {
352
+ /**
353
+ * @internal
354
+ * @type {ReactComponent}
355
+ */
356
+ current: null
357
+ };
358
+
359
+ var ReactCurrentOwner_1 = ReactCurrentOwner;
360
+
361
+ /**
362
+ * Copyright 2014-present, Facebook, Inc.
363
+ * All rights reserved.
364
+ *
365
+ * This source code is licensed under the BSD-style license found in the
366
+ * LICENSE file in the root directory of this source tree. An additional grant
367
+ * of patent rights can be found in the PATENTS file in the same directory.
368
+ *
369
+ * @providesModule ReactElementSymbol
370
+ *
371
+ */
372
+
373
+ // The Symbol used to tag the ReactElement type. If there is no native Symbol
374
+ // nor polyfill, then a plain number is used for performance.
375
+
376
+ var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
377
+
378
+ var ReactElementSymbol = REACT_ELEMENT_TYPE;
379
+
380
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
381
+
382
+
383
+
384
+ var RESERVED_PROPS = {
385
+ key: true,
386
+ ref: true,
387
+ __self: true,
388
+ __source: true
389
+ };
390
+
391
+ var specialPropKeyWarningShown;
392
+ var specialPropRefWarningShown;
393
+
394
+ function hasValidRef(config) {
395
+ {
396
+ if (hasOwnProperty.call(config, 'ref')) {
397
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
398
+ if (getter && getter.isReactWarning) {
399
+ return false;
400
+ }
401
+ }
402
+ }
403
+ return config.ref !== undefined;
404
+ }
405
+
406
+ function hasValidKey(config) {
407
+ {
408
+ if (hasOwnProperty.call(config, 'key')) {
409
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
410
+ if (getter && getter.isReactWarning) {
411
+ return false;
412
+ }
413
+ }
414
+ }
415
+ return config.key !== undefined;
416
+ }
417
+
418
+ function defineKeyPropWarningGetter(props, displayName) {
419
+ var warnAboutAccessingKey = function () {
420
+ if (!specialPropKeyWarningShown) {
421
+ specialPropKeyWarningShown = true;
422
+ 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);
423
+ }
424
+ };
425
+ warnAboutAccessingKey.isReactWarning = true;
426
+ Object.defineProperty(props, 'key', {
427
+ get: warnAboutAccessingKey,
428
+ configurable: true
429
+ });
430
+ }
431
+
432
+ function defineRefPropWarningGetter(props, displayName) {
433
+ var warnAboutAccessingRef = function () {
434
+ if (!specialPropRefWarningShown) {
435
+ specialPropRefWarningShown = true;
436
+ 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);
437
+ }
438
+ };
439
+ warnAboutAccessingRef.isReactWarning = true;
440
+ Object.defineProperty(props, 'ref', {
441
+ get: warnAboutAccessingRef,
442
+ configurable: true
443
+ });
444
+ }
445
+
446
+ /**
447
+ * Factory method to create a new React element. This no longer adheres to
448
+ * the class pattern, so do not use new to call it. Also, no instanceof check
449
+ * will work. Instead test $$typeof field against Symbol.for('react.element') to check
450
+ * if something is a React Element.
451
+ *
452
+ * @param {*} type
453
+ * @param {*} key
454
+ * @param {string|object} ref
455
+ * @param {*} self A *temporary* helper to detect places where `this` is
456
+ * different from the `owner` when React.createElement is called, so that we
457
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
458
+ * functions, and as long as `this` and owner are the same, there will be no
459
+ * change in behavior.
460
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
461
+ * indicating filename, line number, and/or other information.
462
+ * @param {*} owner
463
+ * @param {*} props
464
+ * @internal
465
+ */
466
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
467
+ var element = {
468
+ // This tag allow us to uniquely identify this as a React Element
469
+ $$typeof: ReactElementSymbol,
470
+
471
+ // Built-in properties that belong on the element
472
+ type: type,
473
+ key: key,
474
+ ref: ref,
475
+ props: props,
476
+
477
+ // Record the component responsible for creating this element.
478
+ _owner: owner
479
+ };
480
+
481
+ {
482
+ // The validation flag is currently mutative. We put it on
483
+ // an external backing store so that we can freeze the whole object.
484
+ // This can be replaced with a WeakMap once they are implemented in
485
+ // commonly used development environments.
486
+ element._store = {};
487
+
488
+ // To make comparing ReactElements easier for testing purposes, we make
489
+ // the validation flag non-enumerable (where possible, which should
490
+ // include every environment we run tests in), so the test framework
491
+ // ignores it.
492
+ if (canDefineProperty_1) {
493
+ Object.defineProperty(element._store, 'validated', {
494
+ configurable: false,
495
+ enumerable: false,
496
+ writable: true,
497
+ value: false
498
+ });
499
+ // self and source are DEV only properties.
500
+ Object.defineProperty(element, '_self', {
501
+ configurable: false,
502
+ enumerable: false,
503
+ writable: false,
504
+ value: self
505
+ });
506
+ // Two elements created in two different places should be considered
507
+ // equal for testing purposes and therefore we hide it from enumeration.
508
+ Object.defineProperty(element, '_source', {
509
+ configurable: false,
510
+ enumerable: false,
511
+ writable: false,
512
+ value: source
513
+ });
514
+ } else {
515
+ element._store.validated = false;
516
+ element._self = self;
517
+ element._source = source;
518
+ }
519
+ if (Object.freeze) {
520
+ Object.freeze(element.props);
521
+ Object.freeze(element);
522
+ }
523
+ }
524
+
525
+ return element;
526
+ };
527
+
528
+ /**
529
+ * Create and return a new ReactElement of the given type.
530
+ * See https://facebook.github.io/react/docs/react-api.html#createelement
531
+ */
532
+ ReactElement.createElement = function (type, config, children) {
533
+ var propName;
534
+
535
+ // Reserved names are extracted
536
+ var props = {};
537
+
538
+ var key = null;
539
+ var ref = null;
540
+ var self = null;
541
+ var source = null;
542
+
543
+ if (config != null) {
544
+ if (hasValidRef(config)) {
545
+ ref = config.ref;
546
+ }
547
+ if (hasValidKey(config)) {
548
+ key = '' + config.key;
549
+ }
550
+
551
+ self = config.__self === undefined ? null : config.__self;
552
+ source = config.__source === undefined ? null : config.__source;
553
+ // Remaining properties are added to a new props object
554
+ for (propName in config) {
555
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
556
+ props[propName] = config[propName];
557
+ }
558
+ }
559
+ }
560
+
561
+ // Children can be more than one argument, and those are transferred onto
562
+ // the newly allocated props object.
563
+ var childrenLength = arguments.length - 2;
564
+ if (childrenLength === 1) {
565
+ props.children = children;
566
+ } else if (childrenLength > 1) {
567
+ var childArray = Array(childrenLength);
568
+ for (var i = 0; i < childrenLength; i++) {
569
+ childArray[i] = arguments[i + 2];
570
+ }
571
+ {
572
+ if (Object.freeze) {
573
+ Object.freeze(childArray);
574
+ }
575
+ }
576
+ props.children = childArray;
577
+ }
578
+
579
+ // Resolve default props
580
+ if (type && type.defaultProps) {
581
+ var defaultProps = type.defaultProps;
582
+ for (propName in defaultProps) {
583
+ if (props[propName] === undefined) {
584
+ props[propName] = defaultProps[propName];
585
+ }
586
+ }
587
+ }
588
+ {
589
+ if (key || ref) {
590
+ if (typeof props.$$typeof === 'undefined' || props.$$typeof !== ReactElementSymbol) {
591
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
592
+ if (key) {
593
+ defineKeyPropWarningGetter(props, displayName);
594
+ }
595
+ if (ref) {
596
+ defineRefPropWarningGetter(props, displayName);
597
+ }
598
+ }
599
+ }
600
+ }
601
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner_1.current, props);
602
+ };
603
+
604
+ /**
605
+ * Return a function that produces ReactElements of a given type.
606
+ * See https://facebook.github.io/react/docs/react-api.html#createfactory
607
+ */
608
+ ReactElement.createFactory = function (type) {
609
+ var factory = ReactElement.createElement.bind(null, type);
610
+ // Expose the type on the factory and the prototype so that it can be
611
+ // easily accessed on elements. E.g. `<Foo />.type === Foo`.
612
+ // This should not be named `constructor` since this may not be the function
613
+ // that created the element, and it may not even be a constructor.
614
+ // Legacy hook TODO: Warn if this is accessed
615
+ factory.type = type;
616
+ return factory;
617
+ };
618
+
619
+ ReactElement.cloneAndReplaceKey = function (oldElement, newKey) {
620
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
621
+
622
+ return newElement;
623
+ };
624
+
625
+ /**
626
+ * Clone and return a new ReactElement using element as the starting point.
627
+ * See https://facebook.github.io/react/docs/react-api.html#cloneelement
628
+ */
629
+ ReactElement.cloneElement = function (element, config, children) {
630
+ var propName;
631
+
632
+ // Original props are copied
633
+ var props = _assign({}, element.props);
634
+
635
+ // Reserved names are extracted
636
+ var key = element.key;
637
+ var ref = element.ref;
638
+ // Self is preserved since the owner is preserved.
639
+ var self = element._self;
640
+ // Source is preserved since cloneElement is unlikely to be targeted by a
641
+ // transpiler, and the original source is probably a better indicator of the
642
+ // true owner.
643
+ var source = element._source;
644
+
645
+ // Owner will be preserved, unless ref is overridden
646
+ var owner = element._owner;
647
+
648
+ if (config != null) {
649
+ if (hasValidRef(config)) {
650
+ // Silently steal the ref from the parent.
651
+ ref = config.ref;
652
+ owner = ReactCurrentOwner_1.current;
653
+ }
654
+ if (hasValidKey(config)) {
655
+ key = '' + config.key;
656
+ }
657
+
658
+ // Remaining properties override existing props
659
+ var defaultProps;
660
+ if (element.type && element.type.defaultProps) {
661
+ defaultProps = element.type.defaultProps;
662
+ }
663
+ for (propName in config) {
664
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
665
+ if (config[propName] === undefined && defaultProps !== undefined) {
666
+ // Resolve default props
667
+ props[propName] = defaultProps[propName];
668
+ } else {
669
+ props[propName] = config[propName];
670
+ }
671
+ }
672
+ }
673
+ }
674
+
675
+ // Children can be more than one argument, and those are transferred onto
676
+ // the newly allocated props object.
677
+ var childrenLength = arguments.length - 2;
678
+ if (childrenLength === 1) {
679
+ props.children = children;
680
+ } else if (childrenLength > 1) {
681
+ var childArray = Array(childrenLength);
682
+ for (var i = 0; i < childrenLength; i++) {
683
+ childArray[i] = arguments[i + 2];
684
+ }
685
+ props.children = childArray;
686
+ }
687
+
688
+ return ReactElement(element.type, key, ref, self, source, owner, props);
689
+ };
690
+
691
+ /**
692
+ * Verifies the object is a ReactElement.
693
+ * See https://facebook.github.io/react/docs/react-api.html#isvalidelement
694
+ * @param {?object} object
695
+ * @return {boolean} True if `object` is a valid component.
696
+ * @final
697
+ */
698
+ ReactElement.isValidElement = function (object) {
699
+ return typeof object === 'object' && object !== null && object.$$typeof === ReactElementSymbol;
700
+ };
701
+
702
+ var ReactElement_1 = ReactElement;
703
+
704
+ /**
705
+ * Copyright 2013-present, Facebook, Inc.
706
+ * All rights reserved.
707
+ *
708
+ * This source code is licensed under the BSD-style license found in the
709
+ * LICENSE file in the root directory of this source tree. An additional grant
710
+ * of patent rights can be found in the PATENTS file in the same directory.
711
+ *
712
+ * @providesModule getIteratorFn
713
+ *
714
+ */
715
+
716
+ /* global Symbol */
717
+
718
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
719
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
720
+
721
+ /**
722
+ * Returns the iterator method function contained on the iterable object.
723
+ *
724
+ * Be sure to invoke the function with the iterable as context:
725
+ *
726
+ * var iteratorFn = getIteratorFn(myIterable);
727
+ * if (iteratorFn) {
728
+ * var iterator = iteratorFn.call(myIterable);
729
+ * ...
730
+ * }
731
+ *
732
+ * @param {?object} maybeIterable
733
+ * @return {?function}
734
+ */
735
+ function getIteratorFn(maybeIterable) {
736
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
737
+ if (typeof iteratorFn === 'function') {
738
+ return iteratorFn;
739
+ }
740
+ }
741
+
742
+ var getIteratorFn_1 = getIteratorFn;
743
+
744
+ /**
745
+ * Copyright 2013-present, Facebook, Inc.
746
+ * All rights reserved.
747
+ *
748
+ * This source code is licensed under the BSD-style license found in the
749
+ * LICENSE file in the root directory of this source tree. An additional grant
750
+ * of patent rights can be found in the PATENTS file in the same directory.
751
+ *
752
+ * @providesModule KeyEscapeUtils
753
+ *
754
+ */
755
+
756
+ /**
757
+ * Escape and wrap key so it is safe to use as a reactid
758
+ *
759
+ * @param {string} key to be escaped.
760
+ * @return {string} the escaped key.
761
+ */
762
+
763
+ function escape(key) {
764
+ var escapeRegex = /[=:]/g;
765
+ var escaperLookup = {
766
+ '=': '=0',
767
+ ':': '=2'
768
+ };
769
+ var escapedString = ('' + key).replace(escapeRegex, function (match) {
770
+ return escaperLookup[match];
771
+ });
772
+
773
+ return '$' + escapedString;
774
+ }
775
+
776
+ /**
777
+ * Unescape and unwrap key for human-readable display
778
+ *
779
+ * @param {string} key to unescape.
780
+ * @return {string} the unescaped key.
781
+ */
782
+ function unescape(key) {
783
+ var unescapeRegex = /(=0|=2)/g;
784
+ var unescaperLookup = {
785
+ '=0': '=',
786
+ '=2': ':'
787
+ };
788
+ var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1);
789
+
790
+ return ('' + keySubstring).replace(unescapeRegex, function (match) {
791
+ return unescaperLookup[match];
792
+ });
793
+ }
794
+
795
+ var KeyEscapeUtils = {
796
+ escape: escape,
797
+ unescape: unescape
798
+ };
799
+
800
+ var KeyEscapeUtils_1 = KeyEscapeUtils;
801
+
802
+ var SEPARATOR = '.';
803
+ var SUBSEPARATOR = ':';
804
+
805
+ /**
806
+ * This is inlined from ReactElement since this file is shared between
807
+ * isomorphic and renderers. We could extract this to a
808
+ *
809
+ */
810
+
811
+ /**
812
+ * TODO: Test that a single child and an array with one item have the same key
813
+ * pattern.
814
+ */
815
+
816
+ var didWarnAboutMaps = false;
817
+
818
+ /**
819
+ * Generate a key string that identifies a component within a set.
820
+ *
821
+ * @param {*} component A component that could contain a manual key.
822
+ * @param {number} index Index that is used if a manual key is not provided.
823
+ * @return {string}
824
+ */
825
+ function getComponentKey(component, index) {
826
+ // Do some typechecking here since we call this blindly. We want to ensure
827
+ // that we don't block potential future ES APIs.
828
+ if (component && typeof component === 'object' && component.key != null) {
829
+ // Explicit key
830
+ return KeyEscapeUtils_1.escape(component.key);
831
+ }
832
+ // Implicit key determined by the index in the set
833
+ return index.toString(36);
834
+ }
835
+
836
+ /**
837
+ * @param {?*} children Children tree container.
838
+ * @param {!string} nameSoFar Name of the key path so far.
839
+ * @param {!function} callback Callback to invoke with each child found.
840
+ * @param {?*} traverseContext Used to pass information throughout the traversal
841
+ * process.
842
+ * @return {!number} The number of children in this subtree.
843
+ */
844
+ function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
845
+ var type = typeof children;
846
+
847
+ if (type === 'undefined' || type === 'boolean') {
848
+ // All of the above are perceived as null.
849
+ children = null;
850
+ }
851
+
852
+ if (children === null || type === 'string' || type === 'number' ||
853
+ // The following is inlined from ReactElement. This means we can optimize
854
+ // some checks. React Fiber also inlines this logic for similar purposes.
855
+ type === 'object' && children.$$typeof === ReactElementSymbol) {
856
+ callback(traverseContext, children,
857
+ // If it's the only child, treat the name as if it was wrapped in an array
858
+ // so that it's consistent if the number of children grows.
859
+ nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
860
+ return 1;
861
+ }
862
+
863
+ var child;
864
+ var nextName;
865
+ var subtreeCount = 0; // Count of children found in the current subtree.
866
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
867
+
868
+ if (Array.isArray(children)) {
869
+ for (var i = 0; i < children.length; i++) {
870
+ child = children[i];
871
+ nextName = nextNamePrefix + getComponentKey(child, i);
872
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
873
+ }
874
+ } else {
875
+ var iteratorFn = getIteratorFn_1(children);
876
+ if (iteratorFn) {
877
+ {
878
+ // Warn about using Maps as children
879
+ if (iteratorFn === children.entries) {
880
+ var mapsAsChildrenAddendum = '';
881
+ if (ReactCurrentOwner_1.current) {
882
+ var mapsAsChildrenOwnerName = ReactCurrentOwner_1.current.getName();
883
+ if (mapsAsChildrenOwnerName) {
884
+ mapsAsChildrenAddendum = '\n\nCheck the render method of `' + mapsAsChildrenOwnerName + '`.';
885
+ }
886
+ }
887
+ 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);
888
+ didWarnAboutMaps = true;
889
+ }
890
+ }
891
+
892
+ var iterator = iteratorFn.call(children);
893
+ var step;
894
+ var ii = 0;
895
+ while (!(step = iterator.next()).done) {
896
+ child = step.value;
897
+ nextName = nextNamePrefix + getComponentKey(child, ii++);
898
+ subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
899
+ }
900
+ } else if (type === 'object') {
901
+ var addendum = '';
902
+ {
903
+ addendum = ' If you meant to render a collection of children, use an array ' + 'instead.';
904
+ if (ReactCurrentOwner_1.current) {
905
+ var name = ReactCurrentOwner_1.current.getName();
906
+ if (name) {
907
+ addendum += '\n\nCheck the render method of `' + name + '`.';
908
+ }
909
+ }
910
+ }
911
+ var childrenString = '' + children;
912
+ 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);
913
+ }
914
+ }
915
+
916
+ return subtreeCount;
917
+ }
918
+
919
+ /**
920
+ * Traverses children that are typically specified as `props.children`, but
921
+ * might also be specified through attributes:
922
+ *
923
+ * - `traverseAllChildren(this.props.children, ...)`
924
+ * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
925
+ *
926
+ * The `traverseContext` is an optional argument that is passed through the
927
+ * entire traversal. It can be used to store accumulations or anything else that
928
+ * the callback might find relevant.
929
+ *
930
+ * @param {?*} children Children tree object.
931
+ * @param {!function} callback To invoke upon traversing each child.
932
+ * @param {?*} traverseContext Context for traversal.
933
+ * @return {!number} The number of children in this subtree.
934
+ */
935
+ function traverseAllChildren(children, callback, traverseContext) {
936
+ if (children == null) {
937
+ return 0;
938
+ }
939
+
940
+ return traverseAllChildrenImpl(children, '', callback, traverseContext);
941
+ }
942
+
943
+ var traverseAllChildren_1 = traverseAllChildren;
944
+
945
+ var twoArgumentPooler = PooledClass_1.twoArgumentPooler;
946
+ var fourArgumentPooler = PooledClass_1.fourArgumentPooler;
947
+
948
+ var userProvidedKeyEscapeRegex = /\/+/g;
949
+ function escapeUserProvidedKey(text) {
950
+ return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
951
+ }
952
+
953
+ /**
954
+ * PooledClass representing the bookkeeping associated with performing a child
955
+ * traversal. Allows avoiding binding callbacks.
956
+ *
957
+ * @constructor ForEachBookKeeping
958
+ * @param {!function} forEachFunction Function to perform traversal with.
959
+ * @param {?*} forEachContext Context to perform context with.
960
+ */
961
+ function ForEachBookKeeping(forEachFunction, forEachContext) {
962
+ this.func = forEachFunction;
963
+ this.context = forEachContext;
964
+ this.count = 0;
965
+ }
966
+ ForEachBookKeeping.prototype.destructor = function () {
967
+ this.func = null;
968
+ this.context = null;
969
+ this.count = 0;
970
+ };
971
+ PooledClass_1.addPoolingTo(ForEachBookKeeping, twoArgumentPooler);
972
+
973
+ function forEachSingleChild(bookKeeping, child, name) {
974
+ var func = bookKeeping.func,
975
+ context = bookKeeping.context;
976
+
977
+ func.call(context, child, bookKeeping.count++);
978
+ }
979
+
980
+ /**
981
+ * Iterates through children that are typically specified as `props.children`.
982
+ *
983
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.foreach
984
+ *
985
+ * The provided forEachFunc(child, index) will be called for each
986
+ * leaf child.
987
+ *
988
+ * @param {?*} children Children tree container.
989
+ * @param {function(*, int)} forEachFunc
990
+ * @param {*} forEachContext Context for forEachContext.
991
+ */
992
+ function forEachChildren(children, forEachFunc, forEachContext) {
993
+ if (children == null) {
994
+ return children;
995
+ }
996
+ var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext);
997
+ traverseAllChildren_1(children, forEachSingleChild, traverseContext);
998
+ ForEachBookKeeping.release(traverseContext);
999
+ }
1000
+
1001
+ /**
1002
+ * PooledClass representing the bookkeeping associated with performing a child
1003
+ * mapping. Allows avoiding binding callbacks.
1004
+ *
1005
+ * @constructor MapBookKeeping
1006
+ * @param {!*} mapResult Object containing the ordered map of results.
1007
+ * @param {!function} mapFunction Function to perform mapping with.
1008
+ * @param {?*} mapContext Context to perform mapping with.
1009
+ */
1010
+ function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
1011
+ this.result = mapResult;
1012
+ this.keyPrefix = keyPrefix;
1013
+ this.func = mapFunction;
1014
+ this.context = mapContext;
1015
+ this.count = 0;
1016
+ }
1017
+ MapBookKeeping.prototype.destructor = function () {
1018
+ this.result = null;
1019
+ this.keyPrefix = null;
1020
+ this.func = null;
1021
+ this.context = null;
1022
+ this.count = 0;
1023
+ };
1024
+ PooledClass_1.addPoolingTo(MapBookKeeping, fourArgumentPooler);
1025
+
1026
+ function mapSingleChildIntoContext(bookKeeping, child, childKey) {
1027
+ var result = bookKeeping.result,
1028
+ keyPrefix = bookKeeping.keyPrefix,
1029
+ func = bookKeeping.func,
1030
+ context = bookKeeping.context;
1031
+
1032
+
1033
+ var mappedChild = func.call(context, child, bookKeeping.count++);
1034
+ if (Array.isArray(mappedChild)) {
1035
+ mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
1036
+ } else if (mappedChild != null) {
1037
+ if (ReactElement_1.isValidElement(mappedChild)) {
1038
+ mappedChild = ReactElement_1.cloneAndReplaceKey(mappedChild,
1039
+ // Keep both the (mapped) and old keys if they differ, just as
1040
+ // traverseAllChildren used to do for objects as children
1041
+ keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
1042
+ }
1043
+ result.push(mappedChild);
1044
+ }
1045
+ }
1046
+
1047
+ function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
1048
+ var escapedPrefix = '';
1049
+ if (prefix != null) {
1050
+ escapedPrefix = escapeUserProvidedKey(prefix) + '/';
1051
+ }
1052
+ var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context);
1053
+ traverseAllChildren_1(children, mapSingleChildIntoContext, traverseContext);
1054
+ MapBookKeeping.release(traverseContext);
1055
+ }
1056
+
1057
+ /**
1058
+ * Maps children that are typically specified as `props.children`.
1059
+ *
1060
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.map
1061
+ *
1062
+ * The provided mapFunction(child, key, index) will be called for each
1063
+ * leaf child.
1064
+ *
1065
+ * @param {?*} children Children tree container.
1066
+ * @param {function(*, int)} func The map function.
1067
+ * @param {*} context Context for mapFunction.
1068
+ * @return {object} Object containing the ordered map of results.
1069
+ */
1070
+ function mapChildren(children, func, context) {
1071
+ if (children == null) {
1072
+ return children;
1073
+ }
1074
+ var result = [];
1075
+ mapIntoWithKeyPrefixInternal(children, result, null, func, context);
1076
+ return result;
1077
+ }
1078
+
1079
+ function forEachSingleChildDummy(traverseContext, child, name) {
1080
+ return null;
1081
+ }
1082
+
1083
+ /**
1084
+ * Count the number of children that are typically specified as
1085
+ * `props.children`.
1086
+ *
1087
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.count
1088
+ *
1089
+ * @param {?*} children Children tree container.
1090
+ * @return {number} The number of children.
1091
+ */
1092
+ function countChildren(children, context) {
1093
+ return traverseAllChildren_1(children, forEachSingleChildDummy, null);
1094
+ }
1095
+
1096
+ /**
1097
+ * Flatten a children object (typically specified as `props.children`) and
1098
+ * return an array with appropriately re-keyed children.
1099
+ *
1100
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.toarray
1101
+ */
1102
+ function toArray(children) {
1103
+ var result = [];
1104
+ mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
1105
+ return result;
1106
+ }
1107
+
1108
+ var ReactChildren = {
1109
+ forEach: forEachChildren,
1110
+ map: mapChildren,
1111
+ mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal,
1112
+ count: countChildren,
1113
+ toArray: toArray
1114
+ };
1115
+
1116
+ var ReactChildren_1 = ReactChildren;
1117
+
1118
+ var ReactComponent$1 = ReactBaseClasses.Component;
1119
+
1120
+ var MIXINS_KEY = 'mixins';
1121
+
1122
+ // Helper function to allow the creation of anonymous functions which do not
1123
+ // have .name set to the name of the variable being assigned to.
1124
+ function identity(fn) {
1125
+ return fn;
1126
+ }
1127
+
1128
+ /**
1129
+ * Policies that describe methods in `ReactClassInterface`.
1130
+ */
1131
+
1132
+
1133
+ /**
1134
+ * Composite components are higher-level components that compose other composite
1135
+ * or host components.
1136
+ *
1137
+ * To create a new type of `ReactClass`, pass a specification of
1138
+ * your new class to `React.createClass`. The only requirement of your class
1139
+ * specification is that you implement a `render` method.
1140
+ *
1141
+ * var MyComponent = React.createClass({
1142
+ * render: function() {
1143
+ * return <div>Hello World</div>;
1144
+ * }
1145
+ * });
1146
+ *
1147
+ * The class specification supports a specific protocol of methods that have
1148
+ * special meaning (e.g. `render`). See `ReactClassInterface` for
1149
+ * more the comprehensive protocol. Any other properties and methods in the
1150
+ * class specification will be available on the prototype.
1151
+ *
1152
+ * @interface ReactClassInterface
1153
+ * @internal
1154
+ */
1155
+ var ReactClassInterface = {
1156
+ /**
1157
+ * An array of Mixin objects to include when defining your component.
1158
+ *
1159
+ * @type {array}
1160
+ * @optional
1161
+ */
1162
+ mixins: 'DEFINE_MANY',
1163
+
1164
+ /**
1165
+ * An object containing properties and methods that should be defined on
1166
+ * the component's constructor instead of its prototype (static methods).
1167
+ *
1168
+ * @type {object}
1169
+ * @optional
1170
+ */
1171
+ statics: 'DEFINE_MANY',
1172
+
1173
+ /**
1174
+ * Definition of prop types for this component.
1175
+ *
1176
+ * @type {object}
1177
+ * @optional
1178
+ */
1179
+ propTypes: 'DEFINE_MANY',
1180
+
1181
+ /**
1182
+ * Definition of context types for this component.
1183
+ *
1184
+ * @type {object}
1185
+ * @optional
1186
+ */
1187
+ contextTypes: 'DEFINE_MANY',
1188
+
1189
+ /**
1190
+ * Definition of context types this component sets for its children.
1191
+ *
1192
+ * @type {object}
1193
+ * @optional
1194
+ */
1195
+ childContextTypes: 'DEFINE_MANY',
1196
+
1197
+ // ==== Definition methods ====
1198
+
1199
+ /**
1200
+ * Invoked when the component is mounted. Values in the mapping will be set on
1201
+ * `this.props` if that prop is not specified (i.e. using an `in` check).
1202
+ *
1203
+ * This method is invoked before `getInitialState` and therefore cannot rely
1204
+ * on `this.state` or use `this.setState`.
1205
+ *
1206
+ * @return {object}
1207
+ * @optional
1208
+ */
1209
+ getDefaultProps: 'DEFINE_MANY_MERGED',
1210
+
1211
+ /**
1212
+ * Invoked once before the component is mounted. The return value will be used
1213
+ * as the initial value of `this.state`.
1214
+ *
1215
+ * getInitialState: function() {
1216
+ * return {
1217
+ * isOn: false,
1218
+ * fooBaz: new BazFoo()
1219
+ * }
1220
+ * }
1221
+ *
1222
+ * @return {object}
1223
+ * @optional
1224
+ */
1225
+ getInitialState: 'DEFINE_MANY_MERGED',
1226
+
1227
+ /**
1228
+ * @return {object}
1229
+ * @optional
1230
+ */
1231
+ getChildContext: 'DEFINE_MANY_MERGED',
1232
+
1233
+ /**
1234
+ * Uses props from `this.props` and state from `this.state` to render the
1235
+ * structure of the component.
1236
+ *
1237
+ * No guarantees are made about when or how often this method is invoked, so
1238
+ * it must not have side effects.
1239
+ *
1240
+ * render: function() {
1241
+ * var name = this.props.name;
1242
+ * return <div>Hello, {name}!</div>;
1243
+ * }
1244
+ *
1245
+ * @return {ReactComponent}
1246
+ * @required
1247
+ */
1248
+ render: 'DEFINE_ONCE',
1249
+
1250
+ // ==== Delegate methods ====
1251
+
1252
+ /**
1253
+ * Invoked when the component is initially created and about to be mounted.
1254
+ * This may have side effects, but any external subscriptions or data created
1255
+ * by this method must be cleaned up in `componentWillUnmount`.
1256
+ *
1257
+ * @optional
1258
+ */
1259
+ componentWillMount: 'DEFINE_MANY',
1260
+
1261
+ /**
1262
+ * Invoked when the component has been mounted and has a DOM representation.
1263
+ * However, there is no guarantee that the DOM node is in the document.
1264
+ *
1265
+ * Use this as an opportunity to operate on the DOM when the component has
1266
+ * been mounted (initialized and rendered) for the first time.
1267
+ *
1268
+ * @param {DOMElement} rootNode DOM element representing the component.
1269
+ * @optional
1270
+ */
1271
+ componentDidMount: 'DEFINE_MANY',
1272
+
1273
+ /**
1274
+ * Invoked before the component receives new props.
1275
+ *
1276
+ * Use this as an opportunity to react to a prop transition by updating the
1277
+ * state using `this.setState`. Current props are accessed via `this.props`.
1278
+ *
1279
+ * componentWillReceiveProps: function(nextProps, nextContext) {
1280
+ * this.setState({
1281
+ * likesIncreasing: nextProps.likeCount > this.props.likeCount
1282
+ * });
1283
+ * }
1284
+ *
1285
+ * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
1286
+ * transition may cause a state change, but the opposite is not true. If you
1287
+ * need it, you are probably looking for `componentWillUpdate`.
1288
+ *
1289
+ * @param {object} nextProps
1290
+ * @optional
1291
+ */
1292
+ componentWillReceiveProps: 'DEFINE_MANY',
1293
+
1294
+ /**
1295
+ * Invoked while deciding if the component should be updated as a result of
1296
+ * receiving new props, state and/or context.
1297
+ *
1298
+ * Use this as an opportunity to `return false` when you're certain that the
1299
+ * transition to the new props/state/context will not require a component
1300
+ * update.
1301
+ *
1302
+ * shouldComponentUpdate: function(nextProps, nextState, nextContext) {
1303
+ * return !equal(nextProps, this.props) ||
1304
+ * !equal(nextState, this.state) ||
1305
+ * !equal(nextContext, this.context);
1306
+ * }
1307
+ *
1308
+ * @param {object} nextProps
1309
+ * @param {?object} nextState
1310
+ * @param {?object} nextContext
1311
+ * @return {boolean} True if the component should update.
1312
+ * @optional
1313
+ */
1314
+ shouldComponentUpdate: 'DEFINE_ONCE',
1315
+
1316
+ /**
1317
+ * Invoked when the component is about to update due to a transition from
1318
+ * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
1319
+ * and `nextContext`.
1320
+ *
1321
+ * Use this as an opportunity to perform preparation before an update occurs.
1322
+ *
1323
+ * NOTE: You **cannot** use `this.setState()` in this method.
1324
+ *
1325
+ * @param {object} nextProps
1326
+ * @param {?object} nextState
1327
+ * @param {?object} nextContext
1328
+ * @param {ReactReconcileTransaction} transaction
1329
+ * @optional
1330
+ */
1331
+ componentWillUpdate: 'DEFINE_MANY',
1332
+
1333
+ /**
1334
+ * Invoked when the component's DOM representation has been updated.
1335
+ *
1336
+ * Use this as an opportunity to operate on the DOM when the component has
1337
+ * been updated.
1338
+ *
1339
+ * @param {object} prevProps
1340
+ * @param {?object} prevState
1341
+ * @param {?object} prevContext
1342
+ * @param {DOMElement} rootNode DOM element representing the component.
1343
+ * @optional
1344
+ */
1345
+ componentDidUpdate: 'DEFINE_MANY',
1346
+
1347
+ /**
1348
+ * Invoked when the component is about to be removed from its parent and have
1349
+ * its DOM representation destroyed.
1350
+ *
1351
+ * Use this as an opportunity to deallocate any external resources.
1352
+ *
1353
+ * NOTE: There is no `componentDidUnmount` since your component will have been
1354
+ * destroyed by that point.
1355
+ *
1356
+ * @optional
1357
+ */
1358
+ componentWillUnmount: 'DEFINE_MANY',
1359
+
1360
+ // ==== Advanced methods ====
1361
+
1362
+ /**
1363
+ * Updates the component's currently mounted DOM representation.
1364
+ *
1365
+ * By default, this implements React's rendering and reconciliation algorithm.
1366
+ * Sophisticated clients may wish to override this.
1367
+ *
1368
+ * @param {ReactReconcileTransaction} transaction
1369
+ * @internal
1370
+ * @overridable
1371
+ */
1372
+ updateComponent: 'OVERRIDE_BASE'
1373
+ };
1374
+
1375
+ /**
1376
+ * Mapping from class specification keys to special processing functions.
1377
+ *
1378
+ * Although these are declared like instance properties in the specification
1379
+ * when defining classes using `React.createClass`, they are actually static
1380
+ * and are accessible on the constructor instead of the prototype. Despite
1381
+ * being static, they must be defined outside of the "statics" key under
1382
+ * which all other static methods are defined.
1383
+ */
1384
+ var RESERVED_SPEC_KEYS = {
1385
+ displayName: function (Constructor, displayName) {
1386
+ Constructor.displayName = displayName;
1387
+ },
1388
+ mixins: function (Constructor, mixins) {
1389
+ if (mixins) {
1390
+ for (var i = 0; i < mixins.length; i++) {
1391
+ mixSpecIntoComponent(Constructor, mixins[i]);
1392
+ }
1393
+ }
1394
+ },
1395
+ childContextTypes: function (Constructor, childContextTypes) {
1396
+ {
1397
+ validateTypeDef(Constructor, childContextTypes, 'child context');
1398
+ }
1399
+ Constructor.childContextTypes = _assign({}, Constructor.childContextTypes, childContextTypes);
1400
+ },
1401
+ contextTypes: function (Constructor, contextTypes) {
1402
+ {
1403
+ validateTypeDef(Constructor, contextTypes, 'context');
1404
+ }
1405
+ Constructor.contextTypes = _assign({}, Constructor.contextTypes, contextTypes);
1406
+ },
1407
+ /**
1408
+ * Special case getDefaultProps which should move into statics but requires
1409
+ * automatic merging.
1410
+ */
1411
+ getDefaultProps: function (Constructor, getDefaultProps) {
1412
+ if (Constructor.getDefaultProps) {
1413
+ Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps);
1414
+ } else {
1415
+ Constructor.getDefaultProps = getDefaultProps;
1416
+ }
1417
+ },
1418
+ propTypes: function (Constructor, propTypes) {
1419
+ {
1420
+ validateTypeDef(Constructor, propTypes, 'prop');
1421
+ }
1422
+ Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
1423
+ },
1424
+ statics: function (Constructor, statics) {
1425
+ mixStaticSpecIntoComponent(Constructor, statics);
1426
+ },
1427
+ autobind: function () {} };
1428
+
1429
+ function validateTypeDef(Constructor, typeDef, location) {
1430
+ for (var propName in typeDef) {
1431
+ if (typeDef.hasOwnProperty(propName)) {
1432
+ // use a warning instead of an invariant so components
1433
+ // don't show up in prod but only in true
1434
+ warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', location, propName);
1435
+ }
1436
+ }
1437
+ }
1438
+
1439
+ function validateMethodOverride(isAlreadyDefined, name) {
1440
+ var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null;
1441
+
1442
+ // Disallow overriding of base class methods unless explicitly allowed.
1443
+ if (ReactClassMixin.hasOwnProperty(name)) {
1444
+ !(specPolicy === 'OVERRIDE_BASE') ? invariant(false, 'ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.', name) : void 0;
1445
+ }
1446
+
1447
+ // Disallow defining methods more than once unless explicitly allowed.
1448
+ if (isAlreadyDefined) {
1449
+ !(specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED') ? invariant(false, 'ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : void 0;
1450
+ }
1451
+ }
1452
+
1453
+ /**
1454
+ * Mixin helper which handles policy validation and reserved
1455
+ * specification keys when building React classes.
1456
+ */
1457
+ function mixSpecIntoComponent(Constructor, spec) {
1458
+ if (!spec) {
1459
+ {
1460
+ var typeofSpec = typeof spec;
1461
+ var isMixinValid = typeofSpec === 'object' && spec !== null;
1462
+
1463
+ warning(isMixinValid, "%s: You're attempting to include a mixin that is either null " + 'or not an object. Check the mixins included by the component, ' + 'as well as any mixins they include themselves. ' + 'Expected object but got %s.', Constructor.displayName || 'ReactClass', spec === null ? null : typeofSpec);
1464
+ }
1465
+
1466
+ return;
1467
+ }
1468
+
1469
+ !(typeof spec !== 'function') ? invariant(false, 'ReactClass: You\'re attempting to use a component class or function as a mixin. Instead, just use a regular object.') : void 0;
1470
+ !!ReactElement_1.isValidElement(spec) ? invariant(false, 'ReactClass: You\'re attempting to use a component as a mixin. Instead, just use a regular object.') : void 0;
1471
+
1472
+ var proto = Constructor.prototype;
1473
+ var autoBindPairs = proto.__reactAutoBindPairs;
1474
+
1475
+ // By handling mixins before any other properties, we ensure the same
1476
+ // chaining order is applied to methods with DEFINE_MANY policy, whether
1477
+ // mixins are listed before or after these methods in the spec.
1478
+ if (spec.hasOwnProperty(MIXINS_KEY)) {
1479
+ RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
1480
+ }
1481
+
1482
+ for (var name in spec) {
1483
+ if (!spec.hasOwnProperty(name)) {
1484
+ continue;
1485
+ }
1486
+
1487
+ if (name === MIXINS_KEY) {
1488
+ // We have already handled mixins in a special case above.
1489
+ continue;
1490
+ }
1491
+
1492
+ var property = spec[name];
1493
+ var isAlreadyDefined = proto.hasOwnProperty(name);
1494
+ validateMethodOverride(isAlreadyDefined, name);
1495
+
1496
+ if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
1497
+ RESERVED_SPEC_KEYS[name](Constructor, property);
1498
+ } else {
1499
+ // Setup methods on prototype:
1500
+ // The following member methods should not be automatically bound:
1501
+ // 1. Expected ReactClass methods (in the "interface").
1502
+ // 2. Overridden methods (that were mixed in).
1503
+ var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
1504
+ var isFunction = typeof property === 'function';
1505
+ var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false;
1506
+
1507
+ if (shouldAutoBind) {
1508
+ autoBindPairs.push(name, property);
1509
+ proto[name] = property;
1510
+ } else {
1511
+ if (isAlreadyDefined) {
1512
+ var specPolicy = ReactClassInterface[name];
1513
+
1514
+ // These cases should already be caught by validateMethodOverride.
1515
+ !(isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY')) ? invariant(false, 'ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.', specPolicy, name) : void 0;
1516
+
1517
+ // For methods which are defined more than once, call the existing
1518
+ // methods before calling the new property, merging if appropriate.
1519
+ if (specPolicy === 'DEFINE_MANY_MERGED') {
1520
+ proto[name] = createMergedResultFunction(proto[name], property);
1521
+ } else if (specPolicy === 'DEFINE_MANY') {
1522
+ proto[name] = createChainedFunction(proto[name], property);
1523
+ }
1524
+ } else {
1525
+ proto[name] = property;
1526
+ {
1527
+ // Add verbose displayName to the function, which helps when looking
1528
+ // at profiling tools.
1529
+ if (typeof property === 'function' && spec.displayName) {
1530
+ proto[name].displayName = spec.displayName + '_' + name;
1531
+ }
1532
+ }
1533
+ }
1534
+ }
1535
+ }
1536
+ }
1537
+ }
1538
+
1539
+ function mixStaticSpecIntoComponent(Constructor, statics) {
1540
+ if (!statics) {
1541
+ return;
1542
+ }
1543
+ for (var name in statics) {
1544
+ var property = statics[name];
1545
+ if (!statics.hasOwnProperty(name)) {
1546
+ continue;
1547
+ }
1548
+
1549
+ var isReserved = name in RESERVED_SPEC_KEYS;
1550
+ !!isReserved ? invariant(false, 'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.', name) : void 0;
1551
+
1552
+ var isInherited = name in Constructor;
1553
+ !!isInherited ? invariant(false, 'ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.', name) : void 0;
1554
+ Constructor[name] = property;
1555
+ }
1556
+ }
1557
+
1558
+ /**
1559
+ * Merge two objects, but throw if both contain the same key.
1560
+ *
1561
+ * @param {object} one The first object, which is mutated.
1562
+ * @param {object} two The second object
1563
+ * @return {object} one after it has been mutated to contain everything in two.
1564
+ */
1565
+ function mergeIntoWithNoDuplicateKeys(one, two) {
1566
+ !(one && two && typeof one === 'object' && typeof two === 'object') ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : void 0;
1567
+
1568
+ for (var key in two) {
1569
+ if (two.hasOwnProperty(key)) {
1570
+ !(one[key] === undefined) ? invariant(false, 'mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.', key) : void 0;
1571
+ one[key] = two[key];
1572
+ }
1573
+ }
1574
+ return one;
1575
+ }
1576
+
1577
+ /**
1578
+ * Creates a function that invokes two functions and merges their return values.
1579
+ *
1580
+ * @param {function} one Function to invoke first.
1581
+ * @param {function} two Function to invoke second.
1582
+ * @return {function} Function that invokes the two argument functions.
1583
+ * @private
1584
+ */
1585
+ function createMergedResultFunction(one, two) {
1586
+ return function mergedResult() {
1587
+ var a = one.apply(this, arguments);
1588
+ var b = two.apply(this, arguments);
1589
+ if (a == null) {
1590
+ return b;
1591
+ } else if (b == null) {
1592
+ return a;
1593
+ }
1594
+ var c = {};
1595
+ mergeIntoWithNoDuplicateKeys(c, a);
1596
+ mergeIntoWithNoDuplicateKeys(c, b);
1597
+ return c;
1598
+ };
1599
+ }
1600
+
1601
+ /**
1602
+ * Creates a function that invokes two functions and ignores their return vales.
1603
+ *
1604
+ * @param {function} one Function to invoke first.
1605
+ * @param {function} two Function to invoke second.
1606
+ * @return {function} Function that invokes the two argument functions.
1607
+ * @private
1608
+ */
1609
+ function createChainedFunction(one, two) {
1610
+ return function chainedFunction() {
1611
+ one.apply(this, arguments);
1612
+ two.apply(this, arguments);
1613
+ };
1614
+ }
1615
+
1616
+ /**
1617
+ * Binds a method to the component.
1618
+ *
1619
+ * @param {object} component Component whose method is going to be bound.
1620
+ * @param {function} method Method to be bound.
1621
+ * @return {function} The bound method.
1622
+ */
1623
+ function bindAutoBindMethod(component, method) {
1624
+ var boundMethod = method.bind(component);
1625
+ {
1626
+ boundMethod.__reactBoundContext = component;
1627
+ boundMethod.__reactBoundMethod = method;
1628
+ boundMethod.__reactBoundArguments = null;
1629
+ var componentName = component.constructor.displayName;
1630
+ var _bind = boundMethod.bind;
1631
+ boundMethod.bind = function (newThis) {
1632
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1633
+ args[_key - 1] = arguments[_key];
1634
+ }
1635
+
1636
+ // User is trying to bind() an autobound method; we effectively will
1637
+ // ignore the value of "this" that the user is trying to use, so
1638
+ // let's warn.
1639
+ if (newThis !== component && newThis !== null) {
1640
+ warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance.\n\nSee %s', componentName);
1641
+ } else if (!args.length) {
1642
+ warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call.\n\nSee %s', componentName);
1643
+ return boundMethod;
1644
+ }
1645
+ var reboundMethod = _bind.apply(boundMethod, arguments);
1646
+ reboundMethod.__reactBoundContext = component;
1647
+ reboundMethod.__reactBoundMethod = method;
1648
+ reboundMethod.__reactBoundArguments = args;
1649
+ return reboundMethod;
1650
+ };
1651
+ }
1652
+ return boundMethod;
1653
+ }
1654
+
1655
+ /**
1656
+ * Binds all auto-bound methods in a component.
1657
+ *
1658
+ * @param {object} component Component whose method is going to be bound.
1659
+ */
1660
+ function bindAutoBindMethods(component) {
1661
+ var pairs = component.__reactAutoBindPairs;
1662
+ for (var i = 0; i < pairs.length; i += 2) {
1663
+ var autoBindKey = pairs[i];
1664
+ var method = pairs[i + 1];
1665
+ component[autoBindKey] = bindAutoBindMethod(component, method);
1666
+ }
1667
+ }
1668
+
1669
+ /**
1670
+ * Add more to the ReactClass base class. These are all legacy features and
1671
+ * therefore not already part of the modern ReactComponent.
1672
+ */
1673
+ var ReactClassMixin = {
1674
+ /**
1675
+ * TODO: This will be deprecated because state should always keep a consistent
1676
+ * type signature and the only use case for this, is to avoid that.
1677
+ */
1678
+ replaceState: function (newState, callback) {
1679
+ this.updater.enqueueReplaceState(this, newState, callback, 'replaceState');
1680
+ },
1681
+
1682
+ /**
1683
+ * Checks whether or not this composite component is mounted.
1684
+ * @return {boolean} True if mounted, false otherwise.
1685
+ * @protected
1686
+ * @final
1687
+ */
1688
+ isMounted: function () {
1689
+ return this.updater.isMounted(this);
1690
+ }
1691
+ };
1692
+
1693
+ var ReactClassComponent = function () {};
1694
+ _assign(ReactClassComponent.prototype, ReactComponent$1.prototype, ReactClassMixin);
1695
+
1696
+ /**
1697
+ * Module for creating composite components.
1698
+ *
1699
+ * @class ReactClass
1700
+ */
1701
+ var ReactClass = {
1702
+ /**
1703
+ * Creates a composite component class given a class specification.
1704
+ * See https://facebook.github.io/react/docs/react-api.html#createclass
1705
+ *
1706
+ * @param {object} spec Class specification (which must define `render`).
1707
+ * @return {function} Component constructor function.
1708
+ * @public
1709
+ */
1710
+ createClass: function (spec) {
1711
+ // To keep our warnings more understandable, we'll use a little hack here to
1712
+ // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
1713
+ // unnecessarily identify a class without displayName as 'Constructor'.
1714
+ var Constructor = identity(function (props, context, updater) {
1715
+ // This constructor gets overridden by mocks. The argument is used
1716
+ // by mocks to assert on what gets mounted.
1717
+
1718
+ {
1719
+ warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory');
1720
+ }
1721
+
1722
+ // Wire up auto-binding
1723
+ if (this.__reactAutoBindPairs.length) {
1724
+ bindAutoBindMethods(this);
1725
+ }
1726
+
1727
+ this.props = props;
1728
+ this.context = context;
1729
+ this.refs = emptyObject;
1730
+ this.updater = updater || ReactNoopUpdateQueue_1;
1731
+
1732
+ this.state = null;
1733
+
1734
+ // ReactClasses doesn't have constructors. Instead, they use the
1735
+ // getInitialState and componentWillMount methods for initialization.
1736
+
1737
+ var initialState = this.getInitialState ? this.getInitialState() : null;
1738
+ {
1739
+ // We allow auto-mocks to proceed as if they're returning null.
1740
+ if (initialState === undefined && this.getInitialState._isMockFunction) {
1741
+ // This is probably bad practice. Consider warning here and
1742
+ // deprecating this convenience.
1743
+ initialState = null;
1744
+ }
1745
+ }
1746
+ !(typeof initialState === 'object' && !Array.isArray(initialState)) ? invariant(false, '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : void 0;
1747
+
1748
+ this.state = initialState;
1749
+ });
1750
+ Constructor.prototype = new ReactClassComponent();
1751
+ Constructor.prototype.constructor = Constructor;
1752
+ Constructor.prototype.__reactAutoBindPairs = [];
1753
+
1754
+ mixSpecIntoComponent(Constructor, spec);
1755
+
1756
+ // Initialize the defaultProps property after all mixins have been merged.
1757
+ if (Constructor.getDefaultProps) {
1758
+ Constructor.defaultProps = Constructor.getDefaultProps();
1759
+ }
1760
+
1761
+ {
1762
+ // This is a tag to indicate that the use of these method names is ok,
1763
+ // since it's used with createClass. If it's not, then it's likely a
1764
+ // mistake so we'll warn you to use the static property, property
1765
+ // initializer or constructor respectively.
1766
+ if (Constructor.getDefaultProps) {
1767
+ Constructor.getDefaultProps.isReactClassApproved = {};
1768
+ }
1769
+ if (Constructor.prototype.getInitialState) {
1770
+ Constructor.prototype.getInitialState.isReactClassApproved = {};
1771
+ }
1772
+ }
1773
+
1774
+ !Constructor.prototype.render ? invariant(false, 'createClass(...): Class specification must implement a `render` method.') : void 0;
1775
+
1776
+ {
1777
+ warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component');
1778
+ warning(!Constructor.prototype.componentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', spec.displayName || 'A component');
1779
+ }
1780
+
1781
+ // Reduce time spent doing lookups by setting these on the prototype.
1782
+ for (var methodName in ReactClassInterface) {
1783
+ if (!Constructor.prototype[methodName]) {
1784
+ Constructor.prototype[methodName] = null;
1785
+ }
1786
+ }
1787
+
1788
+ return Constructor;
1789
+ }
1790
+ };
1791
+
1792
+ var ReactClass_1 = ReactClass;
1793
+
1794
+ /**
1795
+ * Copyright 2013-present, Facebook, Inc.
1796
+ * All rights reserved.
1797
+ *
1798
+ * This source code is licensed under the BSD-style license found in the
1799
+ * LICENSE file in the root directory of this source tree. An additional grant
1800
+ * of patent rights can be found in the PATENTS file in the same directory.
1801
+ *
1802
+ *
1803
+ * @providesModule ReactPropTypesSecret
1804
+ */
1805
+
1806
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1807
+
1808
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
1809
+
1810
+ var loggedTypeFailures = {};
1811
+
1812
+ /**
1813
+ * Assert that the values match with the type specs.
1814
+ * Error messages are memorized and will only be shown once.
1815
+ *
1816
+ * @param {object} typeSpecs Map of name to a ReactPropType
1817
+ * @param {object} values Runtime values that need to be type-checked
1818
+ * @param {string} location e.g. "prop", "context", "child context"
1819
+ * @param {string} componentName Name of the component for error messages.
1820
+ * @param {?Function} getStack Returns the component stack.
1821
+ * @private
1822
+ */
1823
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1824
+ {
1825
+ for (var typeSpecName in typeSpecs) {
1826
+ if (typeSpecs.hasOwnProperty(typeSpecName)) {
1827
+ var error;
1828
+ // Prop type validation may throw. In case they do, we don't want to
1829
+ // fail the render phase where it didn't fail before. So we log it.
1830
+ // After these have been cleaned up, we'll let them throw.
1831
+ try {
1832
+ // This is intentionally an invariant that gets caught. It's the same
1833
+ // behavior as without this statement except with a better message.
1834
+ !(typeof typeSpecs[typeSpecName] === 'function') ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', location, typeSpecName) : void 0;
1835
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret_1);
1836
+ } catch (ex) {
1837
+ error = ex;
1838
+ }
1839
+ warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
1840
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1841
+ // Only monitor this failure once because there tends to be a lot of the
1842
+ // same error.
1843
+ loggedTypeFailures[error.message] = true;
1844
+
1845
+ var stack = getStack ? getStack() : '';
1846
+
1847
+ warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1848
+ }
1849
+ }
1850
+ }
1851
+ }
1852
+ }
1853
+
1854
+ var checkPropTypes_1 = checkPropTypes;
1855
+
1856
+ /**
1857
+ * Copyright 2013-present, Facebook, Inc.
1858
+ * All rights reserved.
1859
+ *
1860
+ * This source code is licensed under the BSD-style license found in the
1861
+ * LICENSE file in the root directory of this source tree. An additional grant
1862
+ * of patent rights can be found in the PATENTS file in the same directory.
1863
+ *
1864
+ * @providesModule ReactTypeOfWork
1865
+ *
1866
+ */
1867
+
1868
+ var ReactTypeOfWork = {
1869
+ IndeterminateComponent: 0, // Before we know whether it is functional or class
1870
+ FunctionalComponent: 1,
1871
+ ClassComponent: 2,
1872
+ HostRoot: 3, // Root of a host tree. Could be nested inside another node.
1873
+ HostPortal: 4, // A subtree. Could be an entry point to a different renderer.
1874
+ HostComponent: 5,
1875
+ HostText: 6,
1876
+ CoroutineComponent: 7,
1877
+ CoroutineHandlerPhase: 8,
1878
+ YieldComponent: 9,
1879
+ Fragment: 10
1880
+ };
1881
+
1882
+ /**
1883
+ * Copyright 2013-present, Facebook, Inc.
1884
+ * All rights reserved.
1885
+ *
1886
+ * This source code is licensed under the BSD-style license found in the
1887
+ * LICENSE file in the root directory of this source tree. An additional grant
1888
+ * of patent rights can be found in the PATENTS file in the same directory.
1889
+ *
1890
+ * @providesModule getComponentName
1891
+ *
1892
+ */
1893
+
1894
+ function getComponentName(instanceOrFiber) {
1895
+ if (typeof instanceOrFiber.getName === 'function') {
1896
+ // Stack reconciler
1897
+ var instance = instanceOrFiber;
1898
+ return instance.getName();
1899
+ }
1900
+ if (typeof instanceOrFiber.tag === 'number') {
1901
+ // Fiber reconciler
1902
+ var fiber = instanceOrFiber;
1903
+ var type = fiber.type;
1904
+
1905
+ if (typeof type === 'string') {
1906
+ return type;
1907
+ }
1908
+ if (typeof type === 'function') {
1909
+ return type.displayName || type.name;
1910
+ }
1911
+ }
1912
+ return null;
1913
+ }
1914
+
1915
+ var getComponentName_1 = getComponentName;
1916
+
1917
+ var IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent;
1918
+ var FunctionalComponent = ReactTypeOfWork.FunctionalComponent;
1919
+ var ClassComponent = ReactTypeOfWork.ClassComponent;
1920
+ var HostComponent = ReactTypeOfWork.HostComponent;
1921
+
1922
+
1923
+
1924
+ function describeComponentFrame$1(name, source, ownerName) {
1925
+ return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
1926
+ }
1927
+
1928
+ function describeFiber(fiber) {
1929
+ switch (fiber.tag) {
1930
+ case IndeterminateComponent:
1931
+ case FunctionalComponent:
1932
+ case ClassComponent:
1933
+ case HostComponent:
1934
+ var owner = fiber._debugOwner;
1935
+ var source = fiber._debugSource;
1936
+ var name = getComponentName_1(fiber);
1937
+ var ownerName = null;
1938
+ if (owner) {
1939
+ ownerName = getComponentName_1(owner);
1940
+ }
1941
+ return describeComponentFrame$1(name, source, ownerName);
1942
+ default:
1943
+ return '';
1944
+ }
1945
+ }
1946
+
1947
+ // This function can only be called with a work-in-progress fiber and
1948
+ // only during begin or complete phase. Do not call it under any other
1949
+ // circumstances.
1950
+ function getStackAddendumByWorkInProgressFiber$2(workInProgress) {
1951
+ var info = '';
1952
+ var node = workInProgress;
1953
+ do {
1954
+ info += describeFiber(node);
1955
+ // Otherwise this return pointer might point to the wrong tree:
1956
+ node = node['return'];
1957
+ } while (node);
1958
+ return info;
1959
+ }
1960
+
1961
+ var ReactFiberComponentTreeHook = {
1962
+ getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$2,
1963
+ describeComponentFrame: describeComponentFrame$1
1964
+ };
1965
+
1966
+ var getStackAddendumByWorkInProgressFiber$1 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber;
1967
+ var describeComponentFrame = ReactFiberComponentTreeHook.describeComponentFrame;
1968
+
1969
+
1970
+
1971
+
1972
+
1973
+ function isNative(fn) {
1974
+ // Based on isNative() from Lodash
1975
+ var funcToString = Function.prototype.toString;
1976
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1977
+ var reIsNative = RegExp('^' + funcToString
1978
+ // Take an example native function source for comparison
1979
+ .call(hasOwnProperty)
1980
+ // Strip regex characters so we can use it for regex
1981
+ .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
1982
+ // Remove hasOwnProperty from the template to make it generic
1983
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1984
+ try {
1985
+ var source = funcToString.call(fn);
1986
+ return reIsNative.test(source);
1987
+ } catch (err) {
1988
+ return false;
1989
+ }
1990
+ }
1991
+
1992
+ var canUseCollections =
1993
+ // Array.from
1994
+ typeof Array.from === 'function' &&
1995
+ // Map
1996
+ typeof Map === 'function' && isNative(Map) &&
1997
+ // Map.prototype.keys
1998
+ Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) &&
1999
+ // Set
2000
+ typeof Set === 'function' && isNative(Set) &&
2001
+ // Set.prototype.keys
2002
+ Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys);
2003
+
2004
+ var setItem;
2005
+ var getItem;
2006
+ var removeItem;
2007
+ var getItemIDs;
2008
+ var addRoot;
2009
+ var removeRoot;
2010
+ var getRootIDs;
2011
+
2012
+ if (canUseCollections) {
2013
+ var itemMap = new Map();
2014
+ var rootIDSet = new Set();
2015
+
2016
+ setItem = function (id, item) {
2017
+ itemMap.set(id, item);
2018
+ };
2019
+ getItem = function (id) {
2020
+ return itemMap.get(id);
2021
+ };
2022
+ removeItem = function (id) {
2023
+ itemMap['delete'](id);
2024
+ };
2025
+ getItemIDs = function () {
2026
+ return Array.from(itemMap.keys());
2027
+ };
2028
+
2029
+ addRoot = function (id) {
2030
+ rootIDSet.add(id);
2031
+ };
2032
+ removeRoot = function (id) {
2033
+ rootIDSet['delete'](id);
2034
+ };
2035
+ getRootIDs = function () {
2036
+ return Array.from(rootIDSet.keys());
2037
+ };
2038
+ } else {
2039
+ var itemByKey = {};
2040
+ var rootByKey = {};
2041
+
2042
+ // Use non-numeric keys to prevent V8 performance issues:
2043
+ // https://github.com/facebook/react/pull/7232
2044
+ var getKeyFromID = function (id) {
2045
+ return '.' + id;
2046
+ };
2047
+ var getIDFromKey = function (key) {
2048
+ return parseInt(key.substr(1), 10);
2049
+ };
2050
+
2051
+ setItem = function (id, item) {
2052
+ var key = getKeyFromID(id);
2053
+ itemByKey[key] = item;
2054
+ };
2055
+ getItem = function (id) {
2056
+ var key = getKeyFromID(id);
2057
+ return itemByKey[key];
2058
+ };
2059
+ removeItem = function (id) {
2060
+ var key = getKeyFromID(id);
2061
+ delete itemByKey[key];
2062
+ };
2063
+ getItemIDs = function () {
2064
+ return Object.keys(itemByKey).map(getIDFromKey);
2065
+ };
2066
+
2067
+ addRoot = function (id) {
2068
+ var key = getKeyFromID(id);
2069
+ rootByKey[key] = true;
2070
+ };
2071
+ removeRoot = function (id) {
2072
+ var key = getKeyFromID(id);
2073
+ delete rootByKey[key];
2074
+ };
2075
+ getRootIDs = function () {
2076
+ return Object.keys(rootByKey).map(getIDFromKey);
2077
+ };
2078
+ }
2079
+
2080
+ var unmountedIDs = [];
2081
+
2082
+ function purgeDeep(id) {
2083
+ var item = getItem(id);
2084
+ if (item) {
2085
+ var childIDs = item.childIDs;
2086
+
2087
+ removeItem(id);
2088
+ childIDs.forEach(purgeDeep);
2089
+ }
2090
+ }
2091
+
2092
+ function getDisplayName(element) {
2093
+ if (element == null) {
2094
+ return '#empty';
2095
+ } else if (typeof element === 'string' || typeof element === 'number') {
2096
+ return '#text';
2097
+ } else if (typeof element.type === 'string') {
2098
+ return element.type;
2099
+ } else {
2100
+ return element.type.displayName || element.type.name || 'Unknown';
2101
+ }
2102
+ }
2103
+
2104
+ function describeID(id) {
2105
+ var name = ReactComponentTreeHook.getDisplayName(id);
2106
+ var element = ReactComponentTreeHook.getElement(id);
2107
+ var ownerID = ReactComponentTreeHook.getOwnerID(id);
2108
+ var ownerName = void 0;
2109
+
2110
+ if (ownerID) {
2111
+ ownerName = ReactComponentTreeHook.getDisplayName(ownerID);
2112
+ }
2113
+ warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id);
2114
+ return describeComponentFrame(name || '', element && element._source, ownerName || '');
2115
+ }
2116
+
2117
+ var ReactComponentTreeHook = {
2118
+ onSetChildren: function (id, nextChildIDs) {
2119
+ var item = getItem(id);
2120
+ invariant(item, 'Item must have been set');
2121
+ item.childIDs = nextChildIDs;
2122
+
2123
+ for (var i = 0; i < nextChildIDs.length; i++) {
2124
+ var nextChildID = nextChildIDs[i];
2125
+ var nextChild = getItem(nextChildID);
2126
+ !nextChild ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : void 0;
2127
+ !(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;
2128
+ !nextChild.isMounted ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : void 0;
2129
+ if (nextChild.parentID == null) {
2130
+ nextChild.parentID = id;
2131
+ // TODO: This shouldn't be necessary but mounting a new root during in
2132
+ // componentWillMount currently causes not-yet-mounted components to
2133
+ // be purged from our tree data so their parent id is missing.
2134
+ }
2135
+ !(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;
2136
+ }
2137
+ },
2138
+ onBeforeMountComponent: function (id, element, parentID) {
2139
+ var item = {
2140
+ element: element,
2141
+ parentID: parentID,
2142
+ text: null,
2143
+ childIDs: [],
2144
+ isMounted: false,
2145
+ updateCount: 0
2146
+ };
2147
+ setItem(id, item);
2148
+ },
2149
+ onBeforeUpdateComponent: function (id, element) {
2150
+ var item = getItem(id);
2151
+ if (!item || !item.isMounted) {
2152
+ // We may end up here as a result of setState() in componentWillUnmount().
2153
+ // In this case, ignore the element.
2154
+ return;
2155
+ }
2156
+ item.element = element;
2157
+ },
2158
+ onMountComponent: function (id) {
2159
+ var item = getItem(id);
2160
+ invariant(item, 'Item must have been set');
2161
+ item.isMounted = true;
2162
+ var isRoot = item.parentID === 0;
2163
+ if (isRoot) {
2164
+ addRoot(id);
2165
+ }
2166
+ },
2167
+ onUpdateComponent: function (id) {
2168
+ var item = getItem(id);
2169
+ if (!item || !item.isMounted) {
2170
+ // We may end up here as a result of setState() in componentWillUnmount().
2171
+ // In this case, ignore the element.
2172
+ return;
2173
+ }
2174
+ item.updateCount++;
2175
+ },
2176
+ onUnmountComponent: function (id) {
2177
+ var item = getItem(id);
2178
+ if (item) {
2179
+ // We need to check if it exists.
2180
+ // `item` might not exist if it is inside an error boundary, and a sibling
2181
+ // error boundary child threw while mounting. Then this instance never
2182
+ // got a chance to mount, but it still gets an unmounting event during
2183
+ // the error boundary cleanup.
2184
+ item.isMounted = false;
2185
+ var isRoot = item.parentID === 0;
2186
+ if (isRoot) {
2187
+ removeRoot(id);
2188
+ }
2189
+ }
2190
+ unmountedIDs.push(id);
2191
+ },
2192
+ purgeUnmountedComponents: function () {
2193
+ if (ReactComponentTreeHook._preventPurging) {
2194
+ // Should only be used for testing.
2195
+ return;
2196
+ }
2197
+
2198
+ for (var i = 0; i < unmountedIDs.length; i++) {
2199
+ var id = unmountedIDs[i];
2200
+ purgeDeep(id);
2201
+ }
2202
+ unmountedIDs.length = 0;
2203
+ },
2204
+ isMounted: function (id) {
2205
+ var item = getItem(id);
2206
+ return item ? item.isMounted : false;
2207
+ },
2208
+ getCurrentStackAddendum: function (topElement) {
2209
+ var info = '';
2210
+ if (topElement) {
2211
+ var name = getDisplayName(topElement);
2212
+ var owner = topElement._owner;
2213
+ info += describeComponentFrame(name, topElement._source, owner && getComponentName_1(owner));
2214
+ }
2215
+
2216
+ var currentOwner = ReactCurrentOwner_1.current;
2217
+ if (currentOwner) {
2218
+ if (typeof currentOwner.tag === 'number') {
2219
+ var workInProgress = currentOwner;
2220
+ // Safe because if current owner exists, we are reconciling,
2221
+ // and it is guaranteed to be the work-in-progress version.
2222
+ info += getStackAddendumByWorkInProgressFiber$1(workInProgress);
2223
+ } else if (typeof currentOwner._debugID === 'number') {
2224
+ info += ReactComponentTreeHook.getStackAddendumByID(currentOwner._debugID);
2225
+ }
2226
+ }
2227
+ return info;
2228
+ },
2229
+ getStackAddendumByID: function (id) {
2230
+ var info = '';
2231
+ while (id) {
2232
+ info += describeID(id);
2233
+ id = ReactComponentTreeHook.getParentID(id);
2234
+ }
2235
+ return info;
2236
+ },
2237
+ getChildIDs: function (id) {
2238
+ var item = getItem(id);
2239
+ return item ? item.childIDs : [];
2240
+ },
2241
+ getDisplayName: function (id) {
2242
+ var element = ReactComponentTreeHook.getElement(id);
2243
+ if (!element) {
2244
+ return null;
2245
+ }
2246
+ return getDisplayName(element);
2247
+ },
2248
+ getElement: function (id) {
2249
+ var item = getItem(id);
2250
+ return item ? item.element : null;
2251
+ },
2252
+ getOwnerID: function (id) {
2253
+ var element = ReactComponentTreeHook.getElement(id);
2254
+ if (!element || !element._owner) {
2255
+ return null;
2256
+ }
2257
+ return element._owner._debugID;
2258
+ },
2259
+ getParentID: function (id) {
2260
+ var item = getItem(id);
2261
+ return item ? item.parentID : null;
2262
+ },
2263
+ getSource: function (id) {
2264
+ var item = getItem(id);
2265
+ var element = item ? item.element : null;
2266
+ var source = element != null ? element._source : null;
2267
+ return source;
2268
+ },
2269
+ getText: function (id) {
2270
+ var element = ReactComponentTreeHook.getElement(id);
2271
+ if (typeof element === 'string') {
2272
+ return element;
2273
+ } else if (typeof element === 'number') {
2274
+ return '' + element;
2275
+ } else {
2276
+ return null;
2277
+ }
2278
+ },
2279
+ getUpdateCount: function (id) {
2280
+ var item = getItem(id);
2281
+ return item ? item.updateCount : 0;
2282
+ },
2283
+
2284
+
2285
+ getRootIDs: getRootIDs,
2286
+ getRegisteredIDs: getItemIDs
2287
+ };
2288
+
2289
+ var ReactComponentTreeHook_1 = ReactComponentTreeHook;
2290
+
2291
+ var ReactDebugCurrentFrame$1 = {};
2292
+
2293
+ {
2294
+ var _require$1 = ReactComponentTreeHook_1,
2295
+ getStackAddendumByID = _require$1.getStackAddendumByID,
2296
+ getCurrentStackAddendum$1 = _require$1.getCurrentStackAddendum;
2297
+
2298
+ var _require2 = ReactFiberComponentTreeHook,
2299
+ getStackAddendumByWorkInProgressFiber = _require2.getStackAddendumByWorkInProgressFiber;
2300
+
2301
+ // Component that is being worked on
2302
+
2303
+
2304
+ ReactDebugCurrentFrame$1.current = null;
2305
+
2306
+ // Element that is being cloned or created
2307
+ ReactDebugCurrentFrame$1.element = null;
2308
+
2309
+ ReactDebugCurrentFrame$1.getStackAddendum = function () {
2310
+ var stack = null;
2311
+ var current = ReactDebugCurrentFrame$1.current;
2312
+ var element = ReactDebugCurrentFrame$1.element;
2313
+ if (current !== null) {
2314
+ if (typeof current === 'number') {
2315
+ // DebugID from Stack.
2316
+ var debugID = current;
2317
+ stack = getStackAddendumByID(debugID);
2318
+ } else if (typeof current.tag === 'number') {
2319
+ // This is a Fiber.
2320
+ // The stack will only be correct if this is a work in progress
2321
+ // version and we're calling it during reconciliation.
2322
+ var workInProgress = current;
2323
+ stack = getStackAddendumByWorkInProgressFiber(workInProgress);
2324
+ }
2325
+ } else if (element !== null) {
2326
+ stack = getCurrentStackAddendum$1(element);
2327
+ }
2328
+ return stack;
2329
+ };
2330
+ }
2331
+
2332
+ var ReactDebugCurrentFrame_1 = ReactDebugCurrentFrame$1;
2333
+
2334
+ var getStackAddendum = ReactDebugCurrentFrame_1.getStackAddendum;
2335
+
2336
+ function checkReactTypeSpec(typeSpecs, values, location, componentName) {
2337
+ checkPropTypes_1(typeSpecs, values, location, componentName, getStackAddendum);
2338
+ }
2339
+
2340
+ var checkReactTypeSpec_1 = checkReactTypeSpec;
2341
+
2342
+ {
2343
+ var warning$2 = warning;
2344
+ var ReactDebugCurrentFrame = ReactDebugCurrentFrame_1;
2345
+
2346
+ var _require = ReactComponentTreeHook_1,
2347
+ getCurrentStackAddendum = _require.getCurrentStackAddendum;
2348
+ }
2349
+
2350
+ function getDeclarationErrorAddendum() {
2351
+ if (ReactCurrentOwner_1.current) {
2352
+ var name = getComponentName_1(ReactCurrentOwner_1.current);
2353
+ if (name) {
2354
+ return '\n\nCheck the render method of `' + name + '`.';
2355
+ }
2356
+ }
2357
+ return '';
2358
+ }
2359
+
2360
+ function getSourceInfoErrorAddendum(elementProps) {
2361
+ if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
2362
+ var source = elementProps.__source;
2363
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2364
+ var lineNumber = source.lineNumber;
2365
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2366
+ }
2367
+ return '';
2368
+ }
2369
+
2370
+ /**
2371
+ * Warn if there's no key explicitly set on dynamic arrays of children or
2372
+ * object keys are not valid. This allows us to keep track of children between
2373
+ * updates.
2374
+ */
2375
+ var ownerHasKeyUseWarning = {};
2376
+
2377
+ function getCurrentComponentErrorInfo(parentType) {
2378
+ var info = getDeclarationErrorAddendum();
2379
+
2380
+ if (!info) {
2381
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2382
+ if (parentName) {
2383
+ info = '\n\nCheck the top-level render call using <' + parentName + '>.';
2384
+ }
2385
+ }
2386
+ return info;
2387
+ }
2388
+
2389
+ /**
2390
+ * Warn if the element doesn't have an explicit key assigned to it.
2391
+ * This element is in an array. The array could grow and shrink or be
2392
+ * reordered. All children that haven't already been validated are required to
2393
+ * have a "key" property assigned to it. Error statuses are cached so a warning
2394
+ * will only be shown once.
2395
+ *
2396
+ * @internal
2397
+ * @param {ReactElement} element Element that requires a key.
2398
+ * @param {*} parentType element's parent's type.
2399
+ */
2400
+ function validateExplicitKey(element, parentType) {
2401
+ if (!element._store || element._store.validated || element.key != null) {
2402
+ return;
2403
+ }
2404
+ element._store.validated = true;
2405
+
2406
+ var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {});
2407
+
2408
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2409
+ if (memoizer[currentComponentErrorInfo]) {
2410
+ return;
2411
+ }
2412
+ memoizer[currentComponentErrorInfo] = true;
2413
+
2414
+ // Usually the current owner is the offender, but if it accepts children as a
2415
+ // property, it may be the creator of the child that's responsible for
2416
+ // assigning it a key.
2417
+ var childOwner = '';
2418
+ if (element && element._owner && element._owner !== ReactCurrentOwner_1.current) {
2419
+ // Give the component that originally created this child.
2420
+ childOwner = ' It was passed a child from ' + getComponentName_1(element._owner) + '.';
2421
+ }
2422
+
2423
+ warning$2(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));
2424
+ }
2425
+
2426
+ /**
2427
+ * Ensure that every element either is passed in a static location, in an
2428
+ * array with an explicit keys property defined, or in an object literal
2429
+ * with valid key property.
2430
+ *
2431
+ * @internal
2432
+ * @param {ReactNode} node Statically passed child of any type.
2433
+ * @param {*} parentType node's parent's type.
2434
+ */
2435
+ function validateChildKeys(node, parentType) {
2436
+ if (typeof node !== 'object') {
2437
+ return;
2438
+ }
2439
+ if (Array.isArray(node)) {
2440
+ for (var i = 0; i < node.length; i++) {
2441
+ var child = node[i];
2442
+ if (ReactElement_1.isValidElement(child)) {
2443
+ validateExplicitKey(child, parentType);
2444
+ }
2445
+ }
2446
+ } else if (ReactElement_1.isValidElement(node)) {
2447
+ // This element was passed in a valid location.
2448
+ if (node._store) {
2449
+ node._store.validated = true;
2450
+ }
2451
+ } else if (node) {
2452
+ var iteratorFn = getIteratorFn_1(node);
2453
+ // Entry iterators provide implicit keys.
2454
+ if (iteratorFn) {
2455
+ if (iteratorFn !== node.entries) {
2456
+ var iterator = iteratorFn.call(node);
2457
+ var step;
2458
+ while (!(step = iterator.next()).done) {
2459
+ if (ReactElement_1.isValidElement(step.value)) {
2460
+ validateExplicitKey(step.value, parentType);
2461
+ }
2462
+ }
2463
+ }
2464
+ }
2465
+ }
2466
+ }
2467
+
2468
+ /**
2469
+ * Given an element, validate that its props follow the propTypes definition,
2470
+ * provided by the type.
2471
+ *
2472
+ * @param {ReactElement} element
2473
+ */
2474
+ function validatePropTypes(element) {
2475
+ var componentClass = element.type;
2476
+ if (typeof componentClass !== 'function') {
2477
+ return;
2478
+ }
2479
+ var name = componentClass.displayName || componentClass.name;
2480
+
2481
+ // ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
2482
+ // In their place a temporary getter has been added with a deprecated warning message.
2483
+ // Avoid triggering that warning during validation using the temporary workaround,
2484
+ // __propTypesSecretDontUseThesePlease.
2485
+ // TODO (bvaughn) Revert this particular change any time after April 1 ReactNative tag.
2486
+ var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object' ? componentClass.__propTypesSecretDontUseThesePlease : componentClass.propTypes;
2487
+
2488
+ if (propTypes) {
2489
+ checkReactTypeSpec_1(propTypes, element.props, 'prop', name);
2490
+ }
2491
+ if (typeof componentClass.getDefaultProps === 'function') {
2492
+ warning$2(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2493
+ }
2494
+ }
2495
+
2496
+ var ReactElementValidator$2 = {
2497
+ createElement: function (type, props, children) {
2498
+ var validType = typeof type === 'string' || typeof type === 'function';
2499
+ // We warn in this case but don't throw. We expect the element creation to
2500
+ // succeed and there will likely be errors in render.
2501
+ if (!validType) {
2502
+ var info = '';
2503
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2504
+ info += ' You likely forgot to export your component from the file ' + "it's defined in.";
2505
+ }
2506
+
2507
+ var sourceInfo = getSourceInfoErrorAddendum(props);
2508
+ if (sourceInfo) {
2509
+ info += sourceInfo;
2510
+ } else {
2511
+ info += getDeclarationErrorAddendum();
2512
+ }
2513
+
2514
+ info += getCurrentStackAddendum();
2515
+
2516
+ warning$2(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);
2517
+ }
2518
+
2519
+ var element = ReactElement_1.createElement.apply(this, arguments);
2520
+
2521
+ // The result can be nullish if a mock or a custom function is used.
2522
+ // TODO: Drop this when these are no longer allowed as the type argument.
2523
+ if (element == null) {
2524
+ return element;
2525
+ }
2526
+
2527
+ {
2528
+ ReactDebugCurrentFrame.element = element;
2529
+ }
2530
+
2531
+ // Skip key warning if the type isn't valid since our key validation logic
2532
+ // doesn't expect a non-string/function type and can throw confusing errors.
2533
+ // We don't want exception behavior to differ between dev and prod.
2534
+ // (Rendering will throw with a helpful message and as soon as the type is
2535
+ // fixed, the key warnings will appear.)
2536
+ if (validType) {
2537
+ for (var i = 2; i < arguments.length; i++) {
2538
+ validateChildKeys(arguments[i], type);
2539
+ }
2540
+ }
2541
+
2542
+ validatePropTypes(element);
2543
+
2544
+ {
2545
+ ReactDebugCurrentFrame.element = null;
2546
+ }
2547
+
2548
+ return element;
2549
+ },
2550
+
2551
+ createFactory: function (type) {
2552
+ var validatedFactory = ReactElementValidator$2.createElement.bind(null, type);
2553
+ // Legacy hook TODO: Warn if this is accessed
2554
+ validatedFactory.type = type;
2555
+
2556
+ {
2557
+ if (canDefineProperty_1) {
2558
+ Object.defineProperty(validatedFactory, 'type', {
2559
+ enumerable: false,
2560
+ get: function () {
2561
+ warning$2(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2562
+ Object.defineProperty(this, 'type', {
2563
+ value: type
2564
+ });
2565
+ return type;
2566
+ }
2567
+ });
2568
+ }
2569
+ }
2570
+
2571
+ return validatedFactory;
2572
+ },
2573
+
2574
+ cloneElement: function (element, props, children) {
2575
+ var newElement = ReactElement_1.cloneElement.apply(this, arguments);
2576
+ {
2577
+ ReactDebugCurrentFrame.element = newElement;
2578
+ }
2579
+ for (var i = 2; i < arguments.length; i++) {
2580
+ validateChildKeys(arguments[i], newElement.type);
2581
+ }
2582
+ validatePropTypes(newElement);
2583
+ {
2584
+ ReactDebugCurrentFrame.element = null;
2585
+ }
2586
+ return newElement;
2587
+ }
2588
+ };
2589
+
2590
+ var ReactElementValidator_1 = ReactElementValidator$2;
2591
+
2592
+ /**
2593
+ * Create a factory that creates HTML tag elements.
2594
+ *
2595
+ * @private
2596
+ */
2597
+ var createDOMFactory = ReactElement_1.createFactory;
2598
+ {
2599
+ var ReactElementValidator$1 = ReactElementValidator_1;
2600
+ createDOMFactory = ReactElementValidator$1.createFactory;
2601
+ }
2602
+
2603
+ /**
2604
+ * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes.
2605
+ * This is also accessible via `React.DOM`.
2606
+ *
2607
+ * @public
2608
+ */
2609
+ var ReactDOMFactories = {
2610
+ a: createDOMFactory('a'),
2611
+ abbr: createDOMFactory('abbr'),
2612
+ address: createDOMFactory('address'),
2613
+ area: createDOMFactory('area'),
2614
+ article: createDOMFactory('article'),
2615
+ aside: createDOMFactory('aside'),
2616
+ audio: createDOMFactory('audio'),
2617
+ b: createDOMFactory('b'),
2618
+ base: createDOMFactory('base'),
2619
+ bdi: createDOMFactory('bdi'),
2620
+ bdo: createDOMFactory('bdo'),
2621
+ big: createDOMFactory('big'),
2622
+ blockquote: createDOMFactory('blockquote'),
2623
+ body: createDOMFactory('body'),
2624
+ br: createDOMFactory('br'),
2625
+ button: createDOMFactory('button'),
2626
+ canvas: createDOMFactory('canvas'),
2627
+ caption: createDOMFactory('caption'),
2628
+ cite: createDOMFactory('cite'),
2629
+ code: createDOMFactory('code'),
2630
+ col: createDOMFactory('col'),
2631
+ colgroup: createDOMFactory('colgroup'),
2632
+ data: createDOMFactory('data'),
2633
+ datalist: createDOMFactory('datalist'),
2634
+ dd: createDOMFactory('dd'),
2635
+ del: createDOMFactory('del'),
2636
+ details: createDOMFactory('details'),
2637
+ dfn: createDOMFactory('dfn'),
2638
+ dialog: createDOMFactory('dialog'),
2639
+ div: createDOMFactory('div'),
2640
+ dl: createDOMFactory('dl'),
2641
+ dt: createDOMFactory('dt'),
2642
+ em: createDOMFactory('em'),
2643
+ embed: createDOMFactory('embed'),
2644
+ fieldset: createDOMFactory('fieldset'),
2645
+ figcaption: createDOMFactory('figcaption'),
2646
+ figure: createDOMFactory('figure'),
2647
+ footer: createDOMFactory('footer'),
2648
+ form: createDOMFactory('form'),
2649
+ h1: createDOMFactory('h1'),
2650
+ h2: createDOMFactory('h2'),
2651
+ h3: createDOMFactory('h3'),
2652
+ h4: createDOMFactory('h4'),
2653
+ h5: createDOMFactory('h5'),
2654
+ h6: createDOMFactory('h6'),
2655
+ head: createDOMFactory('head'),
2656
+ header: createDOMFactory('header'),
2657
+ hgroup: createDOMFactory('hgroup'),
2658
+ hr: createDOMFactory('hr'),
2659
+ html: createDOMFactory('html'),
2660
+ i: createDOMFactory('i'),
2661
+ iframe: createDOMFactory('iframe'),
2662
+ img: createDOMFactory('img'),
2663
+ input: createDOMFactory('input'),
2664
+ ins: createDOMFactory('ins'),
2665
+ kbd: createDOMFactory('kbd'),
2666
+ keygen: createDOMFactory('keygen'),
2667
+ label: createDOMFactory('label'),
2668
+ legend: createDOMFactory('legend'),
2669
+ li: createDOMFactory('li'),
2670
+ link: createDOMFactory('link'),
2671
+ main: createDOMFactory('main'),
2672
+ map: createDOMFactory('map'),
2673
+ mark: createDOMFactory('mark'),
2674
+ menu: createDOMFactory('menu'),
2675
+ menuitem: createDOMFactory('menuitem'),
2676
+ meta: createDOMFactory('meta'),
2677
+ meter: createDOMFactory('meter'),
2678
+ nav: createDOMFactory('nav'),
2679
+ noscript: createDOMFactory('noscript'),
2680
+ object: createDOMFactory('object'),
2681
+ ol: createDOMFactory('ol'),
2682
+ optgroup: createDOMFactory('optgroup'),
2683
+ option: createDOMFactory('option'),
2684
+ output: createDOMFactory('output'),
2685
+ p: createDOMFactory('p'),
2686
+ param: createDOMFactory('param'),
2687
+ picture: createDOMFactory('picture'),
2688
+ pre: createDOMFactory('pre'),
2689
+ progress: createDOMFactory('progress'),
2690
+ q: createDOMFactory('q'),
2691
+ rp: createDOMFactory('rp'),
2692
+ rt: createDOMFactory('rt'),
2693
+ ruby: createDOMFactory('ruby'),
2694
+ s: createDOMFactory('s'),
2695
+ samp: createDOMFactory('samp'),
2696
+ script: createDOMFactory('script'),
2697
+ section: createDOMFactory('section'),
2698
+ select: createDOMFactory('select'),
2699
+ small: createDOMFactory('small'),
2700
+ source: createDOMFactory('source'),
2701
+ span: createDOMFactory('span'),
2702
+ strong: createDOMFactory('strong'),
2703
+ style: createDOMFactory('style'),
2704
+ sub: createDOMFactory('sub'),
2705
+ summary: createDOMFactory('summary'),
2706
+ sup: createDOMFactory('sup'),
2707
+ table: createDOMFactory('table'),
2708
+ tbody: createDOMFactory('tbody'),
2709
+ td: createDOMFactory('td'),
2710
+ textarea: createDOMFactory('textarea'),
2711
+ tfoot: createDOMFactory('tfoot'),
2712
+ th: createDOMFactory('th'),
2713
+ thead: createDOMFactory('thead'),
2714
+ time: createDOMFactory('time'),
2715
+ title: createDOMFactory('title'),
2716
+ tr: createDOMFactory('tr'),
2717
+ track: createDOMFactory('track'),
2718
+ u: createDOMFactory('u'),
2719
+ ul: createDOMFactory('ul'),
2720
+ 'var': createDOMFactory('var'),
2721
+ video: createDOMFactory('video'),
2722
+ wbr: createDOMFactory('wbr'),
2723
+
2724
+ // SVG
2725
+ circle: createDOMFactory('circle'),
2726
+ clipPath: createDOMFactory('clipPath'),
2727
+ defs: createDOMFactory('defs'),
2728
+ ellipse: createDOMFactory('ellipse'),
2729
+ g: createDOMFactory('g'),
2730
+ image: createDOMFactory('image'),
2731
+ line: createDOMFactory('line'),
2732
+ linearGradient: createDOMFactory('linearGradient'),
2733
+ mask: createDOMFactory('mask'),
2734
+ path: createDOMFactory('path'),
2735
+ pattern: createDOMFactory('pattern'),
2736
+ polygon: createDOMFactory('polygon'),
2737
+ polyline: createDOMFactory('polyline'),
2738
+ radialGradient: createDOMFactory('radialGradient'),
2739
+ rect: createDOMFactory('rect'),
2740
+ stop: createDOMFactory('stop'),
2741
+ svg: createDOMFactory('svg'),
2742
+ text: createDOMFactory('text'),
2743
+ tspan: createDOMFactory('tspan')
2744
+ };
2745
+
2746
+ var ReactDOMFactories_1 = ReactDOMFactories;
2747
+
2748
+ /**
2749
+ * Collection of methods that allow declaration and validation of props that are
2750
+ * supplied to React components. Example usage:
2751
+ *
2752
+ * var Props = require('ReactPropTypes');
2753
+ * var MyArticle = React.createClass({
2754
+ * propTypes: {
2755
+ * // An optional string prop named "description".
2756
+ * description: Props.string,
2757
+ *
2758
+ * // A required enum prop named "category".
2759
+ * category: Props.oneOf(['News','Photos']).isRequired,
2760
+ *
2761
+ * // A prop named "dialog" that requires an instance of Dialog.
2762
+ * dialog: Props.instanceOf(Dialog).isRequired
2763
+ * },
2764
+ * render: function() { ... }
2765
+ * });
2766
+ *
2767
+ * A more formal specification of how these methods are used:
2768
+ *
2769
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
2770
+ * decl := ReactPropTypes.{type}(.isRequired)?
2771
+ *
2772
+ * Each and every declaration produces a function with the same signature. This
2773
+ * allows the creation of custom validation functions. For example:
2774
+ *
2775
+ * var MyLink = React.createClass({
2776
+ * propTypes: {
2777
+ * // An optional string or URI prop named "href".
2778
+ * href: function(props, propName, componentName) {
2779
+ * var propValue = props[propName];
2780
+ * if (propValue != null && typeof propValue !== 'string' &&
2781
+ * !(propValue instanceof URI)) {
2782
+ * return new Error(
2783
+ * 'Expected a string or an URI for ' + propName + ' in ' +
2784
+ * componentName
2785
+ * );
2786
+ * }
2787
+ * }
2788
+ * },
2789
+ * render: function() {...}
2790
+ * });
2791
+ *
2792
+ * @internal
2793
+ */
2794
+
2795
+ var ANONYMOUS = '<<anonymous>>';
2796
+
2797
+ var ReactPropTypes;
2798
+
2799
+ {
2800
+ // Keep in sync with production version below
2801
+ ReactPropTypes = {
2802
+ array: createPrimitiveTypeChecker('array'),
2803
+ bool: createPrimitiveTypeChecker('boolean'),
2804
+ func: createPrimitiveTypeChecker('function'),
2805
+ number: createPrimitiveTypeChecker('number'),
2806
+ object: createPrimitiveTypeChecker('object'),
2807
+ string: createPrimitiveTypeChecker('string'),
2808
+ symbol: createPrimitiveTypeChecker('symbol'),
2809
+
2810
+ any: createAnyTypeChecker(),
2811
+ arrayOf: createArrayOfTypeChecker,
2812
+ element: createElementTypeChecker(),
2813
+ instanceOf: createInstanceTypeChecker,
2814
+ node: createNodeChecker(),
2815
+ objectOf: createObjectOfTypeChecker,
2816
+ oneOf: createEnumTypeChecker,
2817
+ oneOfType: createUnionTypeChecker,
2818
+ shape: createShapeTypeChecker
2819
+ };
2820
+ }
2821
+
2822
+ /**
2823
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
2824
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
2825
+ */
2826
+ /*eslint-disable no-self-compare*/
2827
+ function is(x, y) {
2828
+ // SameValue algorithm
2829
+ if (x === y) {
2830
+ // Steps 1-5, 7-10
2831
+ // Steps 6.b-6.e: +0 != -0
2832
+ return x !== 0 || 1 / x === 1 / y;
2833
+ } else {
2834
+ // Step 6.a: NaN == NaN
2835
+ return x !== x && y !== y;
2836
+ }
2837
+ }
2838
+ /*eslint-enable no-self-compare*/
2839
+
2840
+ /**
2841
+ * We use an Error-like object for backward compatibility as people may call
2842
+ * PropTypes directly and inspect their output. However, we don't use real
2843
+ * Errors anymore. We don't inspect their stack anyway, and creating them
2844
+ * is prohibitively expensive if they are created too often, such as what
2845
+ * happens in oneOfType() for any type before the one that matched.
2846
+ */
2847
+ function PropTypeError(message) {
2848
+ this.message = message;
2849
+ this.stack = '';
2850
+ }
2851
+ // Make `instanceof Error` still work for returned errors.
2852
+ PropTypeError.prototype = Error.prototype;
2853
+
2854
+ function createChainableTypeChecker(validate) {
2855
+ {
2856
+ var manualPropTypeCallCache = {};
2857
+ }
2858
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
2859
+ componentName = componentName || ANONYMOUS;
2860
+ propFullName = propFullName || propName;
2861
+ {
2862
+ if (secret !== ReactPropTypesSecret_1 && typeof console !== 'undefined') {
2863
+ var cacheKey = componentName + ':' + propName;
2864
+ if (!manualPropTypeCallCache[cacheKey]) {
2865
+ warning(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will not work in production with the next major version. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
2866
+ manualPropTypeCallCache[cacheKey] = true;
2867
+ }
2868
+ }
2869
+ }
2870
+ if (props[propName] == null) {
2871
+ if (isRequired) {
2872
+ if (props[propName] === null) {
2873
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
2874
+ }
2875
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
2876
+ }
2877
+ return null;
2878
+ } else {
2879
+ return validate(props, propName, componentName, location, propFullName);
2880
+ }
2881
+ }
2882
+
2883
+ var chainedCheckType = checkType.bind(null, false);
2884
+ chainedCheckType.isRequired = checkType.bind(null, true);
2885
+
2886
+ return chainedCheckType;
2887
+ }
2888
+
2889
+ function createPrimitiveTypeChecker(expectedType) {
2890
+ function validate(props, propName, componentName, location, propFullName, secret) {
2891
+ var propValue = props[propName];
2892
+ var propType = getPropType(propValue);
2893
+ if (propType !== expectedType) {
2894
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
2895
+ // check, but we can offer a more precise error message here rather than
2896
+ // 'of type `object`'.
2897
+ var preciseType = getPreciseType(propValue);
2898
+
2899
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
2900
+ }
2901
+ return null;
2902
+ }
2903
+ return createChainableTypeChecker(validate);
2904
+ }
2905
+
2906
+ function createAnyTypeChecker() {
2907
+ return createChainableTypeChecker(emptyFunction.thatReturnsNull);
2908
+ }
2909
+
2910
+ function createArrayOfTypeChecker(typeChecker) {
2911
+ function validate(props, propName, componentName, location, propFullName) {
2912
+ if (typeof typeChecker !== 'function') {
2913
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
2914
+ }
2915
+ var propValue = props[propName];
2916
+ if (!Array.isArray(propValue)) {
2917
+ var propType = getPropType(propValue);
2918
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
2919
+ }
2920
+ for (var i = 0; i < propValue.length; i++) {
2921
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
2922
+ if (error instanceof Error) {
2923
+ return error;
2924
+ }
2925
+ }
2926
+ return null;
2927
+ }
2928
+ return createChainableTypeChecker(validate);
2929
+ }
2930
+
2931
+ function createElementTypeChecker() {
2932
+ function validate(props, propName, componentName, location, propFullName) {
2933
+ var propValue = props[propName];
2934
+ if (!ReactElement_1.isValidElement(propValue)) {
2935
+ var propType = getPropType(propValue);
2936
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
2937
+ }
2938
+ return null;
2939
+ }
2940
+ return createChainableTypeChecker(validate);
2941
+ }
2942
+
2943
+ function createInstanceTypeChecker(expectedClass) {
2944
+ function validate(props, propName, componentName, location, propFullName) {
2945
+ if (!(props[propName] instanceof expectedClass)) {
2946
+ var expectedClassName = expectedClass.name || ANONYMOUS;
2947
+ var actualClassName = getClassName(props[propName]);
2948
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
2949
+ }
2950
+ return null;
2951
+ }
2952
+ return createChainableTypeChecker(validate);
2953
+ }
2954
+
2955
+ function createEnumTypeChecker(expectedValues) {
2956
+ if (!Array.isArray(expectedValues)) {
2957
+ warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
2958
+ return emptyFunction.thatReturnsNull;
2959
+ }
2960
+
2961
+ function validate(props, propName, componentName, location, propFullName) {
2962
+ var propValue = props[propName];
2963
+ for (var i = 0; i < expectedValues.length; i++) {
2964
+ if (is(propValue, expectedValues[i])) {
2965
+ return null;
2966
+ }
2967
+ }
2968
+
2969
+ var valuesString = JSON.stringify(expectedValues);
2970
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
2971
+ }
2972
+ return createChainableTypeChecker(validate);
2973
+ }
2974
+
2975
+ function createObjectOfTypeChecker(typeChecker) {
2976
+ function validate(props, propName, componentName, location, propFullName) {
2977
+ if (typeof typeChecker !== 'function') {
2978
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
2979
+ }
2980
+ var propValue = props[propName];
2981
+ var propType = getPropType(propValue);
2982
+ if (propType !== 'object') {
2983
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
2984
+ }
2985
+ for (var key in propValue) {
2986
+ if (propValue.hasOwnProperty(key)) {
2987
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
2988
+ if (error instanceof Error) {
2989
+ return error;
2990
+ }
2991
+ }
2992
+ }
2993
+ return null;
2994
+ }
2995
+ return createChainableTypeChecker(validate);
2996
+ }
2997
+
2998
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
2999
+ if (!Array.isArray(arrayOfTypeCheckers)) {
3000
+ warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
3001
+ return emptyFunction.thatReturnsNull;
3002
+ }
3003
+
3004
+ function validate(props, propName, componentName, location, propFullName) {
3005
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3006
+ var checker = arrayOfTypeCheckers[i];
3007
+ if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
3008
+ return null;
3009
+ }
3010
+ }
3011
+
3012
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
3013
+ }
3014
+ return createChainableTypeChecker(validate);
3015
+ }
3016
+
3017
+ function createNodeChecker() {
3018
+ function validate(props, propName, componentName, location, propFullName) {
3019
+ if (!isNode(props[propName])) {
3020
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
3021
+ }
3022
+ return null;
3023
+ }
3024
+ return createChainableTypeChecker(validate);
3025
+ }
3026
+
3027
+ function createShapeTypeChecker(shapeTypes) {
3028
+ function validate(props, propName, componentName, location, propFullName) {
3029
+ var propValue = props[propName];
3030
+ var propType = getPropType(propValue);
3031
+ if (propType !== 'object') {
3032
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3033
+ }
3034
+ for (var key in shapeTypes) {
3035
+ var checker = shapeTypes[key];
3036
+ if (!checker) {
3037
+ continue;
3038
+ }
3039
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
3040
+ if (error) {
3041
+ return error;
3042
+ }
3043
+ }
3044
+ return null;
3045
+ }
3046
+ return createChainableTypeChecker(validate);
3047
+ }
3048
+
3049
+ function isNode(propValue) {
3050
+ switch (typeof propValue) {
3051
+ case 'number':
3052
+ case 'string':
3053
+ case 'undefined':
3054
+ return true;
3055
+ case 'boolean':
3056
+ return !propValue;
3057
+ case 'object':
3058
+ if (Array.isArray(propValue)) {
3059
+ return propValue.every(isNode);
3060
+ }
3061
+ if (propValue === null || ReactElement_1.isValidElement(propValue)) {
3062
+ return true;
3063
+ }
3064
+
3065
+ var iteratorFn = getIteratorFn_1(propValue);
3066
+ if (iteratorFn) {
3067
+ var iterator = iteratorFn.call(propValue);
3068
+ var step;
3069
+ if (iteratorFn !== propValue.entries) {
3070
+ while (!(step = iterator.next()).done) {
3071
+ if (!isNode(step.value)) {
3072
+ return false;
3073
+ }
3074
+ }
3075
+ } else {
3076
+ // Iterator will provide entry [k,v] tuples rather than values.
3077
+ while (!(step = iterator.next()).done) {
3078
+ var entry = step.value;
3079
+ if (entry) {
3080
+ if (!isNode(entry[1])) {
3081
+ return false;
3082
+ }
3083
+ }
3084
+ }
3085
+ }
3086
+ } else {
3087
+ return false;
3088
+ }
3089
+
3090
+ return true;
3091
+ default:
3092
+ return false;
3093
+ }
3094
+ }
3095
+
3096
+ function isSymbol(propType, propValue) {
3097
+ // Native Symbol.
3098
+ if (propType === 'symbol') {
3099
+ return true;
3100
+ }
3101
+
3102
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
3103
+ if (propValue['@@toStringTag'] === 'Symbol') {
3104
+ return true;
3105
+ }
3106
+
3107
+ // Fallback for non-spec compliant Symbols which are polyfilled.
3108
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
3109
+ return true;
3110
+ }
3111
+
3112
+ return false;
3113
+ }
3114
+
3115
+ // Equivalent of `typeof` but with special handling for array and regexp.
3116
+ function getPropType(propValue) {
3117
+ var propType = typeof propValue;
3118
+ if (Array.isArray(propValue)) {
3119
+ return 'array';
3120
+ }
3121
+ if (propValue instanceof RegExp) {
3122
+ // Old webkits (at least until Android 4.0) return 'function' rather than
3123
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
3124
+ // passes PropTypes.object.
3125
+ return 'object';
3126
+ }
3127
+ if (isSymbol(propType, propValue)) {
3128
+ return 'symbol';
3129
+ }
3130
+ return propType;
3131
+ }
3132
+
3133
+ // This handles more types than `getPropType`. Only used for error messages.
3134
+ // See `createPrimitiveTypeChecker`.
3135
+ function getPreciseType(propValue) {
3136
+ var propType = getPropType(propValue);
3137
+ if (propType === 'object') {
3138
+ if (propValue instanceof Date) {
3139
+ return 'date';
3140
+ } else if (propValue instanceof RegExp) {
3141
+ return 'regexp';
3142
+ }
3143
+ }
3144
+ return propType;
3145
+ }
3146
+
3147
+ // Returns class name of the object, if any.
3148
+ function getClassName(propValue) {
3149
+ if (!propValue.constructor || !propValue.constructor.name) {
3150
+ return ANONYMOUS;
3151
+ }
3152
+ return propValue.constructor.name;
3153
+ }
3154
+
3155
+ var ReactPropTypes_1 = ReactPropTypes;
3156
+
3157
+ /**
3158
+ * Copyright 2013-present, Facebook, Inc.
3159
+ * All rights reserved.
3160
+ *
3161
+ * This source code is licensed under the BSD-style license found in the
3162
+ * LICENSE file in the root directory of this source tree. An additional grant
3163
+ * of patent rights can be found in the PATENTS file in the same directory.
3164
+ *
3165
+ * @providesModule ReactVersion
3166
+ */
3167
+
3168
+ var ReactVersion = '16.0.0-alpha.7';
3169
+
3170
+ /**
3171
+ * Returns the first child in a collection of children and verifies that there
3172
+ * is only one child in the collection.
3173
+ *
3174
+ * See https://facebook.github.io/react/docs/react-api.html#react.children.only
3175
+ *
3176
+ * The current implementation of this function assumes that a single child gets
3177
+ * passed without a wrapper, but the purpose of this helper function is to
3178
+ * abstract away the particular structure of children.
3179
+ *
3180
+ * @param {?object} children Child collection structure.
3181
+ * @return {ReactElement} The first and only `ReactElement` contained in the
3182
+ * structure.
3183
+ */
3184
+ function onlyChild(children) {
3185
+ !ReactElement_1.isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
3186
+ return children;
3187
+ }
3188
+
3189
+ var onlyChild_1 = onlyChild;
3190
+
3191
+ var createElement = ReactElement_1.createElement;
3192
+ var createFactory = ReactElement_1.createFactory;
3193
+ var cloneElement = ReactElement_1.cloneElement;
3194
+
3195
+ {
3196
+ var ReactElementValidator = ReactElementValidator_1;
3197
+ createElement = ReactElementValidator.createElement;
3198
+ createFactory = ReactElementValidator.createFactory;
3199
+ cloneElement = ReactElementValidator.cloneElement;
3200
+ }
3201
+
3202
+ var createMixin = function (mixin) {
3203
+ return mixin;
3204
+ };
3205
+
3206
+ {
3207
+ var warnedForCreateMixin = false;
3208
+
3209
+ createMixin = function (mixin) {
3210
+ warning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. You ' + 'can use this mixin directly instead.');
3211
+ warnedForCreateMixin = true;
3212
+ return mixin;
3213
+ };
3214
+ }
3215
+
3216
+ var React = {
3217
+ // Modern
3218
+
3219
+ Children: {
3220
+ map: ReactChildren_1.map,
3221
+ forEach: ReactChildren_1.forEach,
3222
+ count: ReactChildren_1.count,
3223
+ toArray: ReactChildren_1.toArray,
3224
+ only: onlyChild_1
3225
+ },
3226
+
3227
+ Component: ReactBaseClasses.Component,
3228
+ PureComponent: ReactBaseClasses.PureComponent,
3229
+
3230
+ createElement: createElement,
3231
+ cloneElement: cloneElement,
3232
+ isValidElement: ReactElement_1.isValidElement,
3233
+
3234
+ checkPropTypes: checkPropTypes_1,
3235
+
3236
+ // Classic
3237
+
3238
+ PropTypes: ReactPropTypes_1,
3239
+ createClass: ReactClass_1.createClass,
3240
+ createFactory: createFactory,
3241
+ createMixin: createMixin,
3242
+
3243
+ // This looks DOM specific but these are actually isomorphic helpers
3244
+ // since they are just generating DOM strings.
3245
+ DOM: ReactDOMFactories_1,
3246
+
3247
+ version: ReactVersion
3248
+ };
3249
+
3250
+ var React_1 = React;
3251
+
3252
+ // `version` will be added here by the React module.
3253
+ var ReactUMDEntry = _assign({
3254
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
3255
+ ReactCurrentOwner: ReactCurrentOwner_1
3256
+ }
3257
+ }, React_1);
3258
+
3259
+ {
3260
+ _assign(ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
3261
+ // ReactComponentTreeHook should not be included in production.
3262
+ ReactComponentTreeHook: ReactComponentTreeHook_1
3263
+ });
3264
+ }
3265
+
3266
+ var ReactUMDEntry_1 = ReactUMDEntry;
3267
+
3268
+ module.exports = ReactUMDEntry_1;